5 // These should be provided...somehow...
6 void *memset(void *s, int c, size_t n);
7 void *memcpy(void *dest, const void *src, size_t n);
8 int memcmp(const void *s1, const void *s2, size_t n);
10 extern void __attribute__((noreturn)) abort(void);
11 static inline void assert(bool expression) {
12 if (!expression) { abort(); }
15 uint32_t __attribute__((export_name("test_bigint_pass_deadbeef0badf00d"))) test_bigint_pass_deadbeef0badf00d(uint64_t val) {
16 return val == 0xdeadbeef0badf00dULL;
20 void *malloc(size_t size);
23 #define MALLOC(a, _) malloc(a)
24 #define do_MALLOC(a, _b, _c) malloc(a)
25 #define FREE(p) if ((unsigned long)(p) > 4096) { free(p); }
26 #define DO_ASSERT(a) (void)(a)
28 #define CHECK_ACCESS(p)
29 #define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
31 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
32 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
33 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
34 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
36 _Static_assert(sizeof(void*) == 4, "Pointers mut be 32 bits");
38 #define DECL_ARR_TYPE(ty, name) \
39 struct name##array { \
40 uint64_t arr_len; /* uint32_t would suffice but we want to align uint64_ts as well */ \
43 typedef struct name##array * name##Array; \
44 static inline name##Array init_##name##Array(size_t arr_len, int lineno) { \
45 name##Array arr = (name##Array)do_MALLOC(arr_len * sizeof(ty) + sizeof(uint64_t), #name" array init", lineno); \
46 arr->arr_len = arr_len; \
50 DECL_ARR_TYPE(int64_t, int64_t);
51 DECL_ARR_TYPE(uint64_t, uint64_t);
52 DECL_ARR_TYPE(int8_t, int8_t);
53 DECL_ARR_TYPE(uint32_t, uint32_t);
54 DECL_ARR_TYPE(void*, ptr);
55 DECL_ARR_TYPE(char, char);
56 typedef charArray jstring;
58 static inline jstring str_ref_to_ts(const char* chars, size_t len) {
59 charArray arr = init_charArray(len, __LINE__);
60 memcpy(arr->elems, chars, len);
63 static inline LDKStr str_ref_to_owned_c(const jstring str) {
64 char* newchars = MALLOC(str->arr_len + 1, "String chars");
65 memcpy(newchars, str->elems, str->arr_len);
66 newchars[str->arr_len] = 0;
70 .chars_is_owned = true
75 typedef bool jboolean;
77 uint32_t __attribute__((export_name("TS_malloc"))) TS_malloc(uint32_t size) {
78 return (uint32_t)MALLOC(size, "JS-Called malloc");
80 void __attribute__((export_name("TS_free"))) TS_free(uint32_t ptr) {
84 jstring __attribute__((export_name("TS_get_ldk_c_bindings_version"))) TS_get_ldk_c_bindings_version() {
85 const char *res = check_get_ldk_bindings_version();
86 if (res == NULL) return NULL;
87 return str_ref_to_ts(res, strlen(res));
89 jstring __attribute__((export_name("TS_get_ldk_version"))) get_ldk_version() {
90 const char *res = check_get_ldk_version();
91 if (res == NULL) return NULL;
92 return str_ref_to_ts(res, strlen(res));
95 static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
97 static inline void* untag_ptr(uint64_t ptr) {
98 if (ptr < 4096) return (void*)ptr;
99 if (sizeof(void*) == 4) {
100 // For 32-bit systems, store pointers as 64-bit ints and use the 31st bit
101 return (void*)(uintptr_t)ptr;
103 // For 64-bit systems, assume the top byte is used for tagging, then
104 // use bit 9 ^ bit 10.
105 uint64_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
106 uintptr_t p = (ptr & ~(1ULL << 55)) | (tenth_bit << 55);
107 #ifdef LDK_DEBUG_BUILD
108 // On debug builds we also use the 11th bit as a debug flag
109 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
110 CHECK(tenth_bit != eleventh_bit);
116 static inline bool ptr_is_owned(uint64_t ptr) {
117 if(ptr < 4096) return true;
118 if (sizeof(void*) == 4) {
119 return ptr & (1ULL << 32);
121 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
122 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
123 #ifdef LDK_DEBUG_BUILD
124 // On debug builds we also use the 11th bit as a debug flag
125 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
126 CHECK(tenth_bit != eleventh_bit);
128 return (ninth_bit ^ tenth_bit) ? true : false;
131 static inline uint64_t tag_ptr(const void* ptr, bool is_owned) {
132 if ((uintptr_t)ptr < 4096) return (uint64_t)ptr;
133 if (sizeof(void*) == 4) {
134 return (((uint64_t)ptr) | ((is_owned ? 1ULL : 0) << 32));
136 CHECK(sizeof(uintptr_t) == 8);
137 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
138 uintptr_t t = (((uintptr_t)ptr) | (((is_owned ? 1ULL : 0ULL) ^ tenth_bit) << 55));
139 #ifdef LDK_DEBUG_BUILD
140 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
141 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
142 CHECK(ninth_bit == tenth_bit);
143 CHECK(ninth_bit == eleventh_bit);
146 CHECK(ptr_is_owned(t) == is_owned);
147 CHECK(untag_ptr(t) == ptr);
152 static inline LDKAccessError LDKAccessError_from_js(int32_t ord) {
154 case 0: return LDKAccessError_UnknownChain;
155 case 1: return LDKAccessError_UnknownTx;
159 static inline int32_t LDKAccessError_to_js(LDKAccessError val) {
161 case LDKAccessError_UnknownChain: return 0;
162 case LDKAccessError_UnknownTx: return 1;
166 static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_js(int32_t ord) {
168 case 0: return LDKCOption_NoneZ_Some;
169 case 1: return LDKCOption_NoneZ_None;
173 static inline int32_t LDKCOption_NoneZ_to_js(LDKCOption_NoneZ val) {
175 case LDKCOption_NoneZ_Some: return 0;
176 case LDKCOption_NoneZ_None: return 1;
180 static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_js(int32_t ord) {
182 case 0: return LDKChannelMonitorUpdateStatus_Completed;
183 case 1: return LDKChannelMonitorUpdateStatus_InProgress;
184 case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
188 static inline int32_t LDKChannelMonitorUpdateStatus_to_js(LDKChannelMonitorUpdateStatus val) {
190 case LDKChannelMonitorUpdateStatus_Completed: return 0;
191 case LDKChannelMonitorUpdateStatus_InProgress: return 1;
192 case LDKChannelMonitorUpdateStatus_PermanentFailure: return 2;
196 static inline LDKConfirmationTarget LDKConfirmationTarget_from_js(int32_t ord) {
198 case 0: return LDKConfirmationTarget_Background;
199 case 1: return LDKConfirmationTarget_Normal;
200 case 2: return LDKConfirmationTarget_HighPriority;
204 static inline int32_t LDKConfirmationTarget_to_js(LDKConfirmationTarget val) {
206 case LDKConfirmationTarget_Background: return 0;
207 case LDKConfirmationTarget_Normal: return 1;
208 case LDKConfirmationTarget_HighPriority: return 2;
212 static inline LDKCreationError LDKCreationError_from_js(int32_t ord) {
214 case 0: return LDKCreationError_DescriptionTooLong;
215 case 1: return LDKCreationError_RouteTooLong;
216 case 2: return LDKCreationError_TimestampOutOfBounds;
217 case 3: return LDKCreationError_InvalidAmount;
218 case 4: return LDKCreationError_MissingRouteHints;
222 static inline int32_t LDKCreationError_to_js(LDKCreationError val) {
224 case LDKCreationError_DescriptionTooLong: return 0;
225 case LDKCreationError_RouteTooLong: return 1;
226 case LDKCreationError_TimestampOutOfBounds: return 2;
227 case LDKCreationError_InvalidAmount: return 3;
228 case LDKCreationError_MissingRouteHints: return 4;
232 static inline LDKCurrency LDKCurrency_from_js(int32_t ord) {
234 case 0: return LDKCurrency_Bitcoin;
235 case 1: return LDKCurrency_BitcoinTestnet;
236 case 2: return LDKCurrency_Regtest;
237 case 3: return LDKCurrency_Simnet;
238 case 4: return LDKCurrency_Signet;
242 static inline int32_t LDKCurrency_to_js(LDKCurrency val) {
244 case LDKCurrency_Bitcoin: return 0;
245 case LDKCurrency_BitcoinTestnet: return 1;
246 case LDKCurrency_Regtest: return 2;
247 case LDKCurrency_Simnet: return 3;
248 case LDKCurrency_Signet: return 4;
252 static inline LDKIOError LDKIOError_from_js(int32_t ord) {
254 case 0: return LDKIOError_NotFound;
255 case 1: return LDKIOError_PermissionDenied;
256 case 2: return LDKIOError_ConnectionRefused;
257 case 3: return LDKIOError_ConnectionReset;
258 case 4: return LDKIOError_ConnectionAborted;
259 case 5: return LDKIOError_NotConnected;
260 case 6: return LDKIOError_AddrInUse;
261 case 7: return LDKIOError_AddrNotAvailable;
262 case 8: return LDKIOError_BrokenPipe;
263 case 9: return LDKIOError_AlreadyExists;
264 case 10: return LDKIOError_WouldBlock;
265 case 11: return LDKIOError_InvalidInput;
266 case 12: return LDKIOError_InvalidData;
267 case 13: return LDKIOError_TimedOut;
268 case 14: return LDKIOError_WriteZero;
269 case 15: return LDKIOError_Interrupted;
270 case 16: return LDKIOError_Other;
271 case 17: return LDKIOError_UnexpectedEof;
275 static inline int32_t LDKIOError_to_js(LDKIOError val) {
277 case LDKIOError_NotFound: return 0;
278 case LDKIOError_PermissionDenied: return 1;
279 case LDKIOError_ConnectionRefused: return 2;
280 case LDKIOError_ConnectionReset: return 3;
281 case LDKIOError_ConnectionAborted: return 4;
282 case LDKIOError_NotConnected: return 5;
283 case LDKIOError_AddrInUse: return 6;
284 case LDKIOError_AddrNotAvailable: return 7;
285 case LDKIOError_BrokenPipe: return 8;
286 case LDKIOError_AlreadyExists: return 9;
287 case LDKIOError_WouldBlock: return 10;
288 case LDKIOError_InvalidInput: return 11;
289 case LDKIOError_InvalidData: return 12;
290 case LDKIOError_TimedOut: return 13;
291 case LDKIOError_WriteZero: return 14;
292 case LDKIOError_Interrupted: return 15;
293 case LDKIOError_Other: return 16;
294 case LDKIOError_UnexpectedEof: return 17;
298 static inline LDKLevel LDKLevel_from_js(int32_t ord) {
300 case 0: return LDKLevel_Gossip;
301 case 1: return LDKLevel_Trace;
302 case 2: return LDKLevel_Debug;
303 case 3: return LDKLevel_Info;
304 case 4: return LDKLevel_Warn;
305 case 5: return LDKLevel_Error;
309 static inline int32_t LDKLevel_to_js(LDKLevel val) {
311 case LDKLevel_Gossip: return 0;
312 case LDKLevel_Trace: return 1;
313 case LDKLevel_Debug: return 2;
314 case LDKLevel_Info: return 3;
315 case LDKLevel_Warn: return 4;
316 case LDKLevel_Error: return 5;
320 static inline LDKNetwork LDKNetwork_from_js(int32_t ord) {
322 case 0: return LDKNetwork_Bitcoin;
323 case 1: return LDKNetwork_Testnet;
324 case 2: return LDKNetwork_Regtest;
325 case 3: return LDKNetwork_Signet;
329 static inline int32_t LDKNetwork_to_js(LDKNetwork val) {
331 case LDKNetwork_Bitcoin: return 0;
332 case LDKNetwork_Testnet: return 1;
333 case LDKNetwork_Regtest: return 2;
334 case LDKNetwork_Signet: return 3;
338 static inline LDKRecipient LDKRecipient_from_js(int32_t ord) {
340 case 0: return LDKRecipient_Node;
341 case 1: return LDKRecipient_PhantomNode;
345 static inline int32_t LDKRecipient_to_js(LDKRecipient val) {
347 case LDKRecipient_Node: return 0;
348 case LDKRecipient_PhantomNode: return 1;
352 static inline LDKSecp256k1Error LDKSecp256k1Error_from_js(int32_t ord) {
354 case 0: return LDKSecp256k1Error_IncorrectSignature;
355 case 1: return LDKSecp256k1Error_InvalidMessage;
356 case 2: return LDKSecp256k1Error_InvalidPublicKey;
357 case 3: return LDKSecp256k1Error_InvalidSignature;
358 case 4: return LDKSecp256k1Error_InvalidSecretKey;
359 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
360 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
361 case 7: return LDKSecp256k1Error_InvalidTweak;
362 case 8: return LDKSecp256k1Error_NotEnoughMemory;
363 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
364 case 10: return LDKSecp256k1Error_InvalidParityValue;
368 static inline int32_t LDKSecp256k1Error_to_js(LDKSecp256k1Error val) {
370 case LDKSecp256k1Error_IncorrectSignature: return 0;
371 case LDKSecp256k1Error_InvalidMessage: return 1;
372 case LDKSecp256k1Error_InvalidPublicKey: return 2;
373 case LDKSecp256k1Error_InvalidSignature: return 3;
374 case LDKSecp256k1Error_InvalidSecretKey: return 4;
375 case LDKSecp256k1Error_InvalidSharedSecret: return 5;
376 case LDKSecp256k1Error_InvalidRecoveryId: return 6;
377 case LDKSecp256k1Error_InvalidTweak: return 7;
378 case LDKSecp256k1Error_NotEnoughMemory: return 8;
379 case LDKSecp256k1Error_InvalidPublicKeySum: return 9;
380 case LDKSecp256k1Error_InvalidParityValue: return 10;
384 static inline LDKSemanticError LDKSemanticError_from_js(int32_t ord) {
386 case 0: return LDKSemanticError_NoPaymentHash;
387 case 1: return LDKSemanticError_MultiplePaymentHashes;
388 case 2: return LDKSemanticError_NoDescription;
389 case 3: return LDKSemanticError_MultipleDescriptions;
390 case 4: return LDKSemanticError_NoPaymentSecret;
391 case 5: return LDKSemanticError_MultiplePaymentSecrets;
392 case 6: return LDKSemanticError_InvalidFeatures;
393 case 7: return LDKSemanticError_InvalidRecoveryId;
394 case 8: return LDKSemanticError_InvalidSignature;
395 case 9: return LDKSemanticError_ImpreciseAmount;
399 static inline int32_t LDKSemanticError_to_js(LDKSemanticError val) {
401 case LDKSemanticError_NoPaymentHash: return 0;
402 case LDKSemanticError_MultiplePaymentHashes: return 1;
403 case LDKSemanticError_NoDescription: return 2;
404 case LDKSemanticError_MultipleDescriptions: return 3;
405 case LDKSemanticError_NoPaymentSecret: return 4;
406 case LDKSemanticError_MultiplePaymentSecrets: return 5;
407 case LDKSemanticError_InvalidFeatures: return 6;
408 case LDKSemanticError_InvalidRecoveryId: return 7;
409 case LDKSemanticError_InvalidSignature: return 8;
410 case LDKSemanticError_ImpreciseAmount: return 9;
414 static inline LDKSiPrefix LDKSiPrefix_from_js(int32_t ord) {
416 case 0: return LDKSiPrefix_Milli;
417 case 1: return LDKSiPrefix_Micro;
418 case 2: return LDKSiPrefix_Nano;
419 case 3: return LDKSiPrefix_Pico;
423 static inline int32_t LDKSiPrefix_to_js(LDKSiPrefix val) {
425 case LDKSiPrefix_Milli: return 0;
426 case LDKSiPrefix_Micro: return 1;
427 case LDKSiPrefix_Nano: return 2;
428 case LDKSiPrefix_Pico: return 3;
432 struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
433 LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
436 int8_tArray __attribute__((export_name("TS_BigEndianScalar_get_bytes"))) TS_BigEndianScalar_get_bytes(uint64_t thing) {
437 LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
438 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
439 memcpy(ret_arr->elems, BigEndianScalar_get_bytes(thing_conv).data, 32);
443 static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
444 void __attribute__((export_name("TS_BigEndianScalar_free"))) TS_BigEndianScalar_free(uint64_t thing) {
445 if (!ptr_is_owned(thing)) return;
446 void* thing_ptr = untag_ptr(thing);
447 CHECK_ACCESS(thing_ptr);
448 LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
449 FREE(untag_ptr(thing));
450 BigEndianScalar_free(thing_conv);
453 uint32_t __attribute__((export_name("TS_LDKBech32Error_ty_from_ptr"))) TS_LDKBech32Error_ty_from_ptr(uint64_t ptr) {
454 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
456 case LDKBech32Error_MissingSeparator: return 0;
457 case LDKBech32Error_InvalidChecksum: return 1;
458 case LDKBech32Error_InvalidLength: return 2;
459 case LDKBech32Error_InvalidChar: return 3;
460 case LDKBech32Error_InvalidData: return 4;
461 case LDKBech32Error_InvalidPadding: return 5;
462 case LDKBech32Error_MixedCase: return 6;
466 int32_t __attribute__((export_name("TS_LDKBech32Error_InvalidChar_get_invalid_char"))) TS_LDKBech32Error_InvalidChar_get_invalid_char(uint64_t ptr) {
467 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
468 assert(obj->tag == LDKBech32Error_InvalidChar);
469 int32_t invalid_char_conv = obj->invalid_char;
470 return invalid_char_conv;
472 int8_t __attribute__((export_name("TS_LDKBech32Error_InvalidData_get_invalid_data"))) TS_LDKBech32Error_InvalidData_get_invalid_data(uint64_t ptr) {
473 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
474 assert(obj->tag == LDKBech32Error_InvalidData);
475 int8_t invalid_data_conv = obj->invalid_data;
476 return invalid_data_conv;
478 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
479 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
480 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
483 struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) { return CVec_u8Z_clone(&thing->script_pubkey);}int8_tArray __attribute__((export_name("TS_TxOut_get_script_pubkey"))) TS_TxOut_get_script_pubkey(uint64_t thing) {
484 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
485 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
486 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
487 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
488 CVec_u8Z_free(ret_var);
492 uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}int64_t __attribute__((export_name("TS_TxOut_get_value"))) TS_TxOut_get_value(uint64_t thing) {
493 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
494 int64_t ret_conv = TxOut_get_value(thing_conv);
498 static inline struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
499 LDKBlindedRoute ret = *owner->contents.result;
500 ret.is_owned = false;
503 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_get_ok"))) TS_CResult_BlindedRouteNoneZ_get_ok(uint64_t owner) {
504 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
505 LDKBlindedRoute ret_var = CResult_BlindedRouteNoneZ_get_ok(owner_conv);
506 uint64_t ret_ref = 0;
507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
512 static inline void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
513 CHECK(!owner->result_ok);
514 return *owner->contents.err;
516 void __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_get_err"))) TS_CResult_BlindedRouteNoneZ_get_err(uint64_t owner) {
517 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
518 CResult_BlindedRouteNoneZ_get_err(owner_conv);
521 uint32_t __attribute__((export_name("TS_LDKDecodeError_ty_from_ptr"))) TS_LDKDecodeError_ty_from_ptr(uint64_t ptr) {
522 LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
524 case LDKDecodeError_UnknownVersion: return 0;
525 case LDKDecodeError_UnknownRequiredFeature: return 1;
526 case LDKDecodeError_InvalidValue: return 2;
527 case LDKDecodeError_ShortRead: return 3;
528 case LDKDecodeError_BadLengthDescriptor: return 4;
529 case LDKDecodeError_Io: return 5;
530 case LDKDecodeError_UnsupportedCompression: return 6;
534 uint32_t __attribute__((export_name("TS_LDKDecodeError_Io_get_io"))) TS_LDKDecodeError_Io_get_io(uint64_t ptr) {
535 LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
536 assert(obj->tag == LDKDecodeError_Io);
537 uint32_t io_conv = LDKIOError_to_js(obj->io);
540 static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
541 LDKBlindedRoute ret = *owner->contents.result;
542 ret.is_owned = false;
545 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_get_ok(uint64_t owner) {
546 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
547 LDKBlindedRoute ret_var = CResult_BlindedRouteDecodeErrorZ_get_ok(owner_conv);
548 uint64_t ret_ref = 0;
549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
554 static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
555 CHECK(!owner->result_ok);
556 return DecodeError_clone(&*owner->contents.err);
558 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_err"))) TS_CResult_BlindedRouteDecodeErrorZ_get_err(uint64_t owner) {
559 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
560 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
561 *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
562 uint64_t ret_ref = tag_ptr(ret_copy, true);
566 static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
567 LDKBlindedHop ret = *owner->contents.result;
568 ret.is_owned = false;
571 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_ok"))) TS_CResult_BlindedHopDecodeErrorZ_get_ok(uint64_t owner) {
572 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
573 LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
574 uint64_t ret_ref = 0;
575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
580 static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
581 CHECK(!owner->result_ok);
582 return DecodeError_clone(&*owner->contents.err);
584 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_err"))) TS_CResult_BlindedHopDecodeErrorZ_get_err(uint64_t owner) {
585 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
586 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
587 *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
588 uint64_t ret_ref = tag_ptr(ret_copy, true);
592 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
593 CHECK(owner->result_ok);
594 return *owner->contents.result;
596 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_ok"))) TS_CResult_NoneNoneZ_get_ok(uint64_t owner) {
597 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
598 CResult_NoneNoneZ_get_ok(owner_conv);
601 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
602 CHECK(!owner->result_ok);
603 return *owner->contents.err;
605 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_err"))) TS_CResult_NoneNoneZ_get_err(uint64_t owner) {
606 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
607 CResult_NoneNoneZ_get_err(owner_conv);
610 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
611 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
612 ret.is_owned = false;
615 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(uint64_t owner) {
616 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
617 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
618 uint64_t ret_ref = 0;
619 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
620 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
624 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
625 CHECK(!owner->result_ok);
626 return DecodeError_clone(&*owner->contents.err);
628 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
629 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
630 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
631 *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
632 uint64_t ret_ref = tag_ptr(ret_copy, true);
636 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
637 CHECK(owner->result_ok);
638 return *owner->contents.result;
640 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
641 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
642 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
643 memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
647 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
648 CHECK(!owner->result_ok);
649 return *owner->contents.err;
651 uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
652 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
653 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
657 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
658 CHECK(owner->result_ok);
659 return *owner->contents.result;
661 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
662 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
663 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
664 memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
668 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
669 CHECK(!owner->result_ok);
670 return *owner->contents.err;
672 uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
673 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
674 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
678 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
679 LDKTxCreationKeys ret = *owner->contents.result;
680 ret.is_owned = false;
683 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint64_t owner) {
684 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
685 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
686 uint64_t ret_ref = 0;
687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
692 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
693 CHECK(!owner->result_ok);
694 return DecodeError_clone(&*owner->contents.err);
696 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
697 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
698 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
699 *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
700 uint64_t ret_ref = tag_ptr(ret_copy, true);
704 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
705 LDKChannelPublicKeys ret = *owner->contents.result;
706 ret.is_owned = false;
709 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint64_t owner) {
710 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
711 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
712 uint64_t ret_ref = 0;
713 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
714 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
718 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
719 CHECK(!owner->result_ok);
720 return DecodeError_clone(&*owner->contents.err);
722 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
723 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
724 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
725 *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
726 uint64_t ret_ref = tag_ptr(ret_copy, true);
730 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
731 LDKTxCreationKeys ret = *owner->contents.result;
732 ret.is_owned = false;
735 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
736 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
737 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
738 uint64_t ret_ref = 0;
739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
744 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
745 CHECK(!owner->result_ok);
746 return *owner->contents.err;
748 uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
749 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
750 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
754 uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
755 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
757 case LDKCOption_u32Z_Some: return 0;
758 case LDKCOption_u32Z_None: return 1;
762 int32_t __attribute__((export_name("TS_LDKCOption_u32Z_Some_get_some"))) TS_LDKCOption_u32Z_Some_get_some(uint64_t ptr) {
763 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
764 assert(obj->tag == LDKCOption_u32Z_Some);
765 int32_t some_conv = obj->some;
768 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
769 LDKHTLCOutputInCommitment ret = *owner->contents.result;
770 ret.is_owned = false;
773 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint64_t owner) {
774 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
775 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
776 uint64_t ret_ref = 0;
777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
782 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
783 CHECK(!owner->result_ok);
784 return DecodeError_clone(&*owner->contents.err);
786 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
787 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
788 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
789 *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
790 uint64_t ret_ref = tag_ptr(ret_copy, true);
794 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
795 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
796 ret.is_owned = false;
799 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
800 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
801 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
802 uint64_t ret_ref = 0;
803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
808 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
809 CHECK(!owner->result_ok);
810 return DecodeError_clone(&*owner->contents.err);
812 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
813 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
814 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
815 *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
816 uint64_t ret_ref = tag_ptr(ret_copy, true);
820 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
821 LDKChannelTransactionParameters ret = *owner->contents.result;
822 ret.is_owned = false;
825 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
826 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
827 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
828 uint64_t ret_ref = 0;
829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
834 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
835 CHECK(!owner->result_ok);
836 return DecodeError_clone(&*owner->contents.err);
838 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
839 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
840 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
841 *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
842 uint64_t ret_ref = tag_ptr(ret_copy, true);
846 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
847 LDKHolderCommitmentTransaction ret = *owner->contents.result;
848 ret.is_owned = false;
851 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
852 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
853 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
854 uint64_t ret_ref = 0;
855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
860 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
861 CHECK(!owner->result_ok);
862 return DecodeError_clone(&*owner->contents.err);
864 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
865 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
866 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
867 *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
868 uint64_t ret_ref = tag_ptr(ret_copy, true);
872 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
873 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
874 ret.is_owned = false;
877 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
878 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
879 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
880 uint64_t ret_ref = 0;
881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
886 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
887 CHECK(!owner->result_ok);
888 return DecodeError_clone(&*owner->contents.err);
890 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
891 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
892 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
893 *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
894 uint64_t ret_ref = tag_ptr(ret_copy, true);
898 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
899 LDKTrustedClosingTransaction ret = *owner->contents.result;
900 ret.is_owned = false;
903 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint64_t owner) {
904 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
905 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
906 uint64_t ret_ref = 0;
907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
912 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
913 CHECK(!owner->result_ok);
914 return *owner->contents.err;
916 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_err"))) TS_CResult_TrustedClosingTransactionNoneZ_get_err(uint64_t owner) {
917 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
918 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
921 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
922 LDKCommitmentTransaction ret = *owner->contents.result;
923 ret.is_owned = false;
926 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
927 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
928 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
929 uint64_t ret_ref = 0;
930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
935 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
936 CHECK(!owner->result_ok);
937 return DecodeError_clone(&*owner->contents.err);
939 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
940 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
941 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
942 *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
943 uint64_t ret_ref = tag_ptr(ret_copy, true);
947 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
948 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
949 ret.is_owned = false;
952 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint64_t owner) {
953 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
954 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
955 uint64_t ret_ref = 0;
956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
961 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
962 CHECK(!owner->result_ok);
963 return *owner->contents.err;
965 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_err(uint64_t owner) {
966 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
967 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
970 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
971 CHECK(owner->result_ok);
972 return *owner->contents.result;
974 ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) TS_CResult_CVec_SignatureZNoneZ_get_ok(uint64_t owner) {
975 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
976 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
977 ptrArray ret_arr = NULL;
978 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
979 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
980 for (size_t m = 0; m < ret_var.datalen; m++) {
981 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
982 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
983 ret_arr_ptr[m] = ret_conv_12_arr;
989 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
990 CHECK(!owner->result_ok);
991 return *owner->contents.err;
993 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_err"))) TS_CResult_CVec_SignatureZNoneZ_get_err(uint64_t owner) {
994 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
995 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
998 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
999 LDKShutdownScript ret = *owner->contents.result;
1000 ret.is_owned = false;
1003 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint64_t owner) {
1004 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1005 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1006 uint64_t ret_ref = 0;
1007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1012 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1013 CHECK(!owner->result_ok);
1014 return DecodeError_clone(&*owner->contents.err);
1016 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
1017 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1018 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1019 *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1020 uint64_t ret_ref = tag_ptr(ret_copy, true);
1024 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1025 LDKShutdownScript ret = *owner->contents.result;
1026 ret.is_owned = false;
1029 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint64_t owner) {
1030 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1031 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1032 uint64_t ret_ref = 0;
1033 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1034 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1038 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1039 LDKInvalidShutdownScript ret = *owner->contents.err;
1040 ret.is_owned = false;
1043 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint64_t owner) {
1044 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1045 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1046 uint64_t ret_ref = 0;
1047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1052 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1053 LDKRouteHop ret = *owner->contents.result;
1054 ret.is_owned = false;
1057 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
1058 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1059 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
1060 uint64_t ret_ref = 0;
1061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1062 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1066 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1067 CHECK(!owner->result_ok);
1068 return DecodeError_clone(&*owner->contents.err);
1070 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
1071 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1072 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1073 *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
1074 uint64_t ret_ref = tag_ptr(ret_copy, true);
1078 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
1079 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
1080 for (size_t i = 0; i < ret.datalen; i++) {
1081 ret.data[i] = RouteHop_clone(&orig->data[i]);
1085 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
1086 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
1087 for (size_t i = 0; i < ret.datalen; i++) {
1088 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
1092 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1093 LDKRoute ret = *owner->contents.result;
1094 ret.is_owned = false;
1097 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint64_t owner) {
1098 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1099 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
1100 uint64_t ret_ref = 0;
1101 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1102 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1106 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1107 CHECK(!owner->result_ok);
1108 return DecodeError_clone(&*owner->contents.err);
1110 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
1111 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1112 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1113 *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
1114 uint64_t ret_ref = tag_ptr(ret_copy, true);
1118 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1119 LDKRouteParameters ret = *owner->contents.result;
1120 ret.is_owned = false;
1123 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint64_t owner) {
1124 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1125 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1126 uint64_t ret_ref = 0;
1127 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1128 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1132 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1133 CHECK(!owner->result_ok);
1134 return DecodeError_clone(&*owner->contents.err);
1136 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
1137 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1138 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1139 *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1140 uint64_t ret_ref = tag_ptr(ret_copy, true);
1144 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1145 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1146 for (size_t i = 0; i < ret.datalen; i++) {
1147 ret.data[i] = RouteHint_clone(&orig->data[i]);
1151 uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
1152 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1154 case LDKCOption_u64Z_Some: return 0;
1155 case LDKCOption_u64Z_None: return 1;
1159 int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
1160 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1161 assert(obj->tag == LDKCOption_u64Z_Some);
1162 int64_t some_conv = obj->some;
1165 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1166 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1167 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1170 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1171 LDKPaymentParameters ret = *owner->contents.result;
1172 ret.is_owned = false;
1175 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_get_ok(uint64_t owner) {
1176 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1177 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1178 uint64_t ret_ref = 0;
1179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1184 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1185 CHECK(!owner->result_ok);
1186 return DecodeError_clone(&*owner->contents.err);
1188 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
1189 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1190 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1191 *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1192 uint64_t ret_ref = tag_ptr(ret_copy, true);
1196 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1197 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1198 for (size_t i = 0; i < ret.datalen; i++) {
1199 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1203 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1204 LDKRouteHint ret = *owner->contents.result;
1205 ret.is_owned = false;
1208 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint64_t owner) {
1209 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1210 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1211 uint64_t ret_ref = 0;
1212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1217 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1218 CHECK(!owner->result_ok);
1219 return DecodeError_clone(&*owner->contents.err);
1221 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
1222 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1223 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1224 *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
1225 uint64_t ret_ref = tag_ptr(ret_copy, true);
1229 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1230 LDKRouteHintHop ret = *owner->contents.result;
1231 ret.is_owned = false;
1234 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint64_t owner) {
1235 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1236 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1237 uint64_t ret_ref = 0;
1238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1243 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1244 CHECK(!owner->result_ok);
1245 return DecodeError_clone(&*owner->contents.err);
1247 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
1248 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1249 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1250 *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1251 uint64_t ret_ref = tag_ptr(ret_copy, true);
1255 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1256 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1257 for (size_t i = 0; i < ret.datalen; i++) {
1258 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1262 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1263 LDKRoute ret = *owner->contents.result;
1264 ret.is_owned = false;
1267 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
1268 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1269 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1270 uint64_t ret_ref = 0;
1271 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1272 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1276 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1277 LDKLightningError ret = *owner->contents.err;
1278 ret.is_owned = false;
1281 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
1282 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1283 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1284 uint64_t ret_ref = 0;
1285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1290 uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) {
1291 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1293 case LDKPaymentPurpose_InvoicePayment: return 0;
1294 case LDKPaymentPurpose_SpontaneousPayment: return 1;
1298 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) {
1299 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1300 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1301 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1302 memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32);
1303 return payment_preimage_arr;
1305 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) {
1306 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1307 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1308 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
1309 memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32);
1310 return payment_secret_arr;
1312 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) {
1313 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1314 assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment);
1315 int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__);
1316 memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32);
1317 return spontaneous_payment_arr;
1319 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1320 CHECK(owner->result_ok);
1321 return PaymentPurpose_clone(&*owner->contents.result);
1323 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) {
1324 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1325 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1326 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1327 uint64_t ret_ref = tag_ptr(ret_copy, true);
1331 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1332 CHECK(!owner->result_ok);
1333 return DecodeError_clone(&*owner->contents.err);
1335 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
1336 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1337 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1338 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1339 uint64_t ret_ref = tag_ptr(ret_copy, true);
1343 uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) {
1344 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1346 case LDKClosureReason_CounterpartyForceClosed: return 0;
1347 case LDKClosureReason_HolderForceClosed: return 1;
1348 case LDKClosureReason_CooperativeClosure: return 2;
1349 case LDKClosureReason_CommitmentTxConfirmed: return 3;
1350 case LDKClosureReason_FundingTimedOut: return 4;
1351 case LDKClosureReason_ProcessingError: return 5;
1352 case LDKClosureReason_DisconnectedPeer: return 6;
1353 case LDKClosureReason_OutdatedChannelManager: return 7;
1357 jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) {
1358 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1359 assert(obj->tag == LDKClosureReason_CounterpartyForceClosed);
1360 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1361 jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len);
1362 return peer_msg_conv;
1364 jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) {
1365 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1366 assert(obj->tag == LDKClosureReason_ProcessingError);
1367 LDKStr err_str = obj->processing_error.err;
1368 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
1371 uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) {
1372 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1374 case LDKCOption_ClosureReasonZ_Some: return 0;
1375 case LDKCOption_ClosureReasonZ_None: return 1;
1379 uint64_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint64_t ptr) {
1380 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1381 assert(obj->tag == LDKCOption_ClosureReasonZ_Some);
1382 uint64_t some_ref = tag_ptr(&obj->some, false);
1385 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1386 CHECK(owner->result_ok);
1387 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1389 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint64_t owner) {
1390 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1391 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1392 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1393 uint64_t ret_ref = tag_ptr(ret_copy, true);
1397 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1398 CHECK(!owner->result_ok);
1399 return DecodeError_clone(&*owner->contents.err);
1401 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
1402 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1403 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1404 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1405 uint64_t ret_ref = tag_ptr(ret_copy, true);
1409 uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LDKHTLCDestination_ty_from_ptr(uint64_t ptr) {
1410 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1412 case LDKHTLCDestination_NextHopChannel: return 0;
1413 case LDKHTLCDestination_UnknownNextHop: return 1;
1414 case LDKHTLCDestination_FailedPayment: return 2;
1418 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_node_id"))) TS_LDKHTLCDestination_NextHopChannel_get_node_id(uint64_t ptr) {
1419 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1420 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1421 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1422 memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33);
1425 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) {
1426 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1427 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1428 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1429 memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32);
1430 return channel_id_arr;
1432 int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) {
1433 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1434 assert(obj->tag == LDKHTLCDestination_UnknownNextHop);
1435 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
1436 return requested_forward_scid_conv;
1438 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
1439 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1440 assert(obj->tag == LDKHTLCDestination_FailedPayment);
1441 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1442 memcpy(payment_hash_arr->elems, obj->failed_payment.payment_hash.data, 32);
1443 return payment_hash_arr;
1445 uint32_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_ty_from_ptr"))) TS_LDKCOption_HTLCDestinationZ_ty_from_ptr(uint64_t ptr) {
1446 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1448 case LDKCOption_HTLCDestinationZ_Some: return 0;
1449 case LDKCOption_HTLCDestinationZ_None: return 1;
1453 uint64_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_Some_get_some"))) TS_LDKCOption_HTLCDestinationZ_Some_get_some(uint64_t ptr) {
1454 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1455 assert(obj->tag == LDKCOption_HTLCDestinationZ_Some);
1456 uint64_t some_ref = tag_ptr(&obj->some, false);
1459 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1460 CHECK(owner->result_ok);
1461 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
1463 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(uint64_t owner) {
1464 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1465 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
1466 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
1467 uint64_t ret_ref = tag_ptr(ret_copy, true);
1471 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1472 CHECK(!owner->result_ok);
1473 return DecodeError_clone(&*owner->contents.err);
1475 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
1476 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1477 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1478 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
1479 uint64_t ret_ref = tag_ptr(ret_copy, true);
1483 uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
1484 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1486 case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
1487 case LDKNetworkUpdate_ChannelFailure: return 1;
1488 case LDKNetworkUpdate_NodeFailure: return 2;
1492 uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
1493 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1494 assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
1495 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
1496 uint64_t msg_ref = 0;
1497 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1498 msg_ref = tag_ptr(msg_var.inner, false);
1501 int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
1502 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1503 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1504 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
1505 return short_channel_id_conv;
1507 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
1508 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1509 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1510 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
1511 return is_permanent_conv;
1513 int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
1514 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1515 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1516 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1517 memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
1520 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
1521 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1522 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1523 jboolean is_permanent_conv = obj->node_failure.is_permanent;
1524 return is_permanent_conv;
1526 uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
1527 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1529 case LDKCOption_NetworkUpdateZ_Some: return 0;
1530 case LDKCOption_NetworkUpdateZ_None: return 1;
1534 uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
1535 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1536 assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
1537 uint64_t some_ref = tag_ptr(&obj->some, false);
1540 uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
1541 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1543 case LDKSpendableOutputDescriptor_StaticOutput: return 0;
1544 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: return 1;
1545 case LDKSpendableOutputDescriptor_StaticPaymentOutput: return 2;
1549 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(uint64_t ptr) {
1550 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1551 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1552 LDKOutPoint outpoint_var = obj->static_output.outpoint;
1553 uint64_t outpoint_ref = 0;
1554 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
1555 outpoint_ref = tag_ptr(outpoint_var.inner, false);
1556 return outpoint_ref;
1558 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint64_t ptr) {
1559 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1560 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1561 LDKTxOut* output_ref = &obj->static_output.output;
1562 return tag_ptr(output_ref, false);
1564 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint64_t ptr) {
1565 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1566 assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput);
1567 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
1568 uint64_t delayed_payment_output_ref = 0;
1569 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
1570 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
1571 return delayed_payment_output_ref;
1573 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint64_t ptr) {
1574 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1575 assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput);
1576 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
1577 uint64_t static_payment_output_ref = 0;
1578 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
1579 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
1580 return static_payment_output_ref;
1582 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
1583 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
1584 for (size_t i = 0; i < ret.datalen; i++) {
1585 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
1589 uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_from_ptr(uint64_t ptr) {
1590 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1592 case LDKEvent_FundingGenerationReady: return 0;
1593 case LDKEvent_PaymentReceived: return 1;
1594 case LDKEvent_PaymentClaimed: return 2;
1595 case LDKEvent_PaymentSent: return 3;
1596 case LDKEvent_PaymentFailed: return 4;
1597 case LDKEvent_PaymentPathSuccessful: return 5;
1598 case LDKEvent_PaymentPathFailed: return 6;
1599 case LDKEvent_ProbeSuccessful: return 7;
1600 case LDKEvent_ProbeFailed: return 8;
1601 case LDKEvent_PendingHTLCsForwardable: return 9;
1602 case LDKEvent_SpendableOutputs: return 10;
1603 case LDKEvent_PaymentForwarded: return 11;
1604 case LDKEvent_ChannelClosed: return 12;
1605 case LDKEvent_DiscardFunding: return 13;
1606 case LDKEvent_OpenChannelRequest: return 14;
1607 case LDKEvent_HTLCHandlingFailed: return 15;
1611 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) {
1612 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1613 assert(obj->tag == LDKEvent_FundingGenerationReady);
1614 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1615 memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32);
1616 return temporary_channel_id_arr;
1618 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) {
1619 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1620 assert(obj->tag == LDKEvent_FundingGenerationReady);
1621 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1622 memcpy(counterparty_node_id_arr->elems, obj->funding_generation_ready.counterparty_node_id.compressed_form, 33);
1623 return counterparty_node_id_arr;
1625 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis"))) TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(uint64_t ptr) {
1626 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1627 assert(obj->tag == LDKEvent_FundingGenerationReady);
1628 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
1629 return channel_value_satoshis_conv;
1631 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_output_script"))) TS_LDKEvent_FundingGenerationReady_get_output_script(uint64_t ptr) {
1632 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1633 assert(obj->tag == LDKEvent_FundingGenerationReady);
1634 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
1635 int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__);
1636 memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
1637 return output_script_arr;
1639 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
1640 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1641 assert(obj->tag == LDKEvent_FundingGenerationReady);
1642 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
1643 return user_channel_id_conv;
1645 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
1646 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1647 assert(obj->tag == LDKEvent_PaymentReceived);
1648 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1649 memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
1650 return payment_hash_arr;
1652 int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
1653 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1654 assert(obj->tag == LDKEvent_PaymentReceived);
1655 int64_t amount_msat_conv = obj->payment_received.amount_msat;
1656 return amount_msat_conv;
1658 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
1659 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1660 assert(obj->tag == LDKEvent_PaymentReceived);
1661 uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
1664 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
1665 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1666 assert(obj->tag == LDKEvent_PaymentClaimed);
1667 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1668 memcpy(payment_hash_arr->elems, obj->payment_claimed.payment_hash.data, 32);
1669 return payment_hash_arr;
1671 int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_amount_msat"))) TS_LDKEvent_PaymentClaimed_get_amount_msat(uint64_t ptr) {
1672 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1673 assert(obj->tag == LDKEvent_PaymentClaimed);
1674 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
1675 return amount_msat_conv;
1677 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_purpose"))) TS_LDKEvent_PaymentClaimed_get_purpose(uint64_t ptr) {
1678 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1679 assert(obj->tag == LDKEvent_PaymentClaimed);
1680 uint64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
1683 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint64_t ptr) {
1684 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1685 assert(obj->tag == LDKEvent_PaymentSent);
1686 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1687 memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32);
1688 return payment_id_arr;
1690 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint64_t ptr) {
1691 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1692 assert(obj->tag == LDKEvent_PaymentSent);
1693 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1694 memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32);
1695 return payment_preimage_arr;
1697 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint64_t ptr) {
1698 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1699 assert(obj->tag == LDKEvent_PaymentSent);
1700 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1701 memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32);
1702 return payment_hash_arr;
1704 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint64_t ptr) {
1705 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1706 assert(obj->tag == LDKEvent_PaymentSent);
1707 uint64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
1708 return fee_paid_msat_ref;
1710 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint64_t ptr) {
1711 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1712 assert(obj->tag == LDKEvent_PaymentFailed);
1713 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1714 memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32);
1715 return payment_id_arr;
1717 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint64_t ptr) {
1718 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1719 assert(obj->tag == LDKEvent_PaymentFailed);
1720 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1721 memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32);
1722 return payment_hash_arr;
1724 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) {
1725 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1726 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1727 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1728 memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32);
1729 return payment_id_arr;
1731 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint64_t ptr) {
1732 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1733 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1734 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1735 memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32);
1736 return payment_hash_arr;
1738 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) {
1739 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1740 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1741 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
1742 uint64_tArray path_arr = NULL;
1743 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1744 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1745 for (size_t k = 0; k < path_var.datalen; k++) {
1746 LDKRouteHop path_conv_10_var = path_var.data[k];
1747 uint64_t path_conv_10_ref = 0;
1748 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1749 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1750 path_arr_ptr[k] = path_conv_10_ref;
1755 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) {
1756 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1757 assert(obj->tag == LDKEvent_PaymentPathFailed);
1758 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1759 memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32);
1760 return payment_id_arr;
1762 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint64_t ptr) {
1763 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1764 assert(obj->tag == LDKEvent_PaymentPathFailed);
1765 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1766 memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
1767 return payment_hash_arr;
1769 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently"))) TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently(uint64_t ptr) {
1770 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1771 assert(obj->tag == LDKEvent_PaymentPathFailed);
1772 jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
1773 return payment_failed_permanently_conv;
1775 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
1776 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1777 assert(obj->tag == LDKEvent_PaymentPathFailed);
1778 uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
1779 return network_update_ref;
1781 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
1782 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1783 assert(obj->tag == LDKEvent_PaymentPathFailed);
1784 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
1785 return all_paths_failed_conv;
1787 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
1788 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1789 assert(obj->tag == LDKEvent_PaymentPathFailed);
1790 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
1791 uint64_tArray path_arr = NULL;
1792 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1793 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1794 for (size_t k = 0; k < path_var.datalen; k++) {
1795 LDKRouteHop path_conv_10_var = path_var.data[k];
1796 uint64_t path_conv_10_ref = 0;
1797 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1798 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1799 path_arr_ptr[k] = path_conv_10_ref;
1804 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) {
1805 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1806 assert(obj->tag == LDKEvent_PaymentPathFailed);
1807 uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
1808 return short_channel_id_ref;
1810 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) {
1811 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1812 assert(obj->tag == LDKEvent_PaymentPathFailed);
1813 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
1814 uint64_t retry_ref = 0;
1815 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
1816 retry_ref = tag_ptr(retry_var.inner, false);
1819 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) {
1820 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1821 assert(obj->tag == LDKEvent_ProbeSuccessful);
1822 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1823 memcpy(payment_id_arr->elems, obj->probe_successful.payment_id.data, 32);
1824 return payment_id_arr;
1826 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_hash"))) TS_LDKEvent_ProbeSuccessful_get_payment_hash(uint64_t ptr) {
1827 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1828 assert(obj->tag == LDKEvent_ProbeSuccessful);
1829 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1830 memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32);
1831 return payment_hash_arr;
1833 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) {
1834 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1835 assert(obj->tag == LDKEvent_ProbeSuccessful);
1836 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
1837 uint64_tArray path_arr = NULL;
1838 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1839 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1840 for (size_t k = 0; k < path_var.datalen; k++) {
1841 LDKRouteHop path_conv_10_var = path_var.data[k];
1842 uint64_t path_conv_10_ref = 0;
1843 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1844 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1845 path_arr_ptr[k] = path_conv_10_ref;
1850 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) {
1851 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1852 assert(obj->tag == LDKEvent_ProbeFailed);
1853 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1854 memcpy(payment_id_arr->elems, obj->probe_failed.payment_id.data, 32);
1855 return payment_id_arr;
1857 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash"))) TS_LDKEvent_ProbeFailed_get_payment_hash(uint64_t ptr) {
1858 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1859 assert(obj->tag == LDKEvent_ProbeFailed);
1860 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1861 memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32);
1862 return payment_hash_arr;
1864 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) {
1865 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1866 assert(obj->tag == LDKEvent_ProbeFailed);
1867 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
1868 uint64_tArray path_arr = NULL;
1869 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1870 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1871 for (size_t k = 0; k < path_var.datalen; k++) {
1872 LDKRouteHop path_conv_10_var = path_var.data[k];
1873 uint64_t path_conv_10_ref = 0;
1874 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1875 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1876 path_arr_ptr[k] = path_conv_10_ref;
1881 uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) {
1882 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1883 assert(obj->tag == LDKEvent_ProbeFailed);
1884 uint64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
1885 return short_channel_id_ref;
1887 int64_t __attribute__((export_name("TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable"))) TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(uint64_t ptr) {
1888 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1889 assert(obj->tag == LDKEvent_PendingHTLCsForwardable);
1890 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
1891 return time_forwardable_conv;
1893 uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
1894 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1895 assert(obj->tag == LDKEvent_SpendableOutputs);
1896 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
1897 uint64_tArray outputs_arr = NULL;
1898 outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__);
1899 uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8);
1900 for (size_t b = 0; b < outputs_var.datalen; b++) {
1901 uint64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
1902 outputs_arr_ptr[b] = outputs_conv_27_ref;
1907 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) {
1908 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1909 assert(obj->tag == LDKEvent_PaymentForwarded);
1910 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1911 memcpy(prev_channel_id_arr->elems, obj->payment_forwarded.prev_channel_id.data, 32);
1912 return prev_channel_id_arr;
1914 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) {
1915 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1916 assert(obj->tag == LDKEvent_PaymentForwarded);
1917 int8_tArray next_channel_id_arr = init_int8_tArray(32, __LINE__);
1918 memcpy(next_channel_id_arr->elems, obj->payment_forwarded.next_channel_id.data, 32);
1919 return next_channel_id_arr;
1921 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) {
1922 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1923 assert(obj->tag == LDKEvent_PaymentForwarded);
1924 uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
1925 return fee_earned_msat_ref;
1927 jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) {
1928 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1929 assert(obj->tag == LDKEvent_PaymentForwarded);
1930 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
1931 return claim_from_onchain_tx_conv;
1933 int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
1934 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1935 assert(obj->tag == LDKEvent_ChannelClosed);
1936 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1937 memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
1938 return channel_id_arr;
1940 int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
1941 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1942 assert(obj->tag == LDKEvent_ChannelClosed);
1943 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
1944 return user_channel_id_conv;
1946 uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
1947 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1948 assert(obj->tag == LDKEvent_ChannelClosed);
1949 uint64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
1952 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) {
1953 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1954 assert(obj->tag == LDKEvent_DiscardFunding);
1955 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1956 memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32);
1957 return channel_id_arr;
1959 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) {
1960 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1961 assert(obj->tag == LDKEvent_DiscardFunding);
1962 LDKTransaction transaction_var = obj->discard_funding.transaction;
1963 int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__);
1964 memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen);
1965 return transaction_arr;
1967 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) {
1968 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1969 assert(obj->tag == LDKEvent_OpenChannelRequest);
1970 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1971 memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32);
1972 return temporary_channel_id_arr;
1974 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) {
1975 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1976 assert(obj->tag == LDKEvent_OpenChannelRequest);
1977 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1978 memcpy(counterparty_node_id_arr->elems, obj->open_channel_request.counterparty_node_id.compressed_form, 33);
1979 return counterparty_node_id_arr;
1981 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_funding_satoshis"))) TS_LDKEvent_OpenChannelRequest_get_funding_satoshis(uint64_t ptr) {
1982 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1983 assert(obj->tag == LDKEvent_OpenChannelRequest);
1984 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
1985 return funding_satoshis_conv;
1987 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_push_msat"))) TS_LDKEvent_OpenChannelRequest_get_push_msat(uint64_t ptr) {
1988 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1989 assert(obj->tag == LDKEvent_OpenChannelRequest);
1990 int64_t push_msat_conv = obj->open_channel_request.push_msat;
1991 return push_msat_conv;
1993 uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_type"))) TS_LDKEvent_OpenChannelRequest_get_channel_type(uint64_t ptr) {
1994 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1995 assert(obj->tag == LDKEvent_OpenChannelRequest);
1996 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
1997 uint64_t channel_type_ref = 0;
1998 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
1999 channel_type_ref = tag_ptr(channel_type_var.inner, false);
2000 return channel_type_ref;
2002 int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) {
2003 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2004 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
2005 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
2006 memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32);
2007 return prev_channel_id_arr;
2009 uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) {
2010 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2011 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
2012 uint64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
2013 return failed_next_destination_ref;
2015 uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDKCOption_EventZ_ty_from_ptr(uint64_t ptr) {
2016 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
2018 case LDKCOption_EventZ_Some: return 0;
2019 case LDKCOption_EventZ_None: return 1;
2023 uint64_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint64_t ptr) {
2024 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
2025 assert(obj->tag == LDKCOption_EventZ_Some);
2026 uint64_t some_ref = tag_ptr(&obj->some, false);
2029 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2030 CHECK(owner->result_ok);
2031 return COption_EventZ_clone(&*owner->contents.result);
2033 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ok"))) TS_CResult_COption_EventZDecodeErrorZ_get_ok(uint64_t owner) {
2034 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2035 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
2036 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
2037 uint64_t ret_ref = tag_ptr(ret_copy, true);
2041 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2042 CHECK(!owner->result_ok);
2043 return DecodeError_clone(&*owner->contents.err);
2045 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
2046 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2047 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2048 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
2049 uint64_t ret_ref = tag_ptr(ret_copy, true);
2053 uint32_t __attribute__((export_name("TS_LDKErrorAction_ty_from_ptr"))) TS_LDKErrorAction_ty_from_ptr(uint64_t ptr) {
2054 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2056 case LDKErrorAction_DisconnectPeer: return 0;
2057 case LDKErrorAction_IgnoreError: return 1;
2058 case LDKErrorAction_IgnoreAndLog: return 2;
2059 case LDKErrorAction_IgnoreDuplicateGossip: return 3;
2060 case LDKErrorAction_SendErrorMessage: return 4;
2061 case LDKErrorAction_SendWarningMessage: return 5;
2065 uint64_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg"))) TS_LDKErrorAction_DisconnectPeer_get_msg(uint64_t ptr) {
2066 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2067 assert(obj->tag == LDKErrorAction_DisconnectPeer);
2068 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
2069 uint64_t msg_ref = 0;
2070 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2071 msg_ref = tag_ptr(msg_var.inner, false);
2074 uint32_t __attribute__((export_name("TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log"))) TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(uint64_t ptr) {
2075 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2076 assert(obj->tag == LDKErrorAction_IgnoreAndLog);
2077 uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
2078 return ignore_and_log_conv;
2080 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg"))) TS_LDKErrorAction_SendErrorMessage_get_msg(uint64_t ptr) {
2081 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2082 assert(obj->tag == LDKErrorAction_SendErrorMessage);
2083 LDKErrorMessage msg_var = obj->send_error_message.msg;
2084 uint64_t msg_ref = 0;
2085 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2086 msg_ref = tag_ptr(msg_var.inner, false);
2089 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_msg"))) TS_LDKErrorAction_SendWarningMessage_get_msg(uint64_t ptr) {
2090 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2091 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2092 LDKWarningMessage msg_var = obj->send_warning_message.msg;
2093 uint64_t msg_ref = 0;
2094 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2095 msg_ref = tag_ptr(msg_var.inner, false);
2098 uint32_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_log_level"))) TS_LDKErrorAction_SendWarningMessage_get_log_level(uint64_t ptr) {
2099 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2100 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2101 uint32_t log_level_conv = LDKLevel_to_js(obj->send_warning_message.log_level);
2102 return log_level_conv;
2104 uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint64_t ptr) {
2105 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2107 case LDKMessageSendEvent_SendAcceptChannel: return 0;
2108 case LDKMessageSendEvent_SendOpenChannel: return 1;
2109 case LDKMessageSendEvent_SendFundingCreated: return 2;
2110 case LDKMessageSendEvent_SendFundingSigned: return 3;
2111 case LDKMessageSendEvent_SendChannelReady: return 4;
2112 case LDKMessageSendEvent_SendAnnouncementSignatures: return 5;
2113 case LDKMessageSendEvent_UpdateHTLCs: return 6;
2114 case LDKMessageSendEvent_SendRevokeAndACK: return 7;
2115 case LDKMessageSendEvent_SendClosingSigned: return 8;
2116 case LDKMessageSendEvent_SendShutdown: return 9;
2117 case LDKMessageSendEvent_SendChannelReestablish: return 10;
2118 case LDKMessageSendEvent_SendChannelAnnouncement: return 11;
2119 case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 12;
2120 case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
2121 case LDKMessageSendEvent_SendChannelUpdate: return 14;
2122 case LDKMessageSendEvent_HandleError: return 15;
2123 case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
2124 case LDKMessageSendEvent_SendShortIdsQuery: return 17;
2125 case LDKMessageSendEvent_SendReplyChannelRange: return 18;
2126 case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
2130 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint64_t ptr) {
2131 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2132 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2133 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2134 memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33);
2137 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_msg"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(uint64_t ptr) {
2138 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2139 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2140 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2141 uint64_t msg_ref = 0;
2142 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2143 msg_ref = tag_ptr(msg_var.inner, false);
2146 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint64_t ptr) {
2147 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2148 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2149 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2150 memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33);
2153 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_msg"))) TS_LDKMessageSendEvent_SendOpenChannel_get_msg(uint64_t ptr) {
2154 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2155 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2156 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2157 uint64_t msg_ref = 0;
2158 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2159 msg_ref = tag_ptr(msg_var.inner, false);
2162 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint64_t ptr) {
2163 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2164 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2165 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2166 memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33);
2169 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_msg"))) TS_LDKMessageSendEvent_SendFundingCreated_get_msg(uint64_t ptr) {
2170 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2171 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2172 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2173 uint64_t msg_ref = 0;
2174 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2175 msg_ref = tag_ptr(msg_var.inner, false);
2178 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint64_t ptr) {
2179 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2180 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2181 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2182 memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33);
2185 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_msg"))) TS_LDKMessageSendEvent_SendFundingSigned_get_msg(uint64_t ptr) {
2186 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2187 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2188 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2189 uint64_t msg_ref = 0;
2190 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2191 msg_ref = tag_ptr(msg_var.inner, false);
2194 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReady_get_node_id(uint64_t ptr) {
2195 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2196 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2197 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2198 memcpy(node_id_arr->elems, obj->send_channel_ready.node_id.compressed_form, 33);
2201 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_msg"))) TS_LDKMessageSendEvent_SendChannelReady_get_msg(uint64_t ptr) {
2202 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2203 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2204 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2205 uint64_t msg_ref = 0;
2206 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2207 msg_ref = tag_ptr(msg_var.inner, false);
2210 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint64_t ptr) {
2211 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2212 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2213 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2214 memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33);
2217 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(uint64_t ptr) {
2218 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2219 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2220 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2221 uint64_t msg_ref = 0;
2222 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2223 msg_ref = tag_ptr(msg_var.inner, false);
2226 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint64_t ptr) {
2227 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2228 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2229 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2230 memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33);
2233 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_updates"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(uint64_t ptr) {
2234 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2235 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2236 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2237 uint64_t updates_ref = 0;
2238 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2239 updates_ref = tag_ptr(updates_var.inner, false);
2242 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint64_t ptr) {
2243 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2244 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2245 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2246 memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33);
2249 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(uint64_t ptr) {
2250 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2251 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2252 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2253 uint64_t msg_ref = 0;
2254 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2255 msg_ref = tag_ptr(msg_var.inner, false);
2258 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint64_t ptr) {
2259 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2260 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2261 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2262 memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33);
2265 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_msg"))) TS_LDKMessageSendEvent_SendClosingSigned_get_msg(uint64_t ptr) {
2266 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2267 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2268 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2269 uint64_t msg_ref = 0;
2270 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2271 msg_ref = tag_ptr(msg_var.inner, false);
2274 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint64_t ptr) {
2275 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2276 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2277 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2278 memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33);
2281 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg"))) TS_LDKMessageSendEvent_SendShutdown_get_msg(uint64_t ptr) {
2282 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2283 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2284 LDKShutdown msg_var = obj->send_shutdown.msg;
2285 uint64_t msg_ref = 0;
2286 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2287 msg_ref = tag_ptr(msg_var.inner, false);
2290 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint64_t ptr) {
2291 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2292 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2293 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2294 memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33);
2297 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_msg"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(uint64_t ptr) {
2298 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2299 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2300 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2301 uint64_t msg_ref = 0;
2302 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2303 msg_ref = tag_ptr(msg_var.inner, false);
2306 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(uint64_t ptr) {
2307 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2308 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2309 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2310 memcpy(node_id_arr->elems, obj->send_channel_announcement.node_id.compressed_form, 33);
2313 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg(uint64_t ptr) {
2314 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2315 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2316 LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
2317 uint64_t msg_ref = 0;
2318 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2319 msg_ref = tag_ptr(msg_var.inner, false);
2322 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(uint64_t ptr) {
2323 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2324 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2325 LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
2326 uint64_t update_msg_ref = 0;
2327 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2328 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2329 return update_msg_ref;
2331 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
2332 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2333 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2334 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2335 uint64_t msg_ref = 0;
2336 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2337 msg_ref = tag_ptr(msg_var.inner, false);
2340 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint64_t ptr) {
2341 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2342 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2343 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2344 uint64_t update_msg_ref = 0;
2345 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2346 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2347 return update_msg_ref;
2349 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
2350 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2351 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
2352 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2353 uint64_t msg_ref = 0;
2354 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2355 msg_ref = tag_ptr(msg_var.inner, false);
2358 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint64_t ptr) {
2359 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2360 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2361 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2362 memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33);
2365 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(uint64_t ptr) {
2366 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2367 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2368 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
2369 uint64_t msg_ref = 0;
2370 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2371 msg_ref = tag_ptr(msg_var.inner, false);
2374 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint64_t ptr) {
2375 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2376 assert(obj->tag == LDKMessageSendEvent_HandleError);
2377 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2378 memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33);
2381 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint64_t ptr) {
2382 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2383 assert(obj->tag == LDKMessageSendEvent_HandleError);
2384 uint64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2387 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint64_t ptr) {
2388 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2389 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2390 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2391 memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33);
2394 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(uint64_t ptr) {
2395 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2396 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2397 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2398 uint64_t msg_ref = 0;
2399 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2400 msg_ref = tag_ptr(msg_var.inner, false);
2403 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint64_t ptr) {
2404 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2405 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2406 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2407 memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33);
2410 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(uint64_t ptr) {
2411 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2412 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2413 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2414 uint64_t msg_ref = 0;
2415 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2416 msg_ref = tag_ptr(msg_var.inner, false);
2419 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint64_t ptr) {
2420 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2421 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2422 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2423 memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33);
2426 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg(uint64_t ptr) {
2427 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2428 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2429 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2430 uint64_t msg_ref = 0;
2431 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2432 msg_ref = tag_ptr(msg_var.inner, false);
2435 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(uint64_t ptr) {
2436 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2437 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2438 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2439 memcpy(node_id_arr->elems, obj->send_gossip_timestamp_filter.node_id.compressed_form, 33);
2442 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(uint64_t ptr) {
2443 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2444 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2445 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2446 uint64_t msg_ref = 0;
2447 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2448 msg_ref = tag_ptr(msg_var.inner, false);
2451 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2452 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2453 for (size_t i = 0; i < ret.datalen; i++) {
2454 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2458 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2459 CHECK(owner->result_ok);
2460 return TxOut_clone(&*owner->contents.result);
2462 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
2463 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2464 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
2465 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
2466 return tag_ptr(ret_ref, true);
2469 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2470 CHECK(!owner->result_ok);
2471 return AccessError_clone(&*owner->contents.err);
2473 uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
2474 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2475 uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
2479 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2482 uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) {
2483 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2484 uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2488 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2491 int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) {
2492 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2493 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2494 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
2495 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
2499 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2500 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2501 for (size_t i = 0; i < ret.datalen; i++) {
2502 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2506 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
2507 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
2508 for (size_t i = 0; i < ret.datalen; i++) {
2509 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
2513 uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
2514 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2516 case LDKMonitorEvent_HTLCEvent: return 0;
2517 case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
2518 case LDKMonitorEvent_Completed: return 2;
2519 case LDKMonitorEvent_UpdateFailed: return 3;
2523 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) {
2524 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2525 assert(obj->tag == LDKMonitorEvent_HTLCEvent);
2526 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2527 uint64_t htlc_event_ref = 0;
2528 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2529 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2530 return htlc_event_ref;
2532 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) {
2533 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2534 assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed);
2535 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2536 uint64_t commitment_tx_confirmed_ref = 0;
2537 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2538 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2539 return commitment_tx_confirmed_ref;
2541 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_funding_txo"))) TS_LDKMonitorEvent_Completed_get_funding_txo(uint64_t ptr) {
2542 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2543 assert(obj->tag == LDKMonitorEvent_Completed);
2544 LDKOutPoint funding_txo_var = obj->completed.funding_txo;
2545 uint64_t funding_txo_ref = 0;
2546 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2547 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2548 return funding_txo_ref;
2550 int64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_monitor_update_id"))) TS_LDKMonitorEvent_Completed_get_monitor_update_id(uint64_t ptr) {
2551 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2552 assert(obj->tag == LDKMonitorEvent_Completed);
2553 int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
2554 return monitor_update_id_conv;
2556 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
2557 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2558 assert(obj->tag == LDKMonitorEvent_UpdateFailed);
2559 LDKOutPoint update_failed_var = obj->update_failed;
2560 uint64_t update_failed_ref = 0;
2561 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2562 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2563 return update_failed_ref;
2565 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2566 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2567 for (size_t i = 0; i < ret.datalen; i++) {
2568 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2572 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2573 LDKOutPoint ret = owner->a;
2574 ret.is_owned = false;
2577 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) {
2578 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2579 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2580 uint64_t ret_ref = 0;
2581 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2582 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2586 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2587 return CVec_MonitorEventZ_clone(&owner->b);
2589 uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) {
2590 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2591 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2592 uint64_tArray ret_arr = NULL;
2593 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
2594 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
2595 for (size_t o = 0; o < ret_var.datalen; o++) {
2596 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2597 *ret_conv_14_copy = ret_var.data[o];
2598 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2599 ret_arr_ptr[o] = ret_conv_14_ref;
2606 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2609 int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) {
2610 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2611 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
2612 memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33);
2616 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
2617 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
2618 for (size_t i = 0; i < ret.datalen; i++) {
2619 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
2623 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2624 LDKFixedPenaltyScorer ret = *owner->contents.result;
2625 ret.is_owned = false;
2628 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) {
2629 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2630 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
2631 uint64_t ret_ref = 0;
2632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2637 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2638 CHECK(!owner->result_ok);
2639 return DecodeError_clone(&*owner->contents.err);
2641 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
2642 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2643 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2644 *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
2645 uint64_t ret_ref = tag_ptr(ret_copy, true);
2649 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2652 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) {
2653 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2654 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
2658 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2661 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) {
2662 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2663 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
2667 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) {
2668 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2670 case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0;
2671 case LDKCOption_C2Tuple_u64u64ZZ_None: return 1;
2675 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) {
2676 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2677 assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some);
2678 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2679 *some_conv = obj->some;
2680 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
2681 return tag_ptr(some_conv, true);
2683 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
2684 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
2685 for (size_t i = 0; i < ret.datalen; i++) {
2686 ret.data[i] = NodeId_clone(&orig->data[i]);
2690 typedef struct LDKLogger_JCalls {
2691 atomic_size_t refcnt;
2692 uint32_t instance_ptr;
2694 static void LDKLogger_JCalls_free(void* this_arg) {
2695 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2696 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2700 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
2701 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2702 LDKRecord record_var = *record;
2703 uint64_t record_ref = 0;
2704 record_var = Record_clone(&record_var);
2705 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
2706 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
2707 js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0);
2709 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
2710 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
2711 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2713 static inline LDKLogger LDKLogger_init (JSValue o) {
2714 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
2715 atomic_init(&calls->refcnt, 1);
2716 calls->instance_ptr = o;
2719 .this_arg = (void*) calls,
2720 .log = log_LDKLogger_jcall,
2721 .free = LDKLogger_JCalls_free,
2725 uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) {
2726 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
2727 *res_ptr = LDKLogger_init(o);
2728 return tag_ptr(res_ptr, true);
2730 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2731 LDKProbabilisticScorer ret = *owner->contents.result;
2732 ret.is_owned = false;
2735 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) {
2736 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2737 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
2738 uint64_t ret_ref = 0;
2739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2744 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2745 CHECK(!owner->result_ok);
2746 return DecodeError_clone(&*owner->contents.err);
2748 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
2749 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2750 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2751 *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
2752 uint64_t ret_ref = tag_ptr(ret_copy, true);
2756 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2757 LDKInitFeatures ret = *owner->contents.result;
2758 ret.is_owned = false;
2761 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2762 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2763 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
2764 uint64_t ret_ref = 0;
2765 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2766 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2770 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2771 CHECK(!owner->result_ok);
2772 return DecodeError_clone(&*owner->contents.err);
2774 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2775 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2776 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2777 *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
2778 uint64_t ret_ref = tag_ptr(ret_copy, true);
2782 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2783 LDKChannelFeatures ret = *owner->contents.result;
2784 ret.is_owned = false;
2787 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2788 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2789 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
2790 uint64_t ret_ref = 0;
2791 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2792 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2796 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2797 CHECK(!owner->result_ok);
2798 return DecodeError_clone(&*owner->contents.err);
2800 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2801 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2802 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2803 *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
2804 uint64_t ret_ref = tag_ptr(ret_copy, true);
2808 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2809 LDKNodeFeatures ret = *owner->contents.result;
2810 ret.is_owned = false;
2813 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2814 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2815 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
2816 uint64_t ret_ref = 0;
2817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2822 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2823 CHECK(!owner->result_ok);
2824 return DecodeError_clone(&*owner->contents.err);
2826 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2827 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2828 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2829 *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
2830 uint64_t ret_ref = tag_ptr(ret_copy, true);
2834 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2835 LDKInvoiceFeatures ret = *owner->contents.result;
2836 ret.is_owned = false;
2839 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2840 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2841 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
2842 uint64_t ret_ref = 0;
2843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2848 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2849 CHECK(!owner->result_ok);
2850 return DecodeError_clone(&*owner->contents.err);
2852 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2853 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2854 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2855 *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
2856 uint64_t ret_ref = tag_ptr(ret_copy, true);
2860 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2861 LDKChannelTypeFeatures ret = *owner->contents.result;
2862 ret.is_owned = false;
2865 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2866 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2867 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
2868 uint64_t ret_ref = 0;
2869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2874 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2875 CHECK(!owner->result_ok);
2876 return DecodeError_clone(&*owner->contents.err);
2878 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2879 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2880 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2881 *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
2882 uint64_t ret_ref = tag_ptr(ret_copy, true);
2886 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2887 LDKNodeId ret = *owner->contents.result;
2888 ret.is_owned = false;
2891 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) {
2892 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2893 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
2894 uint64_t ret_ref = 0;
2895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2900 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2901 CHECK(!owner->result_ok);
2902 return DecodeError_clone(&*owner->contents.err);
2904 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
2905 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2906 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2907 *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
2908 uint64_t ret_ref = tag_ptr(ret_copy, true);
2912 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2913 CHECK(owner->result_ok);
2914 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
2916 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) {
2917 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2918 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
2919 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
2920 uint64_t ret_ref = tag_ptr(ret_copy, true);
2924 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2925 CHECK(!owner->result_ok);
2926 return DecodeError_clone(&*owner->contents.err);
2928 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
2929 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2930 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2931 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
2932 uint64_t ret_ref = tag_ptr(ret_copy, true);
2936 typedef struct LDKAccess_JCalls {
2937 atomic_size_t refcnt;
2938 uint32_t instance_ptr;
2940 static void LDKAccess_JCalls_free(void* this_arg) {
2941 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2942 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2946 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
2947 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2948 int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
2949 memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
2950 int64_t short_channel_id_conv = short_channel_id;
2951 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, short_channel_id_conv, 0, 0, 0, 0);
2952 void* ret_ptr = untag_ptr(ret);
2953 CHECK_ACCESS(ret_ptr);
2954 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
2955 FREE(untag_ptr(ret));
2958 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
2959 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
2960 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2962 static inline LDKAccess LDKAccess_init (JSValue o) {
2963 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
2964 atomic_init(&calls->refcnt, 1);
2965 calls->instance_ptr = o;
2968 .this_arg = (void*) calls,
2969 .get_utxo = get_utxo_LDKAccess_jcall,
2970 .free = LDKAccess_JCalls_free,
2974 uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
2975 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
2976 *res_ptr = LDKAccess_init(o);
2977 return tag_ptr(res_ptr, true);
2979 uint64_t __attribute__((export_name("TS_Access_get_utxo"))) TS_Access_get_utxo(uint64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
2980 void* this_arg_ptr = untag_ptr(this_arg);
2981 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2982 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
2983 unsigned char genesis_hash_arr[32];
2984 CHECK(genesis_hash->arr_len == 32);
2985 memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
2986 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
2987 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2988 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
2989 return tag_ptr(ret_conv, true);
2992 uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
2993 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2995 case LDKCOption_AccessZ_Some: return 0;
2996 case LDKCOption_AccessZ_None: return 1;
3000 uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
3001 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
3002 assert(obj->tag == LDKCOption_AccessZ_Some);
3003 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
3004 *some_ret = obj->some;
3005 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
3006 if ((*some_ret).free == LDKAccess_JCalls_free) {
3007 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3008 LDKAccess_JCalls_cloned(&(*some_ret));
3010 return tag_ptr(some_ret, true);
3012 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3013 CHECK(owner->result_ok);
3014 return *owner->contents.result;
3016 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) {
3017 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3018 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
3022 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3023 LDKLightningError ret = *owner->contents.err;
3024 ret.is_owned = false;
3027 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) {
3028 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3029 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
3030 uint64_t ret_ref = 0;
3031 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3032 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3036 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3037 LDKChannelAnnouncement ret = owner->a;
3038 ret.is_owned = false;
3041 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) {
3042 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3043 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
3044 uint64_t ret_ref = 0;
3045 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3046 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3050 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3051 LDKChannelUpdate ret = owner->b;
3052 ret.is_owned = false;
3055 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) {
3056 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3057 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
3058 uint64_t ret_ref = 0;
3059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3064 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3065 LDKChannelUpdate ret = owner->c;
3066 ret.is_owned = false;
3069 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) {
3070 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3071 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
3072 uint64_t ret_ref = 0;
3073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3078 uint32_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr(uint64_t ptr) {
3079 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
3081 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: return 0;
3082 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: return 1;
3086 uint64_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some(uint64_t ptr) {
3087 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
3088 assert(obj->tag == LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some);
3089 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
3090 *some_conv = obj->some;
3091 *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
3092 return tag_ptr(some_conv, true);
3094 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3095 CHECK(owner->result_ok);
3096 return *owner->contents.result;
3098 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_ok"))) TS_CResult_NoneLightningErrorZ_get_ok(uint64_t owner) {
3099 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3100 CResult_NoneLightningErrorZ_get_ok(owner_conv);
3103 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3104 LDKLightningError ret = *owner->contents.err;
3105 ret.is_owned = false;
3108 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint64_t owner) {
3109 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3110 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3111 uint64_t ret_ref = 0;
3112 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3113 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3117 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3118 LDKChannelUpdateInfo ret = *owner->contents.result;
3119 ret.is_owned = false;
3122 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(uint64_t owner) {
3123 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3124 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3125 uint64_t ret_ref = 0;
3126 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3127 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3131 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3132 CHECK(!owner->result_ok);
3133 return DecodeError_clone(&*owner->contents.err);
3135 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
3136 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3137 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3138 *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3139 uint64_t ret_ref = tag_ptr(ret_copy, true);
3143 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3144 LDKChannelInfo ret = *owner->contents.result;
3145 ret.is_owned = false;
3148 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint64_t owner) {
3149 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3150 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3151 uint64_t ret_ref = 0;
3152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3153 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3157 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3158 CHECK(!owner->result_ok);
3159 return DecodeError_clone(&*owner->contents.err);
3161 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
3162 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3163 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3164 *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3165 uint64_t ret_ref = tag_ptr(ret_copy, true);
3169 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3170 LDKRoutingFees ret = *owner->contents.result;
3171 ret.is_owned = false;
3174 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint64_t owner) {
3175 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3176 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3177 uint64_t ret_ref = 0;
3178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3183 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3184 CHECK(!owner->result_ok);
3185 return DecodeError_clone(&*owner->contents.err);
3187 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
3188 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3189 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3190 *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3191 uint64_t ret_ref = tag_ptr(ret_copy, true);
3195 uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetAddress_ty_from_ptr(uint64_t ptr) {
3196 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3198 case LDKNetAddress_IPv4: return 0;
3199 case LDKNetAddress_IPv6: return 1;
3200 case LDKNetAddress_OnionV2: return 2;
3201 case LDKNetAddress_OnionV3: return 3;
3202 case LDKNetAddress_Hostname: return 4;
3206 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint64_t ptr) {
3207 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3208 assert(obj->tag == LDKNetAddress_IPv4);
3209 int8_tArray addr_arr = init_int8_tArray(4, __LINE__);
3210 memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4);
3213 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNetAddress_IPv4_get_port(uint64_t ptr) {
3214 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3215 assert(obj->tag == LDKNetAddress_IPv4);
3216 int16_t port_conv = obj->i_pv4.port;
3219 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint64_t ptr) {
3220 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3221 assert(obj->tag == LDKNetAddress_IPv6);
3222 int8_tArray addr_arr = init_int8_tArray(16, __LINE__);
3223 memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16);
3226 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNetAddress_IPv6_get_port(uint64_t ptr) {
3227 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3228 assert(obj->tag == LDKNetAddress_IPv6);
3229 int16_t port_conv = obj->i_pv6.port;
3232 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint64_t ptr) {
3233 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3234 assert(obj->tag == LDKNetAddress_OnionV2);
3235 int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__);
3236 memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12);
3237 return onion_v2_arr;
3239 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint64_t ptr) {
3240 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3241 assert(obj->tag == LDKNetAddress_OnionV3);
3242 int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__);
3243 memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32);
3244 return ed25519_pubkey_arr;
3246 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_checksum"))) TS_LDKNetAddress_OnionV3_get_checksum(uint64_t ptr) {
3247 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3248 assert(obj->tag == LDKNetAddress_OnionV3);
3249 int16_t checksum_conv = obj->onion_v3.checksum;
3250 return checksum_conv;
3252 int8_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_version"))) TS_LDKNetAddress_OnionV3_get_version(uint64_t ptr) {
3253 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3254 assert(obj->tag == LDKNetAddress_OnionV3);
3255 int8_t version_conv = obj->onion_v3.version;
3256 return version_conv;
3258 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_port"))) TS_LDKNetAddress_OnionV3_get_port(uint64_t ptr) {
3259 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3260 assert(obj->tag == LDKNetAddress_OnionV3);
3261 int16_t port_conv = obj->onion_v3.port;
3264 uint64_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_hostname"))) TS_LDKNetAddress_Hostname_get_hostname(uint64_t ptr) {
3265 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3266 assert(obj->tag == LDKNetAddress_Hostname);
3267 LDKHostname hostname_var = obj->hostname.hostname;
3268 uint64_t hostname_ref = 0;
3269 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3270 hostname_ref = tag_ptr(hostname_var.inner, false);
3271 return hostname_ref;
3273 int16_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_port"))) TS_LDKNetAddress_Hostname_get_port(uint64_t ptr) {
3274 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3275 assert(obj->tag == LDKNetAddress_Hostname);
3276 int16_t port_conv = obj->hostname.port;
3279 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3280 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3281 for (size_t i = 0; i < ret.datalen; i++) {
3282 ret.data[i] = NetAddress_clone(&orig->data[i]);
3286 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3287 LDKNodeAnnouncementInfo ret = *owner->contents.result;
3288 ret.is_owned = false;
3291 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint64_t owner) {
3292 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3293 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3294 uint64_t ret_ref = 0;
3295 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3296 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3300 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3301 CHECK(!owner->result_ok);
3302 return DecodeError_clone(&*owner->contents.err);
3304 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
3305 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3306 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3307 *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3308 uint64_t ret_ref = tag_ptr(ret_copy, true);
3312 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3313 LDKNodeAlias ret = *owner->contents.result;
3314 ret.is_owned = false;
3317 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok"))) TS_CResult_NodeAliasDecodeErrorZ_get_ok(uint64_t owner) {
3318 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3319 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3320 uint64_t ret_ref = 0;
3321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3326 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3327 CHECK(!owner->result_ok);
3328 return DecodeError_clone(&*owner->contents.err);
3330 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
3331 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3332 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3333 *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
3334 uint64_t ret_ref = tag_ptr(ret_copy, true);
3338 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3339 LDKNodeInfo ret = *owner->contents.result;
3340 ret.is_owned = false;
3343 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint64_t owner) {
3344 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3345 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
3346 uint64_t ret_ref = 0;
3347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3352 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3353 CHECK(!owner->result_ok);
3354 return DecodeError_clone(&*owner->contents.err);
3356 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
3357 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3358 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3359 *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
3360 uint64_t ret_ref = tag_ptr(ret_copy, true);
3364 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3365 LDKNetworkGraph ret = *owner->contents.result;
3366 ret.is_owned = false;
3369 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint64_t owner) {
3370 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3371 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
3372 uint64_t ret_ref = 0;
3373 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3374 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3378 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3379 CHECK(!owner->result_ok);
3380 return DecodeError_clone(&*owner->contents.err);
3382 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
3383 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3384 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3385 *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
3386 uint64_t ret_ref = tag_ptr(ret_copy, true);
3390 uint32_t __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr"))) TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(uint64_t ptr) {
3391 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3393 case LDKCOption_CVec_NetAddressZZ_Some: return 0;
3394 case LDKCOption_CVec_NetAddressZZ_None: return 1;
3398 uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_get_some"))) TS_LDKCOption_CVec_NetAddressZZ_Some_get_some(uint64_t ptr) {
3399 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3400 assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some);
3401 LDKCVec_NetAddressZ some_var = obj->some;
3402 uint64_tArray some_arr = NULL;
3403 some_arr = init_uint64_tArray(some_var.datalen, __LINE__);
3404 uint64_t *some_arr_ptr = (uint64_t*)(((uint8_t*)some_arr) + 8);
3405 for (size_t m = 0; m < some_var.datalen; m++) {
3406 uint64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
3407 some_arr_ptr[m] = some_conv_12_ref;
3412 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3413 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
3414 ret.is_owned = false;
3417 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3418 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3419 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3420 uint64_t ret_ref = 0;
3421 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3422 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3426 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3427 CHECK(!owner->result_ok);
3428 return DecodeError_clone(&*owner->contents.err);
3430 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3431 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3432 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3433 *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3434 uint64_t ret_ref = tag_ptr(ret_copy, true);
3438 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3439 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
3440 ret.is_owned = false;
3443 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3444 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3445 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3446 uint64_t ret_ref = 0;
3447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3448 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3452 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3453 CHECK(!owner->result_ok);
3454 return DecodeError_clone(&*owner->contents.err);
3456 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3457 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3458 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3459 *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3460 uint64_t ret_ref = tag_ptr(ret_copy, true);
3464 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3465 CHECK(owner->result_ok);
3466 return SpendableOutputDescriptor_clone(&*owner->contents.result);
3468 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3469 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3470 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
3471 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3472 uint64_t ret_ref = tag_ptr(ret_copy, true);
3476 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3477 CHECK(!owner->result_ok);
3478 return DecodeError_clone(&*owner->contents.err);
3480 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3481 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3482 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3483 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3484 uint64_t ret_ref = tag_ptr(ret_copy, true);
3488 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
3489 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
3490 for (size_t i = 0; i < ret.datalen; i++) {
3491 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3495 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3498 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint64_t owner) {
3499 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3500 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3501 memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64);
3505 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3508 ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint64_t owner) {
3509 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3510 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
3511 ptrArray ret_arr = NULL;
3512 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
3513 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
3514 for (size_t m = 0; m < ret_var.datalen; m++) {
3515 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
3516 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
3517 ret_arr_ptr[m] = ret_conv_12_arr;
3523 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3524 CHECK(owner->result_ok);
3525 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
3527 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint64_t owner) {
3528 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3529 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3530 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
3531 return tag_ptr(ret_conv, true);
3534 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3535 CHECK(!owner->result_ok);
3536 return *owner->contents.err;
3538 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(uint64_t owner) {
3539 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3540 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
3543 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3544 CHECK(owner->result_ok);
3545 return *owner->contents.result;
3547 int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint64_t owner) {
3548 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3549 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3550 memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64);
3554 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3555 CHECK(!owner->result_ok);
3556 return *owner->contents.err;
3558 void __attribute__((export_name("TS_CResult_SignatureNoneZ_get_err"))) TS_CResult_SignatureNoneZ_get_err(uint64_t owner) {
3559 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3560 CResult_SignatureNoneZ_get_err(owner_conv);
3563 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3566 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
3567 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3568 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3569 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
3573 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3576 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
3577 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3578 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3579 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
3583 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3584 CHECK(owner->result_ok);
3585 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
3587 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
3588 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3589 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
3590 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
3591 return tag_ptr(ret_conv, true);
3594 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3595 CHECK(!owner->result_ok);
3596 return *owner->contents.err;
3598 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
3599 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3600 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
3603 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3604 CHECK(owner->result_ok);
3605 return *owner->contents.result;
3607 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
3608 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3609 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3610 memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
3614 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3615 CHECK(!owner->result_ok);
3616 return *owner->contents.err;
3618 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
3619 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3620 CResult_SecretKeyNoneZ_get_err(owner_conv);
3623 static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
3624 CHECK(owner->result_ok);
3625 return *owner->contents.result;
3627 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_ok"))) TS_CResult_PublicKeyNoneZ_get_ok(uint64_t owner) {
3628 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
3629 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3630 memcpy(ret_arr->elems, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form, 33);
3634 static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
3635 CHECK(!owner->result_ok);
3636 return *owner->contents.err;
3638 void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_err"))) TS_CResult_PublicKeyNoneZ_get_err(uint64_t owner) {
3639 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
3640 CResult_PublicKeyNoneZ_get_err(owner_conv);
3643 uint32_t __attribute__((export_name("TS_LDKCOption_ScalarZ_ty_from_ptr"))) TS_LDKCOption_ScalarZ_ty_from_ptr(uint64_t ptr) {
3644 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
3646 case LDKCOption_ScalarZ_Some: return 0;
3647 case LDKCOption_ScalarZ_None: return 1;
3651 uint64_t __attribute__((export_name("TS_LDKCOption_ScalarZ_Some_get_some"))) TS_LDKCOption_ScalarZ_Some_get_some(uint64_t ptr) {
3652 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
3653 assert(obj->tag == LDKCOption_ScalarZ_Some);
3654 LDKBigEndianScalar* some_ref = &obj->some;
3655 return tag_ptr(some_ref, false);
3657 static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
3658 CHECK(owner->result_ok);
3659 return ThirtyTwoBytes_clone(&*owner->contents.result);
3661 int8_tArray __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_ok"))) TS_CResult_SharedSecretNoneZ_get_ok(uint64_t owner) {
3662 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
3663 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3664 memcpy(ret_arr->elems, CResult_SharedSecretNoneZ_get_ok(owner_conv).data, 32);
3668 static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
3669 CHECK(!owner->result_ok);
3670 return *owner->contents.err;
3672 void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_err"))) TS_CResult_SharedSecretNoneZ_get_err(uint64_t owner) {
3673 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
3674 CResult_SharedSecretNoneZ_get_err(owner_conv);
3677 typedef struct LDKBaseSign_JCalls {
3678 atomic_size_t refcnt;
3679 uint32_t instance_ptr;
3680 } LDKBaseSign_JCalls;
3681 static void LDKBaseSign_JCalls_free(void* this_arg) {
3682 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3683 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3687 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3688 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3689 int64_t idx_conv = idx;
3690 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
3691 LDKPublicKey ret_ref;
3692 CHECK(ret->arr_len == 33);
3693 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
3696 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3697 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3698 int64_t idx_conv = idx;
3699 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
3700 LDKThirtyTwoBytes ret_ref;
3701 CHECK(ret->arr_len == 32);
3702 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3705 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
3706 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3707 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
3708 uint64_t holder_tx_ref = 0;
3709 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
3710 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
3711 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
3712 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3713 ptrArray preimages_arr = NULL;
3714 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3715 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3716 for (size_t m = 0; m < preimages_var.datalen; m++) {
3717 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3718 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3719 preimages_arr_ptr[m] = preimages_conv_12_arr;
3722 FREE(preimages_var.data);
3723 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3724 void* ret_ptr = untag_ptr(ret);
3725 CHECK_ACCESS(ret_ptr);
3726 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3727 FREE(untag_ptr(ret));
3730 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
3731 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3732 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
3733 LDKThirtyTwoBytes ret_ref;
3734 CHECK(ret->arr_len == 32);
3735 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3738 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
3739 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3740 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
3741 uint64_t commitment_tx_ref = 0;
3742 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
3743 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3744 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3745 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3746 ptrArray preimages_arr = NULL;
3747 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3748 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3749 for (size_t m = 0; m < preimages_var.datalen; m++) {
3750 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3751 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3752 preimages_arr_ptr[m] = preimages_conv_12_arr;
3755 FREE(preimages_var.data);
3756 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3757 void* ret_ptr = untag_ptr(ret);
3758 CHECK_ACCESS(ret_ptr);
3759 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3760 FREE(untag_ptr(ret));
3763 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
3764 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3765 int64_t idx_conv = idx;
3766 int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
3767 memcpy(secret_arr->elems, *secret, 32);
3768 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
3769 void* ret_ptr = untag_ptr(ret);
3770 CHECK_ACCESS(ret_ptr);
3771 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3772 FREE(untag_ptr(ret));
3775 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
3776 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3777 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
3778 uint64_t commitment_tx_ref = 0;
3779 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
3780 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3781 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3782 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
3783 void* ret_ptr = untag_ptr(ret);
3784 CHECK_ACCESS(ret_ptr);
3785 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3786 FREE(untag_ptr(ret));
3789 LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) {
3790 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3791 LDKTransaction justice_tx_var = justice_tx;
3792 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3793 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3794 Transaction_free(justice_tx_var);
3795 uint32_t input_conv = input;
3796 int64_t amount_conv = amount;
3797 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3798 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3799 uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, 0, 0);
3800 void* ret_ptr = untag_ptr(ret);
3801 CHECK_ACCESS(ret_ptr);
3802 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3803 FREE(untag_ptr(ret));
3806 LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
3807 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3808 LDKTransaction justice_tx_var = justice_tx;
3809 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3810 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3811 Transaction_free(justice_tx_var);
3812 uint32_t input_conv = input;
3813 int64_t amount_conv = amount;
3814 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3815 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3816 LDKHTLCOutputInCommitment htlc_var = *htlc;
3817 uint64_t htlc_ref = 0;
3818 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3819 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3820 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3821 uint64_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, htlc_ref, 0);
3822 void* ret_ptr = untag_ptr(ret);
3823 CHECK_ACCESS(ret_ptr);
3824 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3825 FREE(untag_ptr(ret));
3828 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
3829 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3830 LDKTransaction htlc_tx_var = htlc_tx;
3831 int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
3832 memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
3833 Transaction_free(htlc_tx_var);
3834 uint32_t input_conv = input;
3835 int64_t amount_conv = amount;
3836 int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__);
3837 memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33);
3838 LDKHTLCOutputInCommitment htlc_var = *htlc;
3839 uint64_t htlc_ref = 0;
3840 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3841 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3842 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3843 uint64_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_point_arr, htlc_ref, 0);
3844 void* ret_ptr = untag_ptr(ret);
3845 CHECK_ACCESS(ret_ptr);
3846 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3847 FREE(untag_ptr(ret));
3850 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
3851 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3852 LDKClosingTransaction closing_tx_var = *closing_tx;
3853 uint64_t closing_tx_ref = 0;
3854 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
3855 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
3856 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
3857 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
3858 void* ret_ptr = untag_ptr(ret);
3859 CHECK_ACCESS(ret_ptr);
3860 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3861 FREE(untag_ptr(ret));
3864 LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKBaseSign_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
3865 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3866 LDKTransaction anchor_tx_var = anchor_tx;
3867 int8_tArray anchor_tx_arr = init_int8_tArray(anchor_tx_var.datalen, __LINE__);
3868 memcpy(anchor_tx_arr->elems, anchor_tx_var.data, anchor_tx_var.datalen);
3869 Transaction_free(anchor_tx_var);
3870 uint32_t input_conv = input;
3871 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 13, (uint32_t)anchor_tx_arr, input_conv, 0, 0, 0, 0);
3872 void* ret_ptr = untag_ptr(ret);
3873 CHECK_ACCESS(ret_ptr);
3874 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3875 FREE(untag_ptr(ret));
3878 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
3879 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3880 LDKUnsignedChannelAnnouncement msg_var = *msg;
3881 uint64_t msg_ref = 0;
3882 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
3883 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3884 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
3885 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 14, msg_ref, 0, 0, 0, 0, 0);
3886 void* ret_ptr = untag_ptr(ret);
3887 CHECK_ACCESS(ret_ptr);
3888 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
3889 FREE(untag_ptr(ret));
3892 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
3893 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3894 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
3895 uint64_t channel_parameters_ref = 0;
3896 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
3897 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
3898 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
3899 js_invoke_function_buuuuu(j_calls->instance_ptr, 15, channel_parameters_ref, 0, 0, 0, 0, 0);
3901 static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
3902 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
3903 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3905 static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
3906 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
3907 atomic_init(&calls->refcnt, 1);
3908 calls->instance_ptr = o;
3910 LDKChannelPublicKeys pubkeys_conv;
3911 pubkeys_conv.inner = untag_ptr(pubkeys);
3912 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
3913 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
3916 .this_arg = (void*) calls,
3917 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
3918 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
3919 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
3920 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
3921 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
3922 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
3923 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
3924 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
3925 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
3926 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
3927 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
3928 .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall,
3929 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
3930 .ready_channel = ready_channel_LDKBaseSign_jcall,
3931 .free = LDKBaseSign_JCalls_free,
3932 .pubkeys = pubkeys_conv,
3933 .set_pubkeys = NULL,
3937 uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
3938 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
3939 *res_ptr = LDKBaseSign_init(o, pubkeys);
3940 return tag_ptr(res_ptr, true);
3942 int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
3943 void* this_arg_ptr = untag_ptr(this_arg);
3944 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3945 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3946 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3947 memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
3951 int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
3952 void* this_arg_ptr = untag_ptr(this_arg);
3953 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3954 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3955 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3956 memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
3960 uint64_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) TS_BaseSign_validate_holder_commitment(uint64_t this_arg, uint64_t holder_tx, ptrArray preimages) {
3961 void* this_arg_ptr = untag_ptr(this_arg);
3962 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3963 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3964 LDKHolderCommitmentTransaction holder_tx_conv;
3965 holder_tx_conv.inner = untag_ptr(holder_tx);
3966 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
3967 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
3968 holder_tx_conv.is_owned = false;
3969 LDKCVec_PaymentPreimageZ preimages_constr;
3970 preimages_constr.datalen = preimages->arr_len;
3971 if (preimages_constr.datalen > 0)
3972 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3974 preimages_constr.data = NULL;
3975 int8_tArray* preimages_vals = (void*) preimages->elems;
3976 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3977 int8_tArray preimages_conv_12 = preimages_vals[m];
3978 LDKThirtyTwoBytes preimages_conv_12_ref;
3979 CHECK(preimages_conv_12->arr_len == 32);
3980 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3981 preimages_constr.data[m] = preimages_conv_12_ref;
3984 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3985 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
3986 return tag_ptr(ret_conv, true);
3989 int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
3990 void* this_arg_ptr = untag_ptr(this_arg);
3991 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3992 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3993 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3994 memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
3998 uint64_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment"))) TS_BaseSign_sign_counterparty_commitment(uint64_t this_arg, uint64_t commitment_tx, ptrArray preimages) {
3999 void* this_arg_ptr = untag_ptr(this_arg);
4000 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4001 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4002 LDKCommitmentTransaction commitment_tx_conv;
4003 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4004 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4005 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4006 commitment_tx_conv.is_owned = false;
4007 LDKCVec_PaymentPreimageZ preimages_constr;
4008 preimages_constr.datalen = preimages->arr_len;
4009 if (preimages_constr.datalen > 0)
4010 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
4012 preimages_constr.data = NULL;
4013 int8_tArray* preimages_vals = (void*) preimages->elems;
4014 for (size_t m = 0; m < preimages_constr.datalen; m++) {
4015 int8_tArray preimages_conv_12 = preimages_vals[m];
4016 LDKThirtyTwoBytes preimages_conv_12_ref;
4017 CHECK(preimages_conv_12->arr_len == 32);
4018 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
4019 preimages_constr.data[m] = preimages_conv_12_ref;
4022 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4023 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
4024 return tag_ptr(ret_conv, true);
4027 uint64_t __attribute__((export_name("TS_BaseSign_validate_counterparty_revocation"))) TS_BaseSign_validate_counterparty_revocation(uint64_t this_arg, int64_t idx, int8_tArray secret) {
4028 void* this_arg_ptr = untag_ptr(this_arg);
4029 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4030 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4031 unsigned char secret_arr[32];
4032 CHECK(secret->arr_len == 32);
4033 memcpy(secret_arr, secret->elems, 32); FREE(secret);
4034 unsigned char (*secret_ref)[32] = &secret_arr;
4035 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
4036 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
4037 return tag_ptr(ret_conv, true);
4040 uint64_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htlcs"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint64_t this_arg, uint64_t commitment_tx) {
4041 void* this_arg_ptr = untag_ptr(this_arg);
4042 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4043 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4044 LDKHolderCommitmentTransaction commitment_tx_conv;
4045 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4046 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4047 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4048 commitment_tx_conv.is_owned = false;
4049 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4050 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
4051 return tag_ptr(ret_conv, true);
4054 uint64_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key) {
4055 void* this_arg_ptr = untag_ptr(this_arg);
4056 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4057 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4058 LDKTransaction justice_tx_ref;
4059 justice_tx_ref.datalen = justice_tx->arr_len;
4060 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4061 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
4062 justice_tx_ref.data_is_owned = true;
4063 unsigned char per_commitment_key_arr[32];
4064 CHECK(per_commitment_key->arr_len == 32);
4065 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
4066 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4067 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4068 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
4069 return tag_ptr(ret_conv, true);
4072 uint64_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key, uint64_t htlc) {
4073 void* this_arg_ptr = untag_ptr(this_arg);
4074 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4075 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4076 LDKTransaction justice_tx_ref;
4077 justice_tx_ref.datalen = justice_tx->arr_len;
4078 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4079 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
4080 justice_tx_ref.data_is_owned = true;
4081 unsigned char per_commitment_key_arr[32];
4082 CHECK(per_commitment_key->arr_len == 32);
4083 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
4084 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4085 LDKHTLCOutputInCommitment htlc_conv;
4086 htlc_conv.inner = untag_ptr(htlc);
4087 htlc_conv.is_owned = ptr_is_owned(htlc);
4088 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4089 htlc_conv.is_owned = false;
4090 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4091 *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);
4092 return tag_ptr(ret_conv, true);
4095 uint64_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint64_t this_arg, int8_tArray htlc_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_point, uint64_t htlc) {
4096 void* this_arg_ptr = untag_ptr(this_arg);
4097 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4098 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4099 LDKTransaction htlc_tx_ref;
4100 htlc_tx_ref.datalen = htlc_tx->arr_len;
4101 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
4102 memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx);
4103 htlc_tx_ref.data_is_owned = true;
4104 LDKPublicKey per_commitment_point_ref;
4105 CHECK(per_commitment_point->arr_len == 33);
4106 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
4107 LDKHTLCOutputInCommitment htlc_conv;
4108 htlc_conv.inner = untag_ptr(htlc);
4109 htlc_conv.is_owned = ptr_is_owned(htlc);
4110 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4111 htlc_conv.is_owned = false;
4112 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4113 *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);
4114 return tag_ptr(ret_conv, true);
4117 uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
4118 void* this_arg_ptr = untag_ptr(this_arg);
4119 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4120 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4121 LDKClosingTransaction closing_tx_conv;
4122 closing_tx_conv.inner = untag_ptr(closing_tx);
4123 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
4124 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
4125 closing_tx_conv.is_owned = false;
4126 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4127 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
4128 return tag_ptr(ret_conv, true);
4131 uint64_t __attribute__((export_name("TS_BaseSign_sign_holder_anchor_input"))) TS_BaseSign_sign_holder_anchor_input(uint64_t this_arg, int8_tArray anchor_tx, uint32_t input) {
4132 void* this_arg_ptr = untag_ptr(this_arg);
4133 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4134 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4135 LDKTransaction anchor_tx_ref;
4136 anchor_tx_ref.datalen = anchor_tx->arr_len;
4137 anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
4138 memcpy(anchor_tx_ref.data, anchor_tx->elems, anchor_tx_ref.datalen); FREE(anchor_tx);
4139 anchor_tx_ref.data_is_owned = true;
4140 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4141 *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
4142 return tag_ptr(ret_conv, true);
4145 uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
4146 void* this_arg_ptr = untag_ptr(this_arg);
4147 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4148 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4149 LDKUnsignedChannelAnnouncement msg_conv;
4150 msg_conv.inner = untag_ptr(msg);
4151 msg_conv.is_owned = ptr_is_owned(msg);
4152 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
4153 msg_conv.is_owned = false;
4154 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
4155 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
4156 return tag_ptr(ret_conv, true);
4159 void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
4160 void* this_arg_ptr = untag_ptr(this_arg);
4161 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4162 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4163 LDKChannelTransactionParameters channel_parameters_conv;
4164 channel_parameters_conv.inner = untag_ptr(channel_parameters);
4165 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
4166 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
4167 channel_parameters_conv.is_owned = false;
4168 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
4171 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
4172 if (this_arg->set_pubkeys != NULL)
4173 this_arg->set_pubkeys(this_arg);
4174 return this_arg->pubkeys;
4176 uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
4177 void* this_arg_ptr = untag_ptr(this_arg);
4178 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4179 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4180 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
4181 uint64_t ret_ref = 0;
4182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4187 typedef struct LDKSign_JCalls {
4188 atomic_size_t refcnt;
4189 uint32_t instance_ptr;
4190 LDKBaseSign_JCalls* BaseSign;
4192 static void LDKSign_JCalls_free(void* this_arg) {
4193 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4194 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4198 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
4199 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4200 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 16, 0, 0, 0, 0, 0, 0);
4201 LDKCVec_u8Z ret_ref;
4202 ret_ref.datalen = ret->arr_len;
4203 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4204 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4207 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
4208 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
4209 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4210 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
4212 static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4213 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
4214 atomic_init(&calls->refcnt, 1);
4215 calls->instance_ptr = o;
4217 LDKChannelPublicKeys pubkeys_conv;
4218 pubkeys_conv.inner = untag_ptr(pubkeys);
4219 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4220 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4223 .this_arg = (void*) calls,
4224 .write = write_LDKSign_jcall,
4225 .cloned = LDKSign_JCalls_cloned,
4226 .free = LDKSign_JCalls_free,
4227 .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
4229 calls->BaseSign = ret.BaseSign.this_arg;
4232 uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4233 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
4234 *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
4235 return tag_ptr(res_ptr, true);
4237 int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
4238 void* this_arg_ptr = untag_ptr(this_arg);
4239 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4240 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
4241 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
4242 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4243 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4244 CVec_u8Z_free(ret_var);
4248 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4249 CHECK(owner->result_ok);
4250 return Sign_clone(&*owner->contents.result);
4252 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
4253 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4254 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
4255 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
4256 return tag_ptr(ret_ret, true);
4259 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4260 CHECK(!owner->result_ok);
4261 return DecodeError_clone(&*owner->contents.err);
4263 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
4264 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4265 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4266 *ret_copy = CResult_SignDecodeErrorZ_get_err(owner_conv);
4267 uint64_t ret_ref = tag_ptr(ret_copy, true);
4271 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4272 CHECK(owner->result_ok);
4273 return *owner->contents.result;
4275 int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
4276 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4277 int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
4278 memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
4282 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4283 CHECK(!owner->result_ok);
4284 return *owner->contents.err;
4286 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
4287 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4288 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
4291 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
4292 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
4293 for (size_t i = 0; i < ret.datalen; i++) {
4294 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
4298 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4299 CHECK(owner->result_ok);
4300 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
4302 ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok(uint64_t owner) {
4303 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4304 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
4305 ptrArray ret_arr = NULL;
4306 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
4307 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
4308 for (size_t m = 0; m < ret_var.datalen; m++) {
4309 LDKCVec_u8Z ret_conv_12_var = ret_var.data[m];
4310 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
4311 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
4312 CVec_u8Z_free(ret_conv_12_var);
4313 ret_arr_ptr[m] = ret_conv_12_arr;
4320 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4321 CHECK(!owner->result_ok);
4322 return *owner->contents.err;
4324 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_err(uint64_t owner) {
4325 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4326 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
4329 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4330 LDKInMemorySigner ret = *owner->contents.result;
4331 ret.is_owned = false;
4334 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint64_t owner) {
4335 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4336 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
4337 uint64_t ret_ref = 0;
4338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4343 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4344 CHECK(!owner->result_ok);
4345 return DecodeError_clone(&*owner->contents.err);
4347 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
4348 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4349 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4350 *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
4351 uint64_t ret_ref = tag_ptr(ret_copy, true);
4355 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
4356 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
4357 for (size_t i = 0; i < ret.datalen; i++) {
4358 ret.data[i] = TxOut_clone(&orig->data[i]);
4362 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4363 CHECK(owner->result_ok);
4364 return *owner->contents.result;
4366 int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) {
4367 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4368 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
4369 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4370 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4374 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4375 CHECK(!owner->result_ok);
4376 return *owner->contents.err;
4378 void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) {
4379 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4380 CResult_TransactionNoneZ_get_err(owner_conv);
4383 uint32_t __attribute__((export_name("TS_LDKCOption_u16Z_ty_from_ptr"))) TS_LDKCOption_u16Z_ty_from_ptr(uint64_t ptr) {
4384 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4386 case LDKCOption_u16Z_Some: return 0;
4387 case LDKCOption_u16Z_None: return 1;
4391 int16_t __attribute__((export_name("TS_LDKCOption_u16Z_Some_get_some"))) TS_LDKCOption_u16Z_Some_get_some(uint64_t ptr) {
4392 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4393 assert(obj->tag == LDKCOption_u16Z_Some);
4394 int16_t some_conv = obj->some;
4397 uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
4398 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4400 case LDKAPIError_APIMisuseError: return 0;
4401 case LDKAPIError_FeeRateTooHigh: return 1;
4402 case LDKAPIError_RouteError: return 2;
4403 case LDKAPIError_ChannelUnavailable: return 3;
4404 case LDKAPIError_MonitorUpdateInProgress: return 4;
4405 case LDKAPIError_IncompatibleShutdownScript: return 5;
4409 jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
4410 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4411 assert(obj->tag == LDKAPIError_APIMisuseError);
4412 LDKStr err_str = obj->api_misuse_error.err;
4413 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4416 jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
4417 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4418 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4419 LDKStr err_str = obj->fee_rate_too_high.err;
4420 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4423 int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
4424 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4425 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4426 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
4427 return feerate_conv;
4429 jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
4430 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4431 assert(obj->tag == LDKAPIError_RouteError);
4432 LDKStr err_str = obj->route_error.err;
4433 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4436 jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
4437 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4438 assert(obj->tag == LDKAPIError_ChannelUnavailable);
4439 LDKStr err_str = obj->channel_unavailable.err;
4440 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4443 uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
4444 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4445 assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
4446 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
4447 uint64_t script_ref = 0;
4448 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
4449 script_ref = tag_ptr(script_var.inner, false);
4452 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4453 CHECK(owner->result_ok);
4454 return *owner->contents.result;
4456 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
4457 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4458 CResult_NoneAPIErrorZ_get_ok(owner_conv);
4461 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4462 CHECK(!owner->result_ok);
4463 return APIError_clone(&*owner->contents.err);
4465 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
4466 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4467 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4468 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
4469 uint64_t ret_ref = tag_ptr(ret_copy, true);
4473 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
4474 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
4475 for (size_t i = 0; i < ret.datalen; i++) {
4476 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
4480 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
4481 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
4482 for (size_t i = 0; i < ret.datalen; i++) {
4483 ret.data[i] = APIError_clone(&orig->data[i]);
4487 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4488 CHECK(owner->result_ok);
4489 return ThirtyTwoBytes_clone(&*owner->contents.result);
4491 int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint64_t owner) {
4492 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4493 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4494 memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32);
4498 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4499 CHECK(!owner->result_ok);
4500 return APIError_clone(&*owner->contents.err);
4502 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_CResult__u832APIErrorZ_get_err(uint64_t owner) {
4503 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4504 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4505 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
4506 uint64_t ret_ref = tag_ptr(ret_copy, true);
4510 uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
4511 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4513 case LDKPaymentSendFailure_ParameterError: return 0;
4514 case LDKPaymentSendFailure_PathParameterError: return 1;
4515 case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
4516 case LDKPaymentSendFailure_PartialFailure: return 3;
4520 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint64_t ptr) {
4521 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4522 assert(obj->tag == LDKPaymentSendFailure_ParameterError);
4523 uint64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
4524 return parameter_error_ref;
4526 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint64_t ptr) {
4527 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4528 assert(obj->tag == LDKPaymentSendFailure_PathParameterError);
4529 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
4530 uint64_tArray path_parameter_error_arr = NULL;
4531 path_parameter_error_arr = init_uint64_tArray(path_parameter_error_var.datalen, __LINE__);
4532 uint64_t *path_parameter_error_arr_ptr = (uint64_t*)(((uint8_t*)path_parameter_error_arr) + 8);
4533 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
4534 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4535 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
4536 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
4537 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
4540 return path_parameter_error_arr;
4542 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
4543 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4544 assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
4545 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
4546 uint64_tArray all_failed_retry_safe_arr = NULL;
4547 all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
4548 uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
4549 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
4550 uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
4551 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
4554 return all_failed_retry_safe_arr;
4556 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
4557 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4558 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4559 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
4560 uint64_tArray results_arr = NULL;
4561 results_arr = init_uint64_tArray(results_var.datalen, __LINE__);
4562 uint64_t *results_arr_ptr = (uint64_t*)(((uint8_t*)results_arr) + 8);
4563 for (size_t w = 0; w < results_var.datalen; w++) {
4564 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4565 *results_conv_22_conv = results_var.data[w];
4566 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
4567 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
4572 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry"))) TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(uint64_t ptr) {
4573 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4574 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4575 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
4576 uint64_t failed_paths_retry_ref = 0;
4577 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
4578 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
4579 return failed_paths_retry_ref;
4581 int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint64_t ptr) {
4582 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4583 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4584 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
4585 memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
4586 return payment_id_arr;
4588 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4589 CHECK(owner->result_ok);
4590 return ThirtyTwoBytes_clone(&*owner->contents.result);
4592 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
4593 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4594 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4595 memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
4599 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4600 CHECK(!owner->result_ok);
4601 return PaymentSendFailure_clone(&*owner->contents.err);
4603 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
4604 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4605 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4606 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
4607 uint64_t ret_ref = tag_ptr(ret_copy, true);
4611 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4612 CHECK(owner->result_ok);
4613 return *owner->contents.result;
4615 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
4616 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4617 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
4620 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4621 CHECK(!owner->result_ok);
4622 return PaymentSendFailure_clone(&*owner->contents.err);
4624 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
4625 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4626 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4627 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
4628 uint64_t ret_ref = tag_ptr(ret_copy, true);
4632 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4633 return ThirtyTwoBytes_clone(&owner->a);
4635 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint64_t owner) {
4636 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4637 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4638 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32);
4642 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4643 return ThirtyTwoBytes_clone(&owner->b);
4645 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint64_t owner) {
4646 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4647 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4648 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32);
4652 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4653 CHECK(owner->result_ok);
4654 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
4656 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint64_t owner) {
4657 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4658 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
4659 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
4660 return tag_ptr(ret_conv, true);
4663 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4664 CHECK(!owner->result_ok);
4665 return PaymentSendFailure_clone(&*owner->contents.err);
4667 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(uint64_t owner) {
4668 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4669 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4670 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
4671 uint64_t ret_ref = tag_ptr(ret_copy, true);
4675 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
4676 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
4677 for (size_t i = 0; i < ret.datalen; i++) {
4678 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4682 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4683 return ThirtyTwoBytes_clone(&owner->a);
4685 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint64_t owner) {
4686 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4687 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4688 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32);
4692 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4693 return ThirtyTwoBytes_clone(&owner->b);
4695 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint64_t owner) {
4696 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4697 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4698 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32);
4702 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4703 CHECK(owner->result_ok);
4704 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4706 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint64_t owner) {
4707 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4708 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4709 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
4710 return tag_ptr(ret_conv, true);
4713 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4714 CHECK(!owner->result_ok);
4715 return *owner->contents.err;
4717 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint64_t owner) {
4718 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4719 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
4722 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4723 CHECK(owner->result_ok);
4724 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4726 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint64_t owner) {
4727 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4728 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4729 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
4730 return tag_ptr(ret_conv, true);
4733 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4734 CHECK(!owner->result_ok);
4735 return APIError_clone(&*owner->contents.err);
4737 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint64_t owner) {
4738 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4739 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4740 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
4741 uint64_t ret_ref = tag_ptr(ret_copy, true);
4745 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4746 CHECK(owner->result_ok);
4747 return ThirtyTwoBytes_clone(&*owner->contents.result);
4749 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint64_t owner) {
4750 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4751 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4752 memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32);
4756 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4757 CHECK(!owner->result_ok);
4758 return *owner->contents.err;
4760 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_err"))) TS_CResult_PaymentSecretNoneZ_get_err(uint64_t owner) {
4761 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4762 CResult_PaymentSecretNoneZ_get_err(owner_conv);
4765 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4766 CHECK(owner->result_ok);
4767 return ThirtyTwoBytes_clone(&*owner->contents.result);
4769 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint64_t owner) {
4770 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4771 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4772 memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32);
4776 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4777 CHECK(!owner->result_ok);
4778 return APIError_clone(&*owner->contents.err);
4780 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err"))) TS_CResult_PaymentSecretAPIErrorZ_get_err(uint64_t owner) {
4781 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4782 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4783 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
4784 uint64_t ret_ref = tag_ptr(ret_copy, true);
4788 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4789 CHECK(owner->result_ok);
4790 return ThirtyTwoBytes_clone(&*owner->contents.result);
4792 int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint64_t owner) {
4793 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4794 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4795 memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32);
4799 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4800 CHECK(!owner->result_ok);
4801 return APIError_clone(&*owner->contents.err);
4803 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_err"))) TS_CResult_PaymentPreimageAPIErrorZ_get_err(uint64_t owner) {
4804 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4805 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4806 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
4807 uint64_t ret_ref = tag_ptr(ret_copy, true);
4811 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4812 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
4813 ret.is_owned = false;
4816 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) {
4817 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4818 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
4819 uint64_t ret_ref = 0;
4820 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4821 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4825 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4826 CHECK(!owner->result_ok);
4827 return DecodeError_clone(&*owner->contents.err);
4829 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
4830 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4831 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4832 *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
4833 uint64_t ret_ref = tag_ptr(ret_copy, true);
4837 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4838 LDKChannelCounterparty ret = *owner->contents.result;
4839 ret.is_owned = false;
4842 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) {
4843 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4844 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
4845 uint64_t ret_ref = 0;
4846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4851 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4852 CHECK(!owner->result_ok);
4853 return DecodeError_clone(&*owner->contents.err);
4855 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
4856 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4857 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4858 *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
4859 uint64_t ret_ref = tag_ptr(ret_copy, true);
4863 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4864 LDKChannelDetails ret = *owner->contents.result;
4865 ret.is_owned = false;
4868 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) {
4869 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4870 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
4871 uint64_t ret_ref = 0;
4872 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4873 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4877 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4878 CHECK(!owner->result_ok);
4879 return DecodeError_clone(&*owner->contents.err);
4881 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
4882 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4883 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4884 *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
4885 uint64_t ret_ref = tag_ptr(ret_copy, true);
4889 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4890 LDKPhantomRouteHints ret = *owner->contents.result;
4891 ret.is_owned = false;
4894 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(uint64_t owner) {
4895 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4896 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
4897 uint64_t ret_ref = 0;
4898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4903 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4904 CHECK(!owner->result_ok);
4905 return DecodeError_clone(&*owner->contents.err);
4907 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
4908 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4909 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4910 *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
4911 uint64_t ret_ref = tag_ptr(ret_copy, true);
4915 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
4916 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
4917 for (size_t i = 0; i < ret.datalen; i++) {
4918 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
4922 typedef struct LDKWatch_JCalls {
4923 atomic_size_t refcnt;
4924 uint32_t instance_ptr;
4926 static void LDKWatch_JCalls_free(void* this_arg) {
4927 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4928 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4932 LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
4933 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4934 LDKOutPoint funding_txo_var = funding_txo;
4935 uint64_t funding_txo_ref = 0;
4936 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4937 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4938 LDKChannelMonitor monitor_var = monitor;
4939 uint64_t monitor_ref = 0;
4940 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
4941 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
4942 uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
4943 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
4946 LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
4947 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4948 LDKOutPoint funding_txo_var = funding_txo;
4949 uint64_t funding_txo_ref = 0;
4950 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4951 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4952 LDKChannelMonitorUpdate update_var = update;
4953 uint64_t update_ref = 0;
4954 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
4955 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
4956 uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 18, funding_txo_ref, update_ref, 0, 0, 0, 0);
4957 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
4960 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
4961 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4962 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, 0, 0, 0, 0, 0, 0);
4963 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
4964 ret_constr.datalen = ret->arr_len;
4965 if (ret_constr.datalen > 0)
4966 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
4968 ret_constr.data = NULL;
4969 uint64_t* ret_vals = ret->elems;
4970 for (size_t x = 0; x < ret_constr.datalen; x++) {
4971 uint64_t ret_conv_49 = ret_vals[x];
4972 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
4973 CHECK_ACCESS(ret_conv_49_ptr);
4974 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
4975 FREE(untag_ptr(ret_conv_49));
4976 ret_constr.data[x] = ret_conv_49_conv;
4981 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
4982 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
4983 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4985 static inline LDKWatch LDKWatch_init (JSValue o) {
4986 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
4987 atomic_init(&calls->refcnt, 1);
4988 calls->instance_ptr = o;
4991 .this_arg = (void*) calls,
4992 .watch_channel = watch_channel_LDKWatch_jcall,
4993 .update_channel = update_channel_LDKWatch_jcall,
4994 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
4995 .free = LDKWatch_JCalls_free,
4999 uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) {
5000 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
5001 *res_ptr = LDKWatch_init(o);
5002 return tag_ptr(res_ptr, true);
5004 uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
5005 void* this_arg_ptr = untag_ptr(this_arg);
5006 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5007 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5008 LDKOutPoint funding_txo_conv;
5009 funding_txo_conv.inner = untag_ptr(funding_txo);
5010 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
5011 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
5012 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
5013 LDKChannelMonitor monitor_conv;
5014 monitor_conv.inner = untag_ptr(monitor);
5015 monitor_conv.is_owned = ptr_is_owned(monitor);
5016 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
5017 monitor_conv = ChannelMonitor_clone(&monitor_conv);
5018 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
5022 uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
5023 void* this_arg_ptr = untag_ptr(this_arg);
5024 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5025 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5026 LDKOutPoint funding_txo_conv;
5027 funding_txo_conv.inner = untag_ptr(funding_txo);
5028 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
5029 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
5030 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
5031 LDKChannelMonitorUpdate update_conv;
5032 update_conv.inner = untag_ptr(update);
5033 update_conv.is_owned = ptr_is_owned(update);
5034 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
5035 update_conv = ChannelMonitorUpdate_clone(&update_conv);
5036 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv));
5040 uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
5041 void* this_arg_ptr = untag_ptr(this_arg);
5042 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5043 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5044 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
5045 uint64_tArray ret_arr = NULL;
5046 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
5047 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
5048 for (size_t x = 0; x < ret_var.datalen; x++) {
5049 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
5050 *ret_conv_49_conv = ret_var.data[x];
5051 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
5058 typedef struct LDKBroadcasterInterface_JCalls {
5059 atomic_size_t refcnt;
5060 uint32_t instance_ptr;
5061 } LDKBroadcasterInterface_JCalls;
5062 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
5063 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
5064 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5068 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
5069 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
5070 LDKTransaction tx_var = tx;
5071 int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
5072 memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
5073 Transaction_free(tx_var);
5074 js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
5076 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
5077 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
5078 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5080 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JSValue o) {
5081 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
5082 atomic_init(&calls->refcnt, 1);
5083 calls->instance_ptr = o;
5085 LDKBroadcasterInterface ret = {
5086 .this_arg = (void*) calls,
5087 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
5088 .free = LDKBroadcasterInterface_JCalls_free,
5092 uint64_t __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroadcasterInterface_new(JSValue o) {
5093 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
5094 *res_ptr = LDKBroadcasterInterface_init(o);
5095 return tag_ptr(res_ptr, true);
5097 void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint64_t this_arg, int8_tArray tx) {
5098 void* this_arg_ptr = untag_ptr(this_arg);
5099 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5100 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
5101 LDKTransaction tx_ref;
5102 tx_ref.datalen = tx->arr_len;
5103 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
5104 memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx);
5105 tx_ref.data_is_owned = true;
5106 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
5109 typedef struct LDKKeysInterface_JCalls {
5110 atomic_size_t refcnt;
5111 uint32_t instance_ptr;
5112 } LDKKeysInterface_JCalls;
5113 static void LDKKeysInterface_JCalls_free(void* this_arg) {
5114 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5115 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5119 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
5120 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5121 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5122 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, recipient_conv, 0, 0, 0, 0, 0);
5123 void* ret_ptr = untag_ptr(ret);
5124 CHECK_ACCESS(ret_ptr);
5125 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
5126 FREE(untag_ptr(ret));
5129 LDKCResult_PublicKeyNoneZ get_node_id_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
5130 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5131 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5132 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, recipient_conv, 0, 0, 0, 0, 0);
5133 void* ret_ptr = untag_ptr(ret);
5134 CHECK_ACCESS(ret_ptr);
5135 LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
5136 FREE(untag_ptr(ret));
5139 LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
5140 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5141 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5142 int8_tArray other_key_arr = init_int8_tArray(33, __LINE__);
5143 memcpy(other_key_arr->elems, other_key.compressed_form, 33);
5144 LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
5145 *tweak_copy = tweak;
5146 uint64_t tweak_ref = tag_ptr(tweak_copy, true);
5147 uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 23, recipient_conv, (uint32_t)other_key_arr, tweak_ref, 0, 0, 0);
5148 void* ret_ptr = untag_ptr(ret);
5149 CHECK_ACCESS(ret_ptr);
5150 LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
5151 FREE(untag_ptr(ret));
5154 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
5155 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5156 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0);
5157 LDKCVec_u8Z ret_ref;
5158 ret_ref.datalen = ret->arr_len;
5159 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5160 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5163 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
5164 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5165 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, 0, 0, 0, 0, 0, 0);
5166 LDKShutdownScript ret_conv;
5167 ret_conv.inner = untag_ptr(ret);
5168 ret_conv.is_owned = ptr_is_owned(ret);
5169 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
5172 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
5173 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5174 jboolean inbound_conv = inbound;
5175 int64_t channel_value_satoshis_conv = channel_value_satoshis;
5176 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 26, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
5177 void* ret_ptr = untag_ptr(ret);
5178 CHECK_ACCESS(ret_ptr);
5179 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
5180 FREE(untag_ptr(ret));
5183 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
5184 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5185 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0);
5186 LDKThirtyTwoBytes ret_ref;
5187 CHECK(ret->arr_len == 32);
5188 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5191 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
5192 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5193 LDKu8slice reader_var = reader;
5194 int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
5195 memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
5196 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
5197 void* ret_ptr = untag_ptr(ret);
5198 CHECK_ACCESS(ret_ptr);
5199 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
5200 FREE(untag_ptr(ret));
5203 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
5204 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5205 LDKu8slice hrp_bytes_var = hrp_bytes;
5206 int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
5207 memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
5208 LDKCVec_u5Z invoice_data_var = invoice_data;
5209 ptrArray invoice_data_arr = NULL;
5210 invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
5211 int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
5212 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
5213 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
5214 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
5217 FREE(invoice_data_var.data);
5218 uint32_t receipient_conv = LDKRecipient_to_js(receipient);
5219 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0);
5220 void* ret_ptr = untag_ptr(ret);
5221 CHECK_ACCESS(ret_ptr);
5222 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
5223 FREE(untag_ptr(ret));
5226 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
5227 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5228 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
5229 LDKThirtyTwoBytes ret_ref;
5230 CHECK(ret->arr_len == 32);
5231 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5234 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
5235 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
5236 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5238 static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
5239 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
5240 atomic_init(&calls->refcnt, 1);
5241 calls->instance_ptr = o;
5243 LDKKeysInterface ret = {
5244 .this_arg = (void*) calls,
5245 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
5246 .get_node_id = get_node_id_LDKKeysInterface_jcall,
5247 .ecdh = ecdh_LDKKeysInterface_jcall,
5248 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
5249 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
5250 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
5251 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
5252 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
5253 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
5254 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
5255 .free = LDKKeysInterface_JCalls_free,
5259 uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
5260 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5261 *res_ptr = LDKKeysInterface_init(o);
5262 return tag_ptr(res_ptr, true);
5264 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
5265 void* this_arg_ptr = untag_ptr(this_arg);
5266 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5267 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5268 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5269 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
5270 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
5271 return tag_ptr(ret_conv, true);
5274 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_id"))) TS_KeysInterface_get_node_id(uint64_t this_arg, uint32_t recipient) {
5275 void* this_arg_ptr = untag_ptr(this_arg);
5276 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5277 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5278 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5279 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
5280 *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
5281 return tag_ptr(ret_conv, true);
5284 uint64_t __attribute__((export_name("TS_KeysInterface_ecdh"))) TS_KeysInterface_ecdh(uint64_t this_arg, uint32_t recipient, int8_tArray other_key, uint64_t tweak) {
5285 void* this_arg_ptr = untag_ptr(this_arg);
5286 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5287 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5288 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5289 LDKPublicKey other_key_ref;
5290 CHECK(other_key->arr_len == 33);
5291 memcpy(other_key_ref.compressed_form, other_key->elems, 33); FREE(other_key);
5292 void* tweak_ptr = untag_ptr(tweak);
5293 CHECK_ACCESS(tweak_ptr);
5294 LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
5295 // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
5296 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
5297 *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
5298 return tag_ptr(ret_conv, true);
5301 int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
5302 void* this_arg_ptr = untag_ptr(this_arg);
5303 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5304 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5305 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
5306 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5307 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5308 CVec_u8Z_free(ret_var);
5312 uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
5313 void* this_arg_ptr = untag_ptr(this_arg);
5314 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5315 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5316 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
5317 uint64_t ret_ref = 0;
5318 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5319 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5323 uint64_t __attribute__((export_name("TS_KeysInterface_get_channel_signer"))) TS_KeysInterface_get_channel_signer(uint64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
5324 void* this_arg_ptr = untag_ptr(this_arg);
5325 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5326 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5327 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5328 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
5329 return tag_ptr(ret_ret, true);
5332 int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
5333 void* this_arg_ptr = untag_ptr(this_arg);
5334 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5335 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5336 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5337 memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
5341 uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
5342 void* this_arg_ptr = untag_ptr(this_arg);
5343 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5344 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5345 LDKu8slice reader_ref;
5346 reader_ref.datalen = reader->arr_len;
5347 reader_ref.data = reader->elems;
5348 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
5349 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
5351 return tag_ptr(ret_conv, true);
5354 uint64_t __attribute__((export_name("TS_KeysInterface_sign_invoice"))) TS_KeysInterface_sign_invoice(uint64_t this_arg, int8_tArray hrp_bytes, ptrArray invoice_data, uint32_t receipient) {
5355 void* this_arg_ptr = untag_ptr(this_arg);
5356 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5357 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5358 LDKu8slice hrp_bytes_ref;
5359 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
5360 hrp_bytes_ref.data = hrp_bytes->elems;
5361 LDKCVec_u5Z invoice_data_constr;
5362 invoice_data_constr.datalen = invoice_data->arr_len;
5363 if (invoice_data_constr.datalen > 0)
5364 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
5366 invoice_data_constr.data = NULL;
5367 int8_t* invoice_data_vals = (void*) invoice_data->elems;
5368 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
5369 int8_t invoice_data_conv_7 = invoice_data_vals[h];
5371 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
5374 LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
5375 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
5376 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
5378 return tag_ptr(ret_conv, true);
5381 int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
5382 void* this_arg_ptr = untag_ptr(this_arg);
5383 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5384 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5385 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5386 memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
5390 typedef struct LDKFeeEstimator_JCalls {
5391 atomic_size_t refcnt;
5392 uint32_t instance_ptr;
5393 } LDKFeeEstimator_JCalls;
5394 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
5395 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5396 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5400 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
5401 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5402 uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
5403 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, confirmation_target_conv, 0, 0, 0, 0, 0);
5405 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
5406 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
5407 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5409 static inline LDKFeeEstimator LDKFeeEstimator_init (JSValue o) {
5410 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
5411 atomic_init(&calls->refcnt, 1);
5412 calls->instance_ptr = o;
5414 LDKFeeEstimator ret = {
5415 .this_arg = (void*) calls,
5416 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
5417 .free = LDKFeeEstimator_JCalls_free,
5421 uint64_t __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_new(JSValue o) {
5422 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
5423 *res_ptr = LDKFeeEstimator_init(o);
5424 return tag_ptr(res_ptr, true);
5426 int32_t __attribute__((export_name("TS_FeeEstimator_get_est_sat_per_1000_weight"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint64_t this_arg, uint32_t confirmation_target) {
5427 void* this_arg_ptr = untag_ptr(this_arg);
5428 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5429 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
5430 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
5431 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
5435 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5436 return ThirtyTwoBytes_clone(&owner->a);
5438 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint64_t owner) {
5439 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5440 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5441 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32);
5445 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5446 LDKChannelManager ret = owner->b;
5447 ret.is_owned = false;
5450 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint64_t owner) {
5451 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5452 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
5453 uint64_t ret_ref = 0;
5454 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5455 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5459 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5460 CHECK(owner->result_ok);
5461 return &*owner->contents.result;
5463 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint64_t owner) {
5464 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5465 uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
5469 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5470 CHECK(!owner->result_ok);
5471 return DecodeError_clone(&*owner->contents.err);
5473 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
5474 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5475 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5476 *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
5477 uint64_t ret_ref = tag_ptr(ret_copy, true);
5481 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5482 LDKChannelConfig ret = *owner->contents.result;
5483 ret.is_owned = false;
5486 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint64_t owner) {
5487 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5488 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
5489 uint64_t ret_ref = 0;
5490 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5491 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5495 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5496 CHECK(!owner->result_ok);
5497 return DecodeError_clone(&*owner->contents.err);
5499 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
5500 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5501 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5502 *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
5503 uint64_t ret_ref = tag_ptr(ret_copy, true);
5507 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5508 LDKOutPoint ret = *owner->contents.result;
5509 ret.is_owned = false;
5512 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint64_t owner) {
5513 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5514 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
5515 uint64_t ret_ref = 0;
5516 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5517 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5521 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5522 CHECK(!owner->result_ok);
5523 return DecodeError_clone(&*owner->contents.err);
5525 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
5526 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5527 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5528 *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
5529 uint64_t ret_ref = tag_ptr(ret_copy, true);
5533 typedef struct LDKType_JCalls {
5534 atomic_size_t refcnt;
5535 uint32_t instance_ptr;
5537 static void LDKType_JCalls_free(void* this_arg) {
5538 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5539 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5543 uint16_t type_id_LDKType_jcall(const void* this_arg) {
5544 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5545 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, 0, 0, 0, 0, 0, 0);
5547 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
5548 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5549 jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 33, 0, 0, 0, 0, 0, 0);
5550 LDKStr ret_conv = str_ref_to_owned_c(ret);
5553 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
5554 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5555 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0);
5556 LDKCVec_u8Z ret_ref;
5557 ret_ref.datalen = ret->arr_len;
5558 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5559 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5562 static void LDKType_JCalls_cloned(LDKType* new_obj) {
5563 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
5564 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5566 static inline LDKType LDKType_init (JSValue o) {
5567 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
5568 atomic_init(&calls->refcnt, 1);
5569 calls->instance_ptr = o;
5572 .this_arg = (void*) calls,
5573 .type_id = type_id_LDKType_jcall,
5574 .debug_str = debug_str_LDKType_jcall,
5575 .write = write_LDKType_jcall,
5576 .cloned = LDKType_JCalls_cloned,
5577 .free = LDKType_JCalls_free,
5581 uint64_t __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) {
5582 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
5583 *res_ptr = LDKType_init(o);
5584 return tag_ptr(res_ptr, true);
5586 int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint64_t this_arg) {
5587 void* this_arg_ptr = untag_ptr(this_arg);
5588 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5589 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5590 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
5594 jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint64_t this_arg) {
5595 void* this_arg_ptr = untag_ptr(this_arg);
5596 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5597 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5598 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
5599 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5604 int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint64_t this_arg) {
5605 void* this_arg_ptr = untag_ptr(this_arg);
5606 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5607 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5608 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5609 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5610 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5611 CVec_u8Z_free(ret_var);
5615 uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_ty_from_ptr"))) TS_LDKCOption_TypeZ_ty_from_ptr(uint64_t ptr) {
5616 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5618 case LDKCOption_TypeZ_Some: return 0;
5619 case LDKCOption_TypeZ_None: return 1;
5623 uint64_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LDKCOption_TypeZ_Some_get_some(uint64_t ptr) {
5624 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5625 assert(obj->tag == LDKCOption_TypeZ_Some);
5626 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
5627 *some_ret = Type_clone(&obj->some);
5628 return tag_ptr(some_ret, true);
5630 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5631 CHECK(owner->result_ok);
5632 return COption_TypeZ_clone(&*owner->contents.result);
5634 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_get_ok(uint64_t owner) {
5635 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5636 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
5637 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
5638 uint64_t ret_ref = tag_ptr(ret_copy, true);
5642 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5643 CHECK(!owner->result_ok);
5644 return DecodeError_clone(&*owner->contents.err);
5646 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
5647 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5648 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5649 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
5650 uint64_t ret_ref = tag_ptr(ret_copy, true);
5654 uint32_t __attribute__((export_name("TS_LDKPaymentError_ty_from_ptr"))) TS_LDKPaymentError_ty_from_ptr(uint64_t ptr) {
5655 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5657 case LDKPaymentError_Invoice: return 0;
5658 case LDKPaymentError_Routing: return 1;
5659 case LDKPaymentError_Sending: return 2;
5663 jstring __attribute__((export_name("TS_LDKPaymentError_Invoice_get_invoice"))) TS_LDKPaymentError_Invoice_get_invoice(uint64_t ptr) {
5664 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5665 assert(obj->tag == LDKPaymentError_Invoice);
5666 LDKStr invoice_str = obj->invoice;
5667 jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
5668 return invoice_conv;
5670 uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
5671 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5672 assert(obj->tag == LDKPaymentError_Routing);
5673 LDKLightningError routing_var = obj->routing;
5674 uint64_t routing_ref = 0;
5675 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
5676 routing_ref = tag_ptr(routing_var.inner, false);
5679 uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
5680 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5681 assert(obj->tag == LDKPaymentError_Sending);
5682 uint64_t sending_ref = tag_ptr(&obj->sending, false);
5685 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5686 CHECK(owner->result_ok);
5687 return ThirtyTwoBytes_clone(&*owner->contents.result);
5689 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_ok"))) TS_CResult_PaymentIdPaymentErrorZ_get_ok(uint64_t owner) {
5690 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5691 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5692 memcpy(ret_arr->elems, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data, 32);
5696 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5697 CHECK(!owner->result_ok);
5698 return PaymentError_clone(&*owner->contents.err);
5700 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_err"))) TS_CResult_PaymentIdPaymentErrorZ_get_err(uint64_t owner) {
5701 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5702 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
5703 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
5704 uint64_t ret_ref = tag_ptr(ret_copy, true);
5708 static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
5709 LDKInFlightHtlcs ret = *owner->contents.result;
5710 ret.is_owned = false;
5713 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok(uint64_t owner) {
5714 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
5715 LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
5716 uint64_t ret_ref = 0;
5717 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5718 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5722 static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
5723 CHECK(!owner->result_ok);
5724 return DecodeError_clone(&*owner->contents.err);
5726 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_err(uint64_t owner) {
5727 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
5728 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5729 *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
5730 uint64_t ret_ref = tag_ptr(ret_copy, true);
5734 uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
5735 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5737 case LDKParseError_Bech32Error: return 0;
5738 case LDKParseError_ParseAmountError: return 1;
5739 case LDKParseError_MalformedSignature: return 2;
5740 case LDKParseError_BadPrefix: return 3;
5741 case LDKParseError_UnknownCurrency: return 4;
5742 case LDKParseError_UnknownSiPrefix: return 5;
5743 case LDKParseError_MalformedHRP: return 6;
5744 case LDKParseError_TooShortDataPart: return 7;
5745 case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
5746 case LDKParseError_DescriptionDecodeError: return 9;
5747 case LDKParseError_PaddingError: return 10;
5748 case LDKParseError_IntegerOverflowError: return 11;
5749 case LDKParseError_InvalidSegWitProgramLength: return 12;
5750 case LDKParseError_InvalidPubKeyHashLength: return 13;
5751 case LDKParseError_InvalidScriptHashLength: return 14;
5752 case LDKParseError_InvalidRecoveryId: return 15;
5753 case LDKParseError_InvalidSliceLength: return 16;
5754 case LDKParseError_Skip: return 17;
5758 uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
5759 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5760 assert(obj->tag == LDKParseError_Bech32Error);
5761 uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
5762 return bech32_error_ref;
5764 int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
5765 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5766 assert(obj->tag == LDKParseError_ParseAmountError);
5767 /*obj->parse_amount_error*/
5770 uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
5771 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5772 assert(obj->tag == LDKParseError_MalformedSignature);
5773 uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
5774 return malformed_signature_conv;
5776 int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
5777 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5778 assert(obj->tag == LDKParseError_DescriptionDecodeError);
5779 /*obj->description_decode_error*/
5782 jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
5783 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5784 assert(obj->tag == LDKParseError_InvalidSliceLength);
5785 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
5786 jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
5787 return invalid_slice_length_conv;
5789 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5790 CHECK(owner->result_ok);
5791 return SiPrefix_clone(&*owner->contents.result);
5793 uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
5794 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5795 uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
5799 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5800 CHECK(!owner->result_ok);
5801 return ParseError_clone(&*owner->contents.err);
5803 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
5804 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5805 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5806 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
5807 uint64_t ret_ref = tag_ptr(ret_copy, true);
5811 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
5812 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5814 case LDKParseOrSemanticError_ParseError: return 0;
5815 case LDKParseOrSemanticError_SemanticError: return 1;
5819 uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
5820 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5821 assert(obj->tag == LDKParseOrSemanticError_ParseError);
5822 uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
5823 return parse_error_ref;
5825 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
5826 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5827 assert(obj->tag == LDKParseOrSemanticError_SemanticError);
5828 uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
5829 return semantic_error_conv;
5831 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5832 LDKInvoice ret = *owner->contents.result;
5833 ret.is_owned = false;
5836 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
5837 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5838 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
5839 uint64_t ret_ref = 0;
5840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5845 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5846 CHECK(!owner->result_ok);
5847 return ParseOrSemanticError_clone(&*owner->contents.err);
5849 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
5850 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5851 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
5852 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
5853 uint64_t ret_ref = tag_ptr(ret_copy, true);
5857 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5858 LDKSignedRawInvoice ret = *owner->contents.result;
5859 ret.is_owned = false;
5862 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
5863 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5864 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
5865 uint64_t ret_ref = 0;
5866 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5867 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5871 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5872 CHECK(!owner->result_ok);
5873 return ParseError_clone(&*owner->contents.err);
5875 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
5876 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5877 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5878 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
5879 uint64_t ret_ref = tag_ptr(ret_copy, true);
5883 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5884 LDKRawInvoice ret = owner->a;
5885 ret.is_owned = false;
5888 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
5889 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5890 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
5891 uint64_t ret_ref = 0;
5892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5897 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5898 return ThirtyTwoBytes_clone(&owner->b);
5900 int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
5901 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5902 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5903 memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
5907 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5908 LDKInvoiceSignature ret = owner->c;
5909 ret.is_owned = false;
5912 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
5913 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5914 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
5915 uint64_t ret_ref = 0;
5916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5921 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5922 LDKPayeePubKey ret = *owner->contents.result;
5923 ret.is_owned = false;
5926 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
5927 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5928 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
5929 uint64_t ret_ref = 0;
5930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5935 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5936 CHECK(!owner->result_ok);
5937 return *owner->contents.err;
5939 uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
5940 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5941 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
5945 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
5946 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
5947 for (size_t i = 0; i < ret.datalen; i++) {
5948 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
5952 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5953 LDKPositiveTimestamp ret = *owner->contents.result;
5954 ret.is_owned = false;
5957 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
5958 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5959 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
5960 uint64_t ret_ref = 0;
5961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5966 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5967 CHECK(!owner->result_ok);
5968 return CreationError_clone(&*owner->contents.err);
5970 uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
5971 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5972 uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
5976 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5977 CHECK(owner->result_ok);
5978 return *owner->contents.result;
5980 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
5981 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5982 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
5985 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5986 CHECK(!owner->result_ok);
5987 return SemanticError_clone(&*owner->contents.err);
5989 uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
5990 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5991 uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
5995 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5996 LDKInvoice ret = *owner->contents.result;
5997 ret.is_owned = false;
6000 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
6001 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
6002 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
6003 uint64_t ret_ref = 0;
6004 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6005 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6009 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
6010 CHECK(!owner->result_ok);
6011 return SemanticError_clone(&*owner->contents.err);
6013 uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
6014 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
6015 uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
6019 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
6020 LDKDescription ret = *owner->contents.result;
6021 ret.is_owned = false;
6024 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
6025 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
6026 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
6027 uint64_t ret_ref = 0;
6028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6033 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
6034 CHECK(!owner->result_ok);
6035 return CreationError_clone(&*owner->contents.err);
6037 uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
6038 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
6039 uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
6043 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
6044 LDKPrivateRoute ret = *owner->contents.result;
6045 ret.is_owned = false;
6048 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
6049 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
6050 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
6051 uint64_t ret_ref = 0;
6052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6057 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
6058 CHECK(!owner->result_ok);
6059 return CreationError_clone(&*owner->contents.err);
6061 uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
6062 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
6063 uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
6067 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
6068 CHECK(owner->result_ok);
6069 return *owner->contents.result;
6071 jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
6072 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
6073 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
6074 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
6078 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
6079 CHECK(!owner->result_ok);
6080 return *owner->contents.err;
6082 uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
6083 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
6084 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
6088 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
6089 LDKChannelMonitorUpdate ret = *owner->contents.result;
6090 ret.is_owned = false;
6093 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6094 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
6095 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
6096 uint64_t ret_ref = 0;
6097 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6098 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6102 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
6103 CHECK(!owner->result_ok);
6104 return DecodeError_clone(&*owner->contents.err);
6106 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
6107 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
6108 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6109 *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
6110 uint64_t ret_ref = tag_ptr(ret_copy, true);
6114 uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
6115 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
6117 case LDKCOption_MonitorEventZ_Some: return 0;
6118 case LDKCOption_MonitorEventZ_None: return 1;
6122 uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
6123 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
6124 assert(obj->tag == LDKCOption_MonitorEventZ_Some);
6125 uint64_t some_ref = tag_ptr(&obj->some, false);
6128 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
6129 CHECK(owner->result_ok);
6130 return COption_MonitorEventZ_clone(&*owner->contents.result);
6132 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
6133 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
6134 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
6135 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
6136 uint64_t ret_ref = tag_ptr(ret_copy, true);
6140 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
6141 CHECK(!owner->result_ok);
6142 return DecodeError_clone(&*owner->contents.err);
6144 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
6145 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
6146 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6147 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
6148 uint64_t ret_ref = tag_ptr(ret_copy, true);
6152 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6153 LDKHTLCUpdate ret = *owner->contents.result;
6154 ret.is_owned = false;
6157 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6158 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6159 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
6160 uint64_t ret_ref = 0;
6161 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6162 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6166 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6167 CHECK(!owner->result_ok);
6168 return DecodeError_clone(&*owner->contents.err);
6170 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
6171 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6172 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6173 *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
6174 uint64_t ret_ref = tag_ptr(ret_copy, true);
6178 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6179 LDKOutPoint ret = owner->a;
6180 ret.is_owned = false;
6183 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
6184 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6185 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
6186 uint64_t ret_ref = 0;
6187 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6188 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6192 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6193 return CVec_u8Z_clone(&owner->b);
6195 int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
6196 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6197 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
6198 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6199 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6200 CVec_u8Z_free(ret_var);
6204 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6207 int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
6208 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6209 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
6213 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6214 return CVec_u8Z_clone(&owner->b);
6216 int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
6217 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6218 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
6219 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6220 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6221 CVec_u8Z_free(ret_var);
6225 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
6226 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
6227 for (size_t i = 0; i < ret.datalen; i++) {
6228 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
6232 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6233 return ThirtyTwoBytes_clone(&owner->a);
6235 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint64_t owner) {
6236 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6237 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6238 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32);
6242 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6243 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
6245 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint64_t owner) {
6246 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6247 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
6248 uint64_tArray ret_arr = NULL;
6249 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6250 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6251 for (size_t v = 0; v < ret_var.datalen; v++) {
6252 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
6253 *ret_conv_21_conv = ret_var.data[v];
6254 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
6261 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
6262 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 };
6263 for (size_t i = 0; i < ret.datalen; i++) {
6264 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
6268 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
6269 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
6270 for (size_t i = 0; i < ret.datalen; i++) {
6271 ret.data[i] = Event_clone(&orig->data[i]);
6275 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6278 int32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_a"))) TS_C2Tuple_u32TxOutZ_get_a(uint64_t owner) {
6279 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6280 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
6284 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6285 return TxOut_clone(&owner->b);
6287 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_u32TxOutZ_get_b(uint64_t owner) {
6288 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6289 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
6290 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
6291 return tag_ptr(ret_ref, true);
6294 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
6295 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
6296 for (size_t i = 0; i < ret.datalen; i++) {
6297 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
6301 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6302 return ThirtyTwoBytes_clone(&owner->a);
6304 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint64_t owner) {
6305 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6306 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6307 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32);
6311 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6312 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
6314 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint64_t owner) {
6315 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6316 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
6317 uint64_tArray ret_arr = NULL;
6318 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6319 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6320 for (size_t u = 0; u < ret_var.datalen; u++) {
6321 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
6322 *ret_conv_20_conv = ret_var.data[u];
6323 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
6330 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
6331 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 };
6332 for (size_t i = 0; i < ret.datalen; i++) {
6333 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
6337 uint32_t __attribute__((export_name("TS_LDKBalance_ty_from_ptr"))) TS_LDKBalance_ty_from_ptr(uint64_t ptr) {
6338 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6340 case LDKBalance_ClaimableOnChannelClose: return 0;
6341 case LDKBalance_ClaimableAwaitingConfirmations: return 1;
6342 case LDKBalance_ContentiousClaimable: return 2;
6343 case LDKBalance_MaybeTimeoutClaimableHTLC: return 3;
6344 case LDKBalance_MaybePreimageClaimableHTLC: return 4;
6345 case LDKBalance_CounterpartyRevokedOutputClaimable: return 5;
6349 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(uint64_t ptr) {
6350 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6351 assert(obj->tag == LDKBalance_ClaimableOnChannelClose);
6352 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
6353 return claimable_amount_satoshis_conv;
6355 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(uint64_t ptr) {
6356 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6357 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6358 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
6359 return claimable_amount_satoshis_conv;
6361 int32_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(uint64_t ptr) {
6362 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6363 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6364 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
6365 return confirmation_height_conv;
6367 int64_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6368 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6369 assert(obj->tag == LDKBalance_ContentiousClaimable);
6370 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
6371 return claimable_amount_satoshis_conv;
6373 int32_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_timeout_height"))) TS_LDKBalance_ContentiousClaimable_get_timeout_height(uint64_t ptr) {
6374 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6375 assert(obj->tag == LDKBalance_ContentiousClaimable);
6376 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
6377 return timeout_height_conv;
6379 int64_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
6380 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6381 assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
6382 int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
6383 return claimable_amount_satoshis_conv;
6385 int32_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(uint64_t ptr) {
6386 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6387 assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
6388 int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
6389 return claimable_height_conv;
6391 int64_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
6392 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6393 assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
6394 int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
6395 return claimable_amount_satoshis_conv;
6397 int32_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(uint64_t ptr) {
6398 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6399 assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
6400 int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
6401 return expiry_height_conv;
6403 int64_t __attribute__((export_name("TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6404 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6405 assert(obj->tag == LDKBalance_CounterpartyRevokedOutputClaimable);
6406 int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
6407 return claimable_amount_satoshis_conv;
6409 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
6410 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
6411 for (size_t i = 0; i < ret.datalen; i++) {
6412 ret.data[i] = Balance_clone(&orig->data[i]);
6416 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6417 return ThirtyTwoBytes_clone(&owner->a);
6419 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint64_t owner) {
6420 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6421 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6422 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32);
6426 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6427 LDKChannelMonitor ret = owner->b;
6428 ret.is_owned = false;
6431 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint64_t owner) {
6432 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6433 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6434 uint64_t ret_ref = 0;
6435 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6436 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6440 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6441 CHECK(owner->result_ok);
6442 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
6444 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint64_t owner) {
6445 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6446 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6447 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
6448 return tag_ptr(ret_conv, true);
6451 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6452 CHECK(!owner->result_ok);
6453 return DecodeError_clone(&*owner->contents.err);
6455 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
6456 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6457 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6458 *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
6459 uint64_t ret_ref = tag_ptr(ret_copy, true);
6463 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6466 int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint64_t owner) {
6467 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6468 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
6469 memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33);
6473 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6474 return Type_clone(&owner->b);
6476 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint64_t owner) {
6477 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6478 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
6479 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
6480 return tag_ptr(ret_ret, true);
6483 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
6484 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
6485 for (size_t i = 0; i < ret.datalen; i++) {
6486 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
6490 typedef struct LDKCustomOnionMessageContents_JCalls {
6491 atomic_size_t refcnt;
6492 uint32_t instance_ptr;
6493 } LDKCustomOnionMessageContents_JCalls;
6494 static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
6495 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
6496 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6500 uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
6501 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
6502 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 35, 0, 0, 0, 0, 0, 0);
6504 LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
6505 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
6506 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 36, 0, 0, 0, 0, 0, 0);
6507 LDKCVec_u8Z ret_ref;
6508 ret_ref.datalen = ret->arr_len;
6509 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
6510 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
6513 static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
6514 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
6515 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6517 static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JSValue o) {
6518 LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
6519 atomic_init(&calls->refcnt, 1);
6520 calls->instance_ptr = o;
6522 LDKCustomOnionMessageContents ret = {
6523 .this_arg = (void*) calls,
6524 .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
6525 .write = write_LDKCustomOnionMessageContents_jcall,
6526 .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
6527 .free = LDKCustomOnionMessageContents_JCalls_free,
6531 uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageContents_new"))) TS_LDKCustomOnionMessageContents_new(JSValue o) {
6532 LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
6533 *res_ptr = LDKCustomOnionMessageContents_init(o);
6534 return tag_ptr(res_ptr, true);
6536 int64_t __attribute__((export_name("TS_CustomOnionMessageContents_tlv_type"))) TS_CustomOnionMessageContents_tlv_type(uint64_t this_arg) {
6537 void* this_arg_ptr = untag_ptr(this_arg);
6538 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6539 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
6540 int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
6544 int8_tArray __attribute__((export_name("TS_CustomOnionMessageContents_write"))) TS_CustomOnionMessageContents_write(uint64_t this_arg) {
6545 void* this_arg_ptr = untag_ptr(this_arg);
6546 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6547 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
6548 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
6549 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6550 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6551 CVec_u8Z_free(ret_var);
6555 uint32_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr"))) TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr(uint64_t ptr) {
6556 LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
6558 case LDKCOption_CustomOnionMessageContentsZ_Some: return 0;
6559 case LDKCOption_CustomOnionMessageContentsZ_None: return 1;
6563 uint64_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some"))) TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some(uint64_t ptr) {
6564 LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
6565 assert(obj->tag == LDKCOption_CustomOnionMessageContentsZ_Some);
6566 LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
6567 *some_ret = CustomOnionMessageContents_clone(&obj->some);
6568 return tag_ptr(some_ret, true);
6570 static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
6571 CHECK(owner->result_ok);
6572 return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
6574 uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(uint64_t owner) {
6575 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
6576 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
6577 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
6578 uint64_t ret_ref = tag_ptr(ret_copy, true);
6582 static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
6583 CHECK(!owner->result_ok);
6584 return DecodeError_clone(&*owner->contents.err);
6586 uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(uint64_t owner) {
6587 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
6588 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6589 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
6590 uint64_t ret_ref = tag_ptr(ret_copy, true);
6594 uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
6595 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6597 case LDKCOption_NetAddressZ_Some: return 0;
6598 case LDKCOption_NetAddressZ_None: return 1;
6602 uint64_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_Some_get_some"))) TS_LDKCOption_NetAddressZ_Some_get_some(uint64_t ptr) {
6603 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6604 assert(obj->tag == LDKCOption_NetAddressZ_Some);
6605 uint64_t some_ref = tag_ptr(&obj->some, false);
6608 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6609 CHECK(owner->result_ok);
6610 return CVec_u8Z_clone(&*owner->contents.result);
6612 int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint64_t owner) {
6613 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6614 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
6615 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6616 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6617 CVec_u8Z_free(ret_var);
6621 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6622 LDKPeerHandleError ret = *owner->contents.err;
6623 ret.is_owned = false;
6626 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint64_t owner) {
6627 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6628 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
6629 uint64_t ret_ref = 0;
6630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6635 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6636 CHECK(owner->result_ok);
6637 return *owner->contents.result;
6639 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_ok"))) TS_CResult_NonePeerHandleErrorZ_get_ok(uint64_t owner) {
6640 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6641 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
6644 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6645 LDKPeerHandleError ret = *owner->contents.err;
6646 ret.is_owned = false;
6649 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint64_t owner) {
6650 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6651 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
6652 uint64_t ret_ref = 0;
6653 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6654 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6658 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6659 CHECK(owner->result_ok);
6660 return *owner->contents.result;
6662 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_ok"))) TS_CResult_boolPeerHandleErrorZ_get_ok(uint64_t owner) {
6663 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6664 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
6668 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6669 LDKPeerHandleError ret = *owner->contents.err;
6670 ret.is_owned = false;
6673 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint64_t owner) {
6674 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6675 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
6676 uint64_t ret_ref = 0;
6677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6682 uint32_t __attribute__((export_name("TS_LDKSendError_ty_from_ptr"))) TS_LDKSendError_ty_from_ptr(uint64_t ptr) {
6683 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
6685 case LDKSendError_Secp256k1: return 0;
6686 case LDKSendError_TooBigPacket: return 1;
6687 case LDKSendError_TooFewBlindedHops: return 2;
6688 case LDKSendError_InvalidFirstHop: return 3;
6689 case LDKSendError_InvalidMessage: return 4;
6690 case LDKSendError_BufferFull: return 5;
6694 uint32_t __attribute__((export_name("TS_LDKSendError_Secp256k1_get_secp256k1"))) TS_LDKSendError_Secp256k1_get_secp256k1(uint64_t ptr) {
6695 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
6696 assert(obj->tag == LDKSendError_Secp256k1);
6697 uint32_t secp256k1_conv = LDKSecp256k1Error_to_js(obj->secp256k1);
6698 return secp256k1_conv;
6700 static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
6701 CHECK(owner->result_ok);
6702 return *owner->contents.result;
6704 void __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_ok"))) TS_CResult_NoneSendErrorZ_get_ok(uint64_t owner) {
6705 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
6706 CResult_NoneSendErrorZ_get_ok(owner_conv);
6709 static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
6710 CHECK(!owner->result_ok);
6711 return SendError_clone(&*owner->contents.err);
6713 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_err"))) TS_CResult_NoneSendErrorZ_get_err(uint64_t owner) {
6714 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
6715 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
6716 *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
6717 uint64_t ret_ref = tag_ptr(ret_copy, true);
6721 uint32_t __attribute__((export_name("TS_LDKGraphSyncError_ty_from_ptr"))) TS_LDKGraphSyncError_ty_from_ptr(uint64_t ptr) {
6722 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
6724 case LDKGraphSyncError_DecodeError: return 0;
6725 case LDKGraphSyncError_LightningError: return 1;
6729 uint64_t __attribute__((export_name("TS_LDKGraphSyncError_DecodeError_get_decode_error"))) TS_LDKGraphSyncError_DecodeError_get_decode_error(uint64_t ptr) {
6730 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
6731 assert(obj->tag == LDKGraphSyncError_DecodeError);
6732 uint64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
6733 return decode_error_ref;
6735 uint64_t __attribute__((export_name("TS_LDKGraphSyncError_LightningError_get_lightning_error"))) TS_LDKGraphSyncError_LightningError_get_lightning_error(uint64_t ptr) {
6736 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
6737 assert(obj->tag == LDKGraphSyncError_LightningError);
6738 LDKLightningError lightning_error_var = obj->lightning_error;
6739 uint64_t lightning_error_ref = 0;
6740 CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
6741 lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
6742 return lightning_error_ref;
6744 static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
6745 CHECK(owner->result_ok);
6746 return *owner->contents.result;
6748 int32_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_get_ok"))) TS_CResult_u32GraphSyncErrorZ_get_ok(uint64_t owner) {
6749 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
6750 int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
6754 static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
6755 CHECK(!owner->result_ok);
6756 return GraphSyncError_clone(&*owner->contents.err);
6758 uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_get_err"))) TS_CResult_u32GraphSyncErrorZ_get_err(uint64_t owner) {
6759 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
6760 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
6761 *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
6762 uint64_t ret_ref = tag_ptr(ret_copy, true);
6766 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6767 CHECK(owner->result_ok);
6768 return *owner->contents.result;
6770 void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
6771 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6772 CResult_NoneErrorZ_get_ok(owner_conv);
6775 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6776 CHECK(!owner->result_ok);
6777 return *owner->contents.err;
6779 uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
6780 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6781 uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
6785 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6786 CHECK(owner->result_ok);
6787 return NetAddress_clone(&*owner->contents.result);
6789 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
6790 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6791 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
6792 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
6793 uint64_t ret_ref = tag_ptr(ret_copy, true);
6797 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6798 CHECK(!owner->result_ok);
6799 return DecodeError_clone(&*owner->contents.err);
6801 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
6802 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6803 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6804 *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
6805 uint64_t ret_ref = tag_ptr(ret_copy, true);
6809 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
6810 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
6811 for (size_t i = 0; i < ret.datalen; i++) {
6812 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
6816 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
6817 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
6818 for (size_t i = 0; i < ret.datalen; i++) {
6819 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
6823 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
6824 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
6825 for (size_t i = 0; i < ret.datalen; i++) {
6826 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
6830 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
6831 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
6832 for (size_t i = 0; i < ret.datalen; i++) {
6833 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
6837 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6838 LDKAcceptChannel ret = *owner->contents.result;
6839 ret.is_owned = false;
6842 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
6843 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6844 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
6845 uint64_t ret_ref = 0;
6846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6851 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6852 CHECK(!owner->result_ok);
6853 return DecodeError_clone(&*owner->contents.err);
6855 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
6856 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6857 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6858 *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
6859 uint64_t ret_ref = tag_ptr(ret_copy, true);
6863 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6864 LDKAnnouncementSignatures ret = *owner->contents.result;
6865 ret.is_owned = false;
6868 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
6869 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6870 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
6871 uint64_t ret_ref = 0;
6872 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6873 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6877 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6878 CHECK(!owner->result_ok);
6879 return DecodeError_clone(&*owner->contents.err);
6881 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
6882 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6883 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6884 *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
6885 uint64_t ret_ref = tag_ptr(ret_copy, true);
6889 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6890 LDKChannelReestablish ret = *owner->contents.result;
6891 ret.is_owned = false;
6894 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint64_t owner) {
6895 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6896 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
6897 uint64_t ret_ref = 0;
6898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6903 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6904 CHECK(!owner->result_ok);
6905 return DecodeError_clone(&*owner->contents.err);
6907 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
6908 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6909 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6910 *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
6911 uint64_t ret_ref = tag_ptr(ret_copy, true);
6915 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6916 LDKClosingSigned ret = *owner->contents.result;
6917 ret.is_owned = false;
6920 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6921 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6922 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
6923 uint64_t ret_ref = 0;
6924 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6925 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6929 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6930 CHECK(!owner->result_ok);
6931 return DecodeError_clone(&*owner->contents.err);
6933 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
6934 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6935 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6936 *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
6937 uint64_t ret_ref = tag_ptr(ret_copy, true);
6941 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6942 LDKClosingSignedFeeRange ret = *owner->contents.result;
6943 ret.is_owned = false;
6946 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint64_t owner) {
6947 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6948 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
6949 uint64_t ret_ref = 0;
6950 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6951 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6955 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6956 CHECK(!owner->result_ok);
6957 return DecodeError_clone(&*owner->contents.err);
6959 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
6960 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6961 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6962 *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
6963 uint64_t ret_ref = tag_ptr(ret_copy, true);
6967 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6968 LDKCommitmentSigned ret = *owner->contents.result;
6969 ret.is_owned = false;
6972 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint64_t owner) {
6973 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6974 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
6975 uint64_t ret_ref = 0;
6976 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6977 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6981 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6982 CHECK(!owner->result_ok);
6983 return DecodeError_clone(&*owner->contents.err);
6985 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
6986 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6987 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6988 *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
6989 uint64_t ret_ref = tag_ptr(ret_copy, true);
6993 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6994 LDKFundingCreated ret = *owner->contents.result;
6995 ret.is_owned = false;
6998 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint64_t owner) {
6999 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
7000 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
7001 uint64_t ret_ref = 0;
7002 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7003 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7007 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
7008 CHECK(!owner->result_ok);
7009 return DecodeError_clone(&*owner->contents.err);
7011 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
7012 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
7013 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7014 *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
7015 uint64_t ret_ref = tag_ptr(ret_copy, true);
7019 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
7020 LDKFundingSigned ret = *owner->contents.result;
7021 ret.is_owned = false;
7024 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint64_t owner) {
7025 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
7026 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
7027 uint64_t ret_ref = 0;
7028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7033 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
7034 CHECK(!owner->result_ok);
7035 return DecodeError_clone(&*owner->contents.err);
7037 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
7038 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
7039 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7040 *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
7041 uint64_t ret_ref = tag_ptr(ret_copy, true);
7045 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
7046 LDKChannelReady ret = *owner->contents.result;
7047 ret.is_owned = false;
7050 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_get_ok(uint64_t owner) {
7051 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
7052 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
7053 uint64_t ret_ref = 0;
7054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7059 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
7060 CHECK(!owner->result_ok);
7061 return DecodeError_clone(&*owner->contents.err);
7063 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
7064 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
7065 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7066 *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
7067 uint64_t ret_ref = tag_ptr(ret_copy, true);
7071 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
7072 LDKInit ret = *owner->contents.result;
7073 ret.is_owned = false;
7076 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint64_t owner) {
7077 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
7078 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
7079 uint64_t ret_ref = 0;
7080 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7081 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7085 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
7086 CHECK(!owner->result_ok);
7087 return DecodeError_clone(&*owner->contents.err);
7089 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
7090 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
7091 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7092 *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
7093 uint64_t ret_ref = tag_ptr(ret_copy, true);
7097 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
7098 LDKOpenChannel ret = *owner->contents.result;
7099 ret.is_owned = false;
7102 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint64_t owner) {
7103 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
7104 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
7105 uint64_t ret_ref = 0;
7106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7111 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
7112 CHECK(!owner->result_ok);
7113 return DecodeError_clone(&*owner->contents.err);
7115 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
7116 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
7117 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7118 *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
7119 uint64_t ret_ref = tag_ptr(ret_copy, true);
7123 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
7124 LDKRevokeAndACK ret = *owner->contents.result;
7125 ret.is_owned = false;
7128 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint64_t owner) {
7129 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
7130 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
7131 uint64_t ret_ref = 0;
7132 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7133 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7137 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
7138 CHECK(!owner->result_ok);
7139 return DecodeError_clone(&*owner->contents.err);
7141 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
7142 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
7143 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7144 *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
7145 uint64_t ret_ref = tag_ptr(ret_copy, true);
7149 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
7150 LDKShutdown ret = *owner->contents.result;
7151 ret.is_owned = false;
7154 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint64_t owner) {
7155 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
7156 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
7157 uint64_t ret_ref = 0;
7158 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7159 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7163 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
7164 CHECK(!owner->result_ok);
7165 return DecodeError_clone(&*owner->contents.err);
7167 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
7168 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
7169 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7170 *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
7171 uint64_t ret_ref = tag_ptr(ret_copy, true);
7175 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
7176 LDKUpdateFailHTLC ret = *owner->contents.result;
7177 ret.is_owned = false;
7180 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7181 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
7182 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
7183 uint64_t ret_ref = 0;
7184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7189 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
7190 CHECK(!owner->result_ok);
7191 return DecodeError_clone(&*owner->contents.err);
7193 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
7194 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
7195 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7196 *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
7197 uint64_t ret_ref = tag_ptr(ret_copy, true);
7201 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
7202 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
7203 ret.is_owned = false;
7206 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7207 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
7208 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
7209 uint64_t ret_ref = 0;
7210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7211 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7215 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
7216 CHECK(!owner->result_ok);
7217 return DecodeError_clone(&*owner->contents.err);
7219 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
7220 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
7221 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7222 *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
7223 uint64_t ret_ref = tag_ptr(ret_copy, true);
7227 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
7228 LDKUpdateFee ret = *owner->contents.result;
7229 ret.is_owned = false;
7232 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint64_t owner) {
7233 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
7234 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
7235 uint64_t ret_ref = 0;
7236 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7237 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7241 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
7242 CHECK(!owner->result_ok);
7243 return DecodeError_clone(&*owner->contents.err);
7245 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
7246 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
7247 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7248 *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
7249 uint64_t ret_ref = tag_ptr(ret_copy, true);
7253 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
7254 LDKUpdateFulfillHTLC ret = *owner->contents.result;
7255 ret.is_owned = false;
7258 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7259 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
7260 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
7261 uint64_t ret_ref = 0;
7262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7267 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
7268 CHECK(!owner->result_ok);
7269 return DecodeError_clone(&*owner->contents.err);
7271 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
7272 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
7273 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7274 *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
7275 uint64_t ret_ref = tag_ptr(ret_copy, true);
7279 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
7280 LDKUpdateAddHTLC ret = *owner->contents.result;
7281 ret.is_owned = false;
7284 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7285 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
7286 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
7287 uint64_t ret_ref = 0;
7288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7293 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
7294 CHECK(!owner->result_ok);
7295 return DecodeError_clone(&*owner->contents.err);
7297 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
7298 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
7299 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7300 *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
7301 uint64_t ret_ref = tag_ptr(ret_copy, true);
7305 static inline struct LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
7306 LDKOnionMessage ret = *owner->contents.result;
7307 ret.is_owned = false;
7310 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_ok"))) TS_CResult_OnionMessageDecodeErrorZ_get_ok(uint64_t owner) {
7311 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
7312 LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
7313 uint64_t ret_ref = 0;
7314 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7315 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7319 static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
7320 CHECK(!owner->result_ok);
7321 return DecodeError_clone(&*owner->contents.err);
7323 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_err"))) TS_CResult_OnionMessageDecodeErrorZ_get_err(uint64_t owner) {
7324 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
7325 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7326 *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
7327 uint64_t ret_ref = tag_ptr(ret_copy, true);
7331 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7332 LDKPing ret = *owner->contents.result;
7333 ret.is_owned = false;
7336 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint64_t owner) {
7337 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7338 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
7339 uint64_t ret_ref = 0;
7340 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7341 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7345 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7346 CHECK(!owner->result_ok);
7347 return DecodeError_clone(&*owner->contents.err);
7349 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
7350 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7351 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7352 *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
7353 uint64_t ret_ref = tag_ptr(ret_copy, true);
7357 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7358 LDKPong ret = *owner->contents.result;
7359 ret.is_owned = false;
7362 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint64_t owner) {
7363 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7364 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
7365 uint64_t ret_ref = 0;
7366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7371 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7372 CHECK(!owner->result_ok);
7373 return DecodeError_clone(&*owner->contents.err);
7375 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
7376 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7377 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7378 *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
7379 uint64_t ret_ref = tag_ptr(ret_copy, true);
7383 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7384 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
7385 ret.is_owned = false;
7388 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7389 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7390 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7391 uint64_t ret_ref = 0;
7392 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7393 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7397 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7398 CHECK(!owner->result_ok);
7399 return DecodeError_clone(&*owner->contents.err);
7401 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7402 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7403 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7404 *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7405 uint64_t ret_ref = tag_ptr(ret_copy, true);
7409 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7410 LDKChannelAnnouncement ret = *owner->contents.result;
7411 ret.is_owned = false;
7414 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7415 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7416 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7417 uint64_t ret_ref = 0;
7418 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7419 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7423 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7424 CHECK(!owner->result_ok);
7425 return DecodeError_clone(&*owner->contents.err);
7427 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7428 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7429 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7430 *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7431 uint64_t ret_ref = tag_ptr(ret_copy, true);
7435 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7436 LDKUnsignedChannelUpdate ret = *owner->contents.result;
7437 ret.is_owned = false;
7440 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7441 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7442 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7443 uint64_t ret_ref = 0;
7444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7449 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7450 CHECK(!owner->result_ok);
7451 return DecodeError_clone(&*owner->contents.err);
7453 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7454 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7455 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7456 *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
7457 uint64_t ret_ref = tag_ptr(ret_copy, true);
7461 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7462 LDKChannelUpdate ret = *owner->contents.result;
7463 ret.is_owned = false;
7466 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7467 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7468 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7469 uint64_t ret_ref = 0;
7470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7475 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7476 CHECK(!owner->result_ok);
7477 return DecodeError_clone(&*owner->contents.err);
7479 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7480 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7481 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7482 *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
7483 uint64_t ret_ref = tag_ptr(ret_copy, true);
7487 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7488 LDKErrorMessage ret = *owner->contents.result;
7489 ret.is_owned = false;
7492 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint64_t owner) {
7493 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7494 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
7495 uint64_t ret_ref = 0;
7496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7501 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7502 CHECK(!owner->result_ok);
7503 return DecodeError_clone(&*owner->contents.err);
7505 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
7506 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7507 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7508 *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
7509 uint64_t ret_ref = tag_ptr(ret_copy, true);
7513 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7514 LDKWarningMessage ret = *owner->contents.result;
7515 ret.is_owned = false;
7518 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ok"))) TS_CResult_WarningMessageDecodeErrorZ_get_ok(uint64_t owner) {
7519 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7520 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
7521 uint64_t ret_ref = 0;
7522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7527 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7528 CHECK(!owner->result_ok);
7529 return DecodeError_clone(&*owner->contents.err);
7531 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
7532 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7533 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7534 *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
7535 uint64_t ret_ref = tag_ptr(ret_copy, true);
7539 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7540 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
7541 ret.is_owned = false;
7544 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7545 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7546 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7547 uint64_t ret_ref = 0;
7548 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7549 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7553 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7554 CHECK(!owner->result_ok);
7555 return DecodeError_clone(&*owner->contents.err);
7557 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7558 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7559 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7560 *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7561 uint64_t ret_ref = tag_ptr(ret_copy, true);
7565 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7566 LDKNodeAnnouncement ret = *owner->contents.result;
7567 ret.is_owned = false;
7570 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7571 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7572 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7573 uint64_t ret_ref = 0;
7574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7579 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7580 CHECK(!owner->result_ok);
7581 return DecodeError_clone(&*owner->contents.err);
7583 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7584 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7585 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7586 *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7587 uint64_t ret_ref = tag_ptr(ret_copy, true);
7591 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7592 LDKQueryShortChannelIds ret = *owner->contents.result;
7593 ret.is_owned = false;
7596 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint64_t owner) {
7597 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7598 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
7599 uint64_t ret_ref = 0;
7600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7605 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7606 CHECK(!owner->result_ok);
7607 return DecodeError_clone(&*owner->contents.err);
7609 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
7610 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7611 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7612 *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
7613 uint64_t ret_ref = tag_ptr(ret_copy, true);
7617 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7618 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
7619 ret.is_owned = false;
7622 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint64_t owner) {
7623 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7624 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
7625 uint64_t ret_ref = 0;
7626 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7627 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7631 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7632 CHECK(!owner->result_ok);
7633 return DecodeError_clone(&*owner->contents.err);
7635 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
7636 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7637 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7638 *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
7639 uint64_t ret_ref = tag_ptr(ret_copy, true);
7643 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7644 LDKQueryChannelRange ret = *owner->contents.result;
7645 ret.is_owned = false;
7648 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7649 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7650 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
7651 uint64_t ret_ref = 0;
7652 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7653 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7657 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7658 CHECK(!owner->result_ok);
7659 return DecodeError_clone(&*owner->contents.err);
7661 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7662 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7663 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7664 *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
7665 uint64_t ret_ref = tag_ptr(ret_copy, true);
7669 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7670 LDKReplyChannelRange ret = *owner->contents.result;
7671 ret.is_owned = false;
7674 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7675 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7676 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
7677 uint64_t ret_ref = 0;
7678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7683 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7684 CHECK(!owner->result_ok);
7685 return DecodeError_clone(&*owner->contents.err);
7687 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7688 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7689 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7690 *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
7691 uint64_t ret_ref = tag_ptr(ret_copy, true);
7695 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7696 LDKGossipTimestampFilter ret = *owner->contents.result;
7697 ret.is_owned = false;
7700 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint64_t owner) {
7701 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7702 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
7703 uint64_t ret_ref = 0;
7704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7709 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7710 CHECK(!owner->result_ok);
7711 return DecodeError_clone(&*owner->contents.err);
7713 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
7714 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7715 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7716 *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
7717 uint64_t ret_ref = tag_ptr(ret_copy, true);
7721 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
7722 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7724 case LDKSignOrCreationError_SignError: return 0;
7725 case LDKSignOrCreationError_CreationError: return 1;
7729 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) {
7730 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7731 assert(obj->tag == LDKSignOrCreationError_CreationError);
7732 uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error);
7733 return creation_error_conv;
7735 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7736 LDKInvoice ret = *owner->contents.result;
7737 ret.is_owned = false;
7740 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) {
7741 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7742 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
7743 uint64_t ret_ref = 0;
7744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7749 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7750 CHECK(!owner->result_ok);
7751 return SignOrCreationError_clone(&*owner->contents.err);
7753 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) {
7754 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7755 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
7756 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
7757 uint64_t ret_ref = tag_ptr(ret_copy, true);
7761 typedef struct LDKFilter_JCalls {
7762 atomic_size_t refcnt;
7763 uint32_t instance_ptr;
7765 static void LDKFilter_JCalls_free(void* this_arg) {
7766 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7767 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7771 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
7772 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7773 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
7774 memcpy(txid_arr->elems, *txid, 32);
7775 LDKu8slice script_pubkey_var = script_pubkey;
7776 int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
7777 memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
7778 js_invoke_function_uuuuuu(j_calls->instance_ptr, 37, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
7780 void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
7781 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7782 LDKWatchedOutput output_var = output;
7783 uint64_t output_ref = 0;
7784 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
7785 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
7786 js_invoke_function_buuuuu(j_calls->instance_ptr, 38, output_ref, 0, 0, 0, 0, 0);
7788 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
7789 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
7790 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7792 static inline LDKFilter LDKFilter_init (JSValue o) {
7793 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
7794 atomic_init(&calls->refcnt, 1);
7795 calls->instance_ptr = o;
7798 .this_arg = (void*) calls,
7799 .register_tx = register_tx_LDKFilter_jcall,
7800 .register_output = register_output_LDKFilter_jcall,
7801 .free = LDKFilter_JCalls_free,
7805 uint64_t __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue o) {
7806 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
7807 *res_ptr = LDKFilter_init(o);
7808 return tag_ptr(res_ptr, true);
7810 void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
7811 void* this_arg_ptr = untag_ptr(this_arg);
7812 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7813 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7814 unsigned char txid_arr[32];
7815 CHECK(txid->arr_len == 32);
7816 memcpy(txid_arr, txid->elems, 32); FREE(txid);
7817 unsigned char (*txid_ref)[32] = &txid_arr;
7818 LDKu8slice script_pubkey_ref;
7819 script_pubkey_ref.datalen = script_pubkey->arr_len;
7820 script_pubkey_ref.data = script_pubkey->elems;
7821 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
7822 FREE(script_pubkey);
7825 void __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
7826 void* this_arg_ptr = untag_ptr(this_arg);
7827 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7828 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7829 LDKWatchedOutput output_conv;
7830 output_conv.inner = untag_ptr(output);
7831 output_conv.is_owned = ptr_is_owned(output);
7832 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
7833 output_conv = WatchedOutput_clone(&output_conv);
7834 (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
7837 uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
7838 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7840 case LDKCOption_FilterZ_Some: return 0;
7841 case LDKCOption_FilterZ_None: return 1;
7845 uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_LDKCOption_FilterZ_Some_get_some(uint64_t ptr) {
7846 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7847 assert(obj->tag == LDKCOption_FilterZ_Some);
7848 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
7849 *some_ret = obj->some;
7850 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
7851 if ((*some_ret).free == LDKFilter_JCalls_free) {
7852 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7853 LDKFilter_JCalls_cloned(&(*some_ret));
7855 return tag_ptr(some_ret, true);
7857 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7858 LDKLockedChannelMonitor ret = *owner->contents.result;
7859 ret.is_owned = false;
7862 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) {
7863 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7864 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
7865 uint64_t ret_ref = 0;
7866 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7867 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7871 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7872 CHECK(!owner->result_ok);
7873 return *owner->contents.err;
7875 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) {
7876 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7877 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
7880 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
7881 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
7882 for (size_t i = 0; i < ret.datalen; i++) {
7883 ret.data[i] = OutPoint_clone(&orig->data[i]);
7887 typedef struct LDKMessageSendEventsProvider_JCalls {
7888 atomic_size_t refcnt;
7889 uint32_t instance_ptr;
7890 } LDKMessageSendEventsProvider_JCalls;
7891 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
7892 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7893 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7897 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
7898 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7899 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, 0, 0, 0, 0, 0, 0);
7900 LDKCVec_MessageSendEventZ ret_constr;
7901 ret_constr.datalen = ret->arr_len;
7902 if (ret_constr.datalen > 0)
7903 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
7905 ret_constr.data = NULL;
7906 uint64_t* ret_vals = ret->elems;
7907 for (size_t s = 0; s < ret_constr.datalen; s++) {
7908 uint64_t ret_conv_18 = ret_vals[s];
7909 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
7910 CHECK_ACCESS(ret_conv_18_ptr);
7911 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
7912 FREE(untag_ptr(ret_conv_18));
7913 ret_constr.data[s] = ret_conv_18_conv;
7918 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
7919 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
7920 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7922 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) {
7923 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
7924 atomic_init(&calls->refcnt, 1);
7925 calls->instance_ptr = o;
7927 LDKMessageSendEventsProvider ret = {
7928 .this_arg = (void*) calls,
7929 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
7930 .free = LDKMessageSendEventsProvider_JCalls_free,
7934 uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) {
7935 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
7936 *res_ptr = LDKMessageSendEventsProvider_init(o);
7937 return tag_ptr(res_ptr, true);
7939 uint64_tArray __attribute__((export_name("TS_MessageSendEventsProvider_get_and_clear_pending_msg_events"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint64_t this_arg) {
7940 void* this_arg_ptr = untag_ptr(this_arg);
7941 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7942 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
7943 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
7944 uint64_tArray ret_arr = NULL;
7945 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
7946 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
7947 for (size_t s = 0; s < ret_var.datalen; s++) {
7948 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
7949 *ret_conv_18_copy = ret_var.data[s];
7950 uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
7951 ret_arr_ptr[s] = ret_conv_18_ref;
7958 typedef struct LDKOnionMessageProvider_JCalls {
7959 atomic_size_t refcnt;
7960 uint32_t instance_ptr;
7961 } LDKOnionMessageProvider_JCalls;
7962 static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
7963 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
7964 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7968 LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
7969 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
7970 int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
7971 memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
7972 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 40, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0);
7973 LDKOnionMessage ret_conv;
7974 ret_conv.inner = untag_ptr(ret);
7975 ret_conv.is_owned = ptr_is_owned(ret);
7976 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
7979 static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
7980 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
7981 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7983 static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JSValue o) {
7984 LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
7985 atomic_init(&calls->refcnt, 1);
7986 calls->instance_ptr = o;
7988 LDKOnionMessageProvider ret = {
7989 .this_arg = (void*) calls,
7990 .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
7991 .free = LDKOnionMessageProvider_JCalls_free,
7995 uint64_t __attribute__((export_name("TS_LDKOnionMessageProvider_new"))) TS_LDKOnionMessageProvider_new(JSValue o) {
7996 LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
7997 *res_ptr = LDKOnionMessageProvider_init(o);
7998 return tag_ptr(res_ptr, true);
8000 uint64_t __attribute__((export_name("TS_OnionMessageProvider_next_onion_message_for_peer"))) TS_OnionMessageProvider_next_onion_message_for_peer(uint64_t this_arg, int8_tArray peer_node_id) {
8001 void* this_arg_ptr = untag_ptr(this_arg);
8002 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8003 LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
8004 LDKPublicKey peer_node_id_ref;
8005 CHECK(peer_node_id->arr_len == 33);
8006 memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
8007 LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
8008 uint64_t ret_ref = 0;
8009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8014 typedef struct LDKEventHandler_JCalls {
8015 atomic_size_t refcnt;
8016 uint32_t instance_ptr;
8017 } LDKEventHandler_JCalls;
8018 static void LDKEventHandler_JCalls_free(void* this_arg) {
8019 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
8020 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8024 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
8025 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
8026 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
8027 *ret_event = Event_clone(event);
8028 uint64_t ref_event = tag_ptr(ret_event, true);
8029 js_invoke_function_buuuuu(j_calls->instance_ptr, 41, ref_event, 0, 0, 0, 0, 0);
8031 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
8032 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
8033 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8035 static inline LDKEventHandler LDKEventHandler_init (JSValue o) {
8036 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
8037 atomic_init(&calls->refcnt, 1);
8038 calls->instance_ptr = o;
8040 LDKEventHandler ret = {
8041 .this_arg = (void*) calls,
8042 .handle_event = handle_event_LDKEventHandler_jcall,
8043 .free = LDKEventHandler_JCalls_free,
8047 uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) {
8048 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
8049 *res_ptr = LDKEventHandler_init(o);
8050 return tag_ptr(res_ptr, true);
8052 void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) {
8053 void* this_arg_ptr = untag_ptr(this_arg);
8054 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8055 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
8056 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
8057 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
8060 typedef struct LDKEventsProvider_JCalls {
8061 atomic_size_t refcnt;
8062 uint32_t instance_ptr;
8063 } LDKEventsProvider_JCalls;
8064 static void LDKEventsProvider_JCalls_free(void* this_arg) {
8065 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
8066 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8070 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
8071 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
8072 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
8073 *handler_ret = handler;
8074 js_invoke_function_buuuuu(j_calls->instance_ptr, 42, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
8076 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
8077 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
8078 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8080 static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) {
8081 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
8082 atomic_init(&calls->refcnt, 1);
8083 calls->instance_ptr = o;
8085 LDKEventsProvider ret = {
8086 .this_arg = (void*) calls,
8087 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
8088 .free = LDKEventsProvider_JCalls_free,
8092 uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) {
8093 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
8094 *res_ptr = LDKEventsProvider_init(o);
8095 return tag_ptr(res_ptr, true);
8097 void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) {
8098 void* this_arg_ptr = untag_ptr(this_arg);
8099 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8100 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
8101 void* handler_ptr = untag_ptr(handler);
8102 CHECK_ACCESS(handler_ptr);
8103 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
8104 if (handler_conv.free == LDKEventHandler_JCalls_free) {
8105 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8106 LDKEventHandler_JCalls_cloned(&handler_conv);
8108 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
8111 typedef struct LDKScore_JCalls {
8112 atomic_size_t refcnt;
8113 uint32_t instance_ptr;
8115 static void LDKScore_JCalls_free(void* this_arg) {
8116 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8117 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8121 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
8122 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8123 int64_t short_channel_id_conv = short_channel_id;
8124 LDKNodeId source_var = *source;
8125 uint64_t source_ref = 0;
8126 source_var = NodeId_clone(&source_var);
8127 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
8128 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
8129 LDKNodeId target_var = *target;
8130 uint64_t target_ref = 0;
8131 target_var = NodeId_clone(&target_var);
8132 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
8133 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
8134 LDKChannelUsage usage_var = usage;
8135 uint64_t usage_ref = 0;
8136 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
8137 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
8138 return js_invoke_function_bbbbuu(j_calls->instance_ptr, 43, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
8140 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
8141 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8142 LDKCVec_RouteHopZ path_var = path;
8143 uint64_tArray path_arr = NULL;
8144 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8145 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8146 for (size_t k = 0; k < path_var.datalen; k++) {
8147 LDKRouteHop path_conv_10_var = path_var.data[k];
8148 uint64_t path_conv_10_ref = 0;
8149 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8150 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8151 path_arr_ptr[k] = path_conv_10_ref;
8154 FREE(path_var.data);
8155 int64_t short_channel_id_conv = short_channel_id;
8156 js_invoke_function_ubuuuu(j_calls->instance_ptr, 44, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
8158 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
8159 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8160 LDKCVec_RouteHopZ path_var = path;
8161 uint64_tArray path_arr = NULL;
8162 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8163 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8164 for (size_t k = 0; k < path_var.datalen; k++) {
8165 LDKRouteHop path_conv_10_var = path_var.data[k];
8166 uint64_t path_conv_10_ref = 0;
8167 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8168 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8169 path_arr_ptr[k] = path_conv_10_ref;
8172 FREE(path_var.data);
8173 js_invoke_function_uuuuuu(j_calls->instance_ptr, 45, (uint32_t)path_arr, 0, 0, 0, 0, 0);
8175 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
8176 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8177 LDKCVec_RouteHopZ path_var = path;
8178 uint64_tArray path_arr = NULL;
8179 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8180 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8181 for (size_t k = 0; k < path_var.datalen; k++) {
8182 LDKRouteHop path_conv_10_var = path_var.data[k];
8183 uint64_t path_conv_10_ref = 0;
8184 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8185 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8186 path_arr_ptr[k] = path_conv_10_ref;
8189 FREE(path_var.data);
8190 int64_t short_channel_id_conv = short_channel_id;
8191 js_invoke_function_ubuuuu(j_calls->instance_ptr, 46, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
8193 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
8194 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8195 LDKCVec_RouteHopZ path_var = path;
8196 uint64_tArray path_arr = NULL;
8197 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8198 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8199 for (size_t k = 0; k < path_var.datalen; k++) {
8200 LDKRouteHop path_conv_10_var = path_var.data[k];
8201 uint64_t path_conv_10_ref = 0;
8202 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8203 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8204 path_arr_ptr[k] = path_conv_10_ref;
8207 FREE(path_var.data);
8208 js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)path_arr, 0, 0, 0, 0, 0);
8210 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
8211 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8212 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, 0, 0, 0, 0, 0, 0);
8213 LDKCVec_u8Z ret_ref;
8214 ret_ref.datalen = ret->arr_len;
8215 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8216 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
8219 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
8220 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
8221 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8223 static inline LDKScore LDKScore_init (JSValue o) {
8224 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
8225 atomic_init(&calls->refcnt, 1);
8226 calls->instance_ptr = o;
8229 .this_arg = (void*) calls,
8230 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
8231 .payment_path_failed = payment_path_failed_LDKScore_jcall,
8232 .payment_path_successful = payment_path_successful_LDKScore_jcall,
8233 .probe_failed = probe_failed_LDKScore_jcall,
8234 .probe_successful = probe_successful_LDKScore_jcall,
8235 .write = write_LDKScore_jcall,
8236 .free = LDKScore_JCalls_free,
8240 uint64_t __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) {
8241 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
8242 *res_ptr = LDKScore_init(o);
8243 return tag_ptr(res_ptr, true);
8245 int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_channel_penalty_msat(uint64_t this_arg, int64_t short_channel_id, uint64_t source, uint64_t target, uint64_t usage) {
8246 void* this_arg_ptr = untag_ptr(this_arg);
8247 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8248 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8249 LDKNodeId source_conv;
8250 source_conv.inner = untag_ptr(source);
8251 source_conv.is_owned = ptr_is_owned(source);
8252 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
8253 source_conv.is_owned = false;
8254 LDKNodeId target_conv;
8255 target_conv.inner = untag_ptr(target);
8256 target_conv.is_owned = ptr_is_owned(target);
8257 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
8258 target_conv.is_owned = false;
8259 LDKChannelUsage usage_conv;
8260 usage_conv.inner = untag_ptr(usage);
8261 usage_conv.is_owned = ptr_is_owned(usage);
8262 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
8263 usage_conv = ChannelUsage_clone(&usage_conv);
8264 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
8268 void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_payment_path_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
8269 void* this_arg_ptr = untag_ptr(this_arg);
8270 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8271 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8272 LDKCVec_RouteHopZ path_constr;
8273 path_constr.datalen = path->arr_len;
8274 if (path_constr.datalen > 0)
8275 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8277 path_constr.data = NULL;
8278 uint64_t* path_vals = path->elems;
8279 for (size_t k = 0; k < path_constr.datalen; k++) {
8280 uint64_t path_conv_10 = path_vals[k];
8281 LDKRouteHop path_conv_10_conv;
8282 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8283 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8284 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8285 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8286 path_constr.data[k] = path_conv_10_conv;
8289 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
8292 void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
8293 void* this_arg_ptr = untag_ptr(this_arg);
8294 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8295 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8296 LDKCVec_RouteHopZ path_constr;
8297 path_constr.datalen = path->arr_len;
8298 if (path_constr.datalen > 0)
8299 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8301 path_constr.data = NULL;
8302 uint64_t* path_vals = path->elems;
8303 for (size_t k = 0; k < path_constr.datalen; k++) {
8304 uint64_t path_conv_10 = path_vals[k];
8305 LDKRouteHop path_conv_10_conv;
8306 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8307 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8308 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8309 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8310 path_constr.data[k] = path_conv_10_conv;
8313 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
8316 void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
8317 void* this_arg_ptr = untag_ptr(this_arg);
8318 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8319 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8320 LDKCVec_RouteHopZ path_constr;
8321 path_constr.datalen = path->arr_len;
8322 if (path_constr.datalen > 0)
8323 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8325 path_constr.data = NULL;
8326 uint64_t* path_vals = path->elems;
8327 for (size_t k = 0; k < path_constr.datalen; k++) {
8328 uint64_t path_conv_10 = path_vals[k];
8329 LDKRouteHop path_conv_10_conv;
8330 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8331 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8332 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8333 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8334 path_constr.data[k] = path_conv_10_conv;
8337 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
8340 void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) {
8341 void* this_arg_ptr = untag_ptr(this_arg);
8342 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8343 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8344 LDKCVec_RouteHopZ path_constr;
8345 path_constr.datalen = path->arr_len;
8346 if (path_constr.datalen > 0)
8347 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8349 path_constr.data = NULL;
8350 uint64_t* path_vals = path->elems;
8351 for (size_t k = 0; k < path_constr.datalen; k++) {
8352 uint64_t path_conv_10 = path_vals[k];
8353 LDKRouteHop path_conv_10_conv;
8354 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8355 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8356 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8357 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8358 path_constr.data[k] = path_conv_10_conv;
8361 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
8364 int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) {
8365 void* this_arg_ptr = untag_ptr(this_arg);
8366 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8367 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8368 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8369 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8370 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8371 CVec_u8Z_free(ret_var);
8375 typedef struct LDKLockableScore_JCalls {
8376 atomic_size_t refcnt;
8377 uint32_t instance_ptr;
8378 } LDKLockableScore_JCalls;
8379 static void LDKLockableScore_JCalls_free(void* this_arg) {
8380 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
8381 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8385 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
8386 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
8387 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, 0, 0, 0, 0, 0, 0);
8388 void* ret_ptr = untag_ptr(ret);
8389 CHECK_ACCESS(ret_ptr);
8390 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
8391 if (ret_conv.free == LDKScore_JCalls_free) {
8392 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8393 LDKScore_JCalls_cloned(&ret_conv);
8394 }// WARNING: we may need a move here but no clone is available for LDKScore
8398 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
8399 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
8400 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8402 static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
8403 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
8404 atomic_init(&calls->refcnt, 1);
8405 calls->instance_ptr = o;
8407 LDKLockableScore ret = {
8408 .this_arg = (void*) calls,
8409 .lock = lock_LDKLockableScore_jcall,
8410 .free = LDKLockableScore_JCalls_free,
8414 uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
8415 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
8416 *res_ptr = LDKLockableScore_init(o);
8417 return tag_ptr(res_ptr, true);
8419 uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
8420 void* this_arg_ptr = untag_ptr(this_arg);
8421 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8422 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
8423 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
8424 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
8425 return tag_ptr(ret_ret, true);
8428 typedef struct LDKWriteableScore_JCalls {
8429 atomic_size_t refcnt;
8430 uint32_t instance_ptr;
8431 LDKLockableScore_JCalls* LockableScore;
8432 } LDKWriteableScore_JCalls;
8433 static void LDKWriteableScore_JCalls_free(void* this_arg) {
8434 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
8435 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8439 LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
8440 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
8441 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, 0, 0, 0, 0, 0, 0);
8442 LDKCVec_u8Z ret_ref;
8443 ret_ref.datalen = ret->arr_len;
8444 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8445 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
8448 static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
8449 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
8450 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8451 atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
8453 static inline LDKWriteableScore LDKWriteableScore_init (JSValue o, JSValue LockableScore) {
8454 LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
8455 atomic_init(&calls->refcnt, 1);
8456 calls->instance_ptr = o;
8458 LDKWriteableScore ret = {
8459 .this_arg = (void*) calls,
8460 .write = write_LDKWriteableScore_jcall,
8461 .free = LDKWriteableScore_JCalls_free,
8462 .LockableScore = LDKLockableScore_init(LockableScore),
8464 calls->LockableScore = ret.LockableScore.this_arg;
8467 uint64_t __attribute__((export_name("TS_LDKWriteableScore_new"))) TS_LDKWriteableScore_new(JSValue o, JSValue LockableScore) {
8468 LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
8469 *res_ptr = LDKWriteableScore_init(o, LockableScore);
8470 return tag_ptr(res_ptr, true);
8472 int8_tArray __attribute__((export_name("TS_WriteableScore_write"))) TS_WriteableScore_write(uint64_t this_arg) {
8473 void* this_arg_ptr = untag_ptr(this_arg);
8474 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8475 LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
8476 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8477 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8478 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8479 CVec_u8Z_free(ret_var);
8483 typedef struct LDKPersister_JCalls {
8484 atomic_size_t refcnt;
8485 uint32_t instance_ptr;
8486 } LDKPersister_JCalls;
8487 static void LDKPersister_JCalls_free(void* this_arg) {
8488 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8489 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8493 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
8494 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8495 LDKChannelManager channel_manager_var = *channel_manager;
8496 uint64_t channel_manager_ref = 0;
8497 // WARNING: we may need a move here but no clone is available for LDKChannelManager
8498 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
8499 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
8500 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 51, channel_manager_ref, 0, 0, 0, 0, 0);
8501 void* ret_ptr = untag_ptr(ret);
8502 CHECK_ACCESS(ret_ptr);
8503 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8504 FREE(untag_ptr(ret));
8507 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
8508 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8509 LDKNetworkGraph network_graph_var = *network_graph;
8510 uint64_t network_graph_ref = 0;
8511 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
8512 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
8513 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
8514 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 52, network_graph_ref, 0, 0, 0, 0, 0);
8515 void* ret_ptr = untag_ptr(ret);
8516 CHECK_ACCESS(ret_ptr);
8517 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8518 FREE(untag_ptr(ret));
8521 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
8522 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8523 // WARNING: This object doesn't live past this scope, needs clone!
8524 uint64_t ret_scorer = tag_ptr(scorer, false);
8525 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 53, ret_scorer, 0, 0, 0, 0, 0);
8526 void* ret_ptr = untag_ptr(ret);
8527 CHECK_ACCESS(ret_ptr);
8528 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8529 FREE(untag_ptr(ret));
8532 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
8533 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
8534 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8536 static inline LDKPersister LDKPersister_init (JSValue o) {
8537 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
8538 atomic_init(&calls->refcnt, 1);
8539 calls->instance_ptr = o;
8541 LDKPersister ret = {
8542 .this_arg = (void*) calls,
8543 .persist_manager = persist_manager_LDKPersister_jcall,
8544 .persist_graph = persist_graph_LDKPersister_jcall,
8545 .persist_scorer = persist_scorer_LDKPersister_jcall,
8546 .free = LDKPersister_JCalls_free,
8550 uint64_t __attribute__((export_name("TS_LDKPersister_new"))) TS_LDKPersister_new(JSValue o) {
8551 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
8552 *res_ptr = LDKPersister_init(o);
8553 return tag_ptr(res_ptr, true);
8555 uint64_t __attribute__((export_name("TS_Persister_persist_manager"))) TS_Persister_persist_manager(uint64_t this_arg, uint64_t channel_manager) {
8556 void* this_arg_ptr = untag_ptr(this_arg);
8557 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8558 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8559 LDKChannelManager channel_manager_conv;
8560 channel_manager_conv.inner = untag_ptr(channel_manager);
8561 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
8562 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
8563 channel_manager_conv.is_owned = false;
8564 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8565 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
8566 return tag_ptr(ret_conv, true);
8569 uint64_t __attribute__((export_name("TS_Persister_persist_graph"))) TS_Persister_persist_graph(uint64_t this_arg, uint64_t network_graph) {
8570 void* this_arg_ptr = untag_ptr(this_arg);
8571 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8572 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8573 LDKNetworkGraph network_graph_conv;
8574 network_graph_conv.inner = untag_ptr(network_graph);
8575 network_graph_conv.is_owned = ptr_is_owned(network_graph);
8576 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
8577 network_graph_conv.is_owned = false;
8578 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8579 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
8580 return tag_ptr(ret_conv, true);
8583 uint64_t __attribute__((export_name("TS_Persister_persist_scorer"))) TS_Persister_persist_scorer(uint64_t this_arg, uint64_t scorer) {
8584 void* this_arg_ptr = untag_ptr(this_arg);
8585 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8586 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8587 void* scorer_ptr = untag_ptr(scorer);
8588 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
8589 LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
8590 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8591 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
8592 return tag_ptr(ret_conv, true);
8595 typedef struct LDKFutureCallback_JCalls {
8596 atomic_size_t refcnt;
8597 uint32_t instance_ptr;
8598 } LDKFutureCallback_JCalls;
8599 static void LDKFutureCallback_JCalls_free(void* this_arg) {
8600 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
8601 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8605 void call_LDKFutureCallback_jcall(const void* this_arg) {
8606 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
8607 js_invoke_function_uuuuuu(j_calls->instance_ptr, 54, 0, 0, 0, 0, 0, 0);
8609 static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
8610 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
8611 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8613 static inline LDKFutureCallback LDKFutureCallback_init (JSValue o) {
8614 LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
8615 atomic_init(&calls->refcnt, 1);
8616 calls->instance_ptr = o;
8618 LDKFutureCallback ret = {
8619 .this_arg = (void*) calls,
8620 .call = call_LDKFutureCallback_jcall,
8621 .free = LDKFutureCallback_JCalls_free,
8625 uint64_t __attribute__((export_name("TS_LDKFutureCallback_new"))) TS_LDKFutureCallback_new(JSValue o) {
8626 LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
8627 *res_ptr = LDKFutureCallback_init(o);
8628 return tag_ptr(res_ptr, true);
8630 void __attribute__((export_name("TS_FutureCallback_call"))) TS_FutureCallback_call(uint64_t this_arg) {
8631 void* this_arg_ptr = untag_ptr(this_arg);
8632 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8633 LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
8634 (this_arg_conv->call)(this_arg_conv->this_arg);
8637 typedef struct LDKListen_JCalls {
8638 atomic_size_t refcnt;
8639 uint32_t instance_ptr;
8641 static void LDKListen_JCalls_free(void* this_arg) {
8642 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8643 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8647 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8648 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8649 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8650 memcpy(header_arr->elems, *header, 80);
8651 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8652 uint64_tArray txdata_arr = NULL;
8653 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8654 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8655 for (size_t c = 0; c < txdata_var.datalen; c++) {
8656 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8657 *txdata_conv_28_conv = txdata_var.data[c];
8658 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8661 FREE(txdata_var.data);
8662 int32_t height_conv = height;
8663 js_invoke_function_uuuuuu(j_calls->instance_ptr, 55, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8665 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
8666 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8667 LDKu8slice block_var = block;
8668 int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
8669 memcpy(block_arr->elems, block_var.data, block_var.datalen);
8670 int32_t height_conv = height;
8671 js_invoke_function_uuuuuu(j_calls->instance_ptr, 56, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
8673 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8674 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8675 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8676 memcpy(header_arr->elems, *header, 80);
8677 int32_t height_conv = height;
8678 js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8680 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
8681 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
8682 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8684 static inline LDKListen LDKListen_init (JSValue o) {
8685 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
8686 atomic_init(&calls->refcnt, 1);
8687 calls->instance_ptr = o;
8690 .this_arg = (void*) calls,
8691 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
8692 .block_connected = block_connected_LDKListen_jcall,
8693 .block_disconnected = block_disconnected_LDKListen_jcall,
8694 .free = LDKListen_JCalls_free,
8698 uint64_t __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue o) {
8699 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
8700 *res_ptr = LDKListen_init(o);
8701 return tag_ptr(res_ptr, true);
8703 void __attribute__((export_name("TS_Listen_filtered_block_connected"))) TS_Listen_filtered_block_connected(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height) {
8704 void* this_arg_ptr = untag_ptr(this_arg);
8705 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8706 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8707 unsigned char header_arr[80];
8708 CHECK(header->arr_len == 80);
8709 memcpy(header_arr, header->elems, 80); FREE(header);
8710 unsigned char (*header_ref)[80] = &header_arr;
8711 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8712 txdata_constr.datalen = txdata->arr_len;
8713 if (txdata_constr.datalen > 0)
8714 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8716 txdata_constr.data = NULL;
8717 uint64_t* txdata_vals = txdata->elems;
8718 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8719 uint64_t txdata_conv_28 = txdata_vals[c];
8720 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8721 CHECK_ACCESS(txdata_conv_28_ptr);
8722 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8723 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8724 txdata_constr.data[c] = txdata_conv_28_conv;
8727 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8730 void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint64_t this_arg, int8_tArray block, int32_t height) {
8731 void* this_arg_ptr = untag_ptr(this_arg);
8732 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8733 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8734 LDKu8slice block_ref;
8735 block_ref.datalen = block->arr_len;
8736 block_ref.data = block->elems;
8737 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
8741 void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height) {
8742 void* this_arg_ptr = untag_ptr(this_arg);
8743 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8744 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8745 unsigned char header_arr[80];
8746 CHECK(header->arr_len == 80);
8747 memcpy(header_arr, header->elems, 80); FREE(header);
8748 unsigned char (*header_ref)[80] = &header_arr;
8749 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
8752 typedef struct LDKConfirm_JCalls {
8753 atomic_size_t refcnt;
8754 uint32_t instance_ptr;
8755 } LDKConfirm_JCalls;
8756 static void LDKConfirm_JCalls_free(void* this_arg) {
8757 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8758 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8762 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8763 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8764 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8765 memcpy(header_arr->elems, *header, 80);
8766 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8767 uint64_tArray txdata_arr = NULL;
8768 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8769 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8770 for (size_t c = 0; c < txdata_var.datalen; c++) {
8771 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8772 *txdata_conv_28_conv = txdata_var.data[c];
8773 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8776 FREE(txdata_var.data);
8777 int32_t height_conv = height;
8778 js_invoke_function_uuuuuu(j_calls->instance_ptr, 58, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8780 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
8781 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8782 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
8783 memcpy(txid_arr->elems, *txid, 32);
8784 js_invoke_function_uuuuuu(j_calls->instance_ptr, 59, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
8786 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8787 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8788 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8789 memcpy(header_arr->elems, *header, 80);
8790 int32_t height_conv = height;
8791 js_invoke_function_uuuuuu(j_calls->instance_ptr, 60, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8793 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
8794 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8795 ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 61, 0, 0, 0, 0, 0, 0);
8796 LDKCVec_TxidZ ret_constr;
8797 ret_constr.datalen = ret->arr_len;
8798 if (ret_constr.datalen > 0)
8799 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
8801 ret_constr.data = NULL;
8802 int8_tArray* ret_vals = (void*) ret->elems;
8803 for (size_t m = 0; m < ret_constr.datalen; m++) {
8804 int8_tArray ret_conv_12 = ret_vals[m];
8805 LDKThirtyTwoBytes ret_conv_12_ref;
8806 CHECK(ret_conv_12->arr_len == 32);
8807 memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
8808 ret_constr.data[m] = ret_conv_12_ref;
8813 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
8814 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
8815 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8817 static inline LDKConfirm LDKConfirm_init (JSValue o) {
8818 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
8819 atomic_init(&calls->refcnt, 1);
8820 calls->instance_ptr = o;
8823 .this_arg = (void*) calls,
8824 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
8825 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
8826 .best_block_updated = best_block_updated_LDKConfirm_jcall,
8827 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
8828 .free = LDKConfirm_JCalls_free,
8832 uint64_t __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValue o) {
8833 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
8834 *res_ptr = LDKConfirm_init(o);
8835 return tag_ptr(res_ptr, true);
8837 void __attribute__((export_name("TS_Confirm_transactions_confirmed"))) TS_Confirm_transactions_confirmed(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height) {
8838 void* this_arg_ptr = untag_ptr(this_arg);
8839 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8840 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8841 unsigned char header_arr[80];
8842 CHECK(header->arr_len == 80);
8843 memcpy(header_arr, header->elems, 80); FREE(header);
8844 unsigned char (*header_ref)[80] = &header_arr;
8845 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8846 txdata_constr.datalen = txdata->arr_len;
8847 if (txdata_constr.datalen > 0)
8848 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8850 txdata_constr.data = NULL;
8851 uint64_t* txdata_vals = txdata->elems;
8852 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8853 uint64_t txdata_conv_28 = txdata_vals[c];
8854 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8855 CHECK_ACCESS(txdata_conv_28_ptr);
8856 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8857 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8858 txdata_constr.data[c] = txdata_conv_28_conv;
8861 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8864 void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid) {
8865 void* this_arg_ptr = untag_ptr(this_arg);
8866 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8867 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8868 unsigned char txid_arr[32];
8869 CHECK(txid->arr_len == 32);
8870 memcpy(txid_arr, txid->elems, 32); FREE(txid);
8871 unsigned char (*txid_ref)[32] = &txid_arr;
8872 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
8875 void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height) {
8876 void* this_arg_ptr = untag_ptr(this_arg);
8877 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8878 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8879 unsigned char header_arr[80];
8880 CHECK(header->arr_len == 80);
8881 memcpy(header_arr, header->elems, 80); FREE(header);
8882 unsigned char (*header_ref)[80] = &header_arr;
8883 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
8886 ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
8887 void* this_arg_ptr = untag_ptr(this_arg);
8888 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8889 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8890 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
8891 ptrArray ret_arr = NULL;
8892 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
8893 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
8894 for (size_t m = 0; m < ret_var.datalen; m++) {
8895 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
8896 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
8897 ret_arr_ptr[m] = ret_conv_12_arr;
8904 typedef struct LDKPersist_JCalls {
8905 atomic_size_t refcnt;
8906 uint32_t instance_ptr;
8907 } LDKPersist_JCalls;
8908 static void LDKPersist_JCalls_free(void* this_arg) {
8909 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8910 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8914 LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8915 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8916 LDKOutPoint channel_id_var = channel_id;
8917 uint64_t channel_id_ref = 0;
8918 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8919 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8920 LDKChannelMonitor data_var = *data;
8921 uint64_t data_ref = 0;
8922 data_var = ChannelMonitor_clone(&data_var);
8923 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8924 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8925 LDKMonitorUpdateId update_id_var = update_id;
8926 uint64_t update_id_ref = 0;
8927 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8928 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8929 uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 62, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
8930 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
8933 LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8934 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8935 LDKOutPoint channel_id_var = channel_id;
8936 uint64_t channel_id_ref = 0;
8937 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8938 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8939 LDKChannelMonitorUpdate update_var = *update;
8940 uint64_t update_ref = 0;
8941 update_var = ChannelMonitorUpdate_clone(&update_var);
8942 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
8943 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
8944 LDKChannelMonitor data_var = *data;
8945 uint64_t data_ref = 0;
8946 data_var = ChannelMonitor_clone(&data_var);
8947 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8948 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8949 LDKMonitorUpdateId update_id_var = update_id;
8950 uint64_t update_id_ref = 0;
8951 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8952 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8953 uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 63, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
8954 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
8957 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
8958 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
8959 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8961 static inline LDKPersist LDKPersist_init (JSValue o) {
8962 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
8963 atomic_init(&calls->refcnt, 1);
8964 calls->instance_ptr = o;
8967 .this_arg = (void*) calls,
8968 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
8969 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
8970 .free = LDKPersist_JCalls_free,
8974 uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValue o) {
8975 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
8976 *res_ptr = LDKPersist_init(o);
8977 return tag_ptr(res_ptr, true);
8979 uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) {
8980 void* this_arg_ptr = untag_ptr(this_arg);
8981 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8982 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8983 LDKOutPoint channel_id_conv;
8984 channel_id_conv.inner = untag_ptr(channel_id);
8985 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8986 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8987 channel_id_conv = OutPoint_clone(&channel_id_conv);
8988 LDKChannelMonitor data_conv;
8989 data_conv.inner = untag_ptr(data);
8990 data_conv.is_owned = ptr_is_owned(data);
8991 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8992 data_conv.is_owned = false;
8993 LDKMonitorUpdateId update_id_conv;
8994 update_id_conv.inner = untag_ptr(update_id);
8995 update_id_conv.is_owned = ptr_is_owned(update_id);
8996 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8997 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8998 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
9002 uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) {
9003 void* this_arg_ptr = untag_ptr(this_arg);
9004 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9005 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
9006 LDKOutPoint channel_id_conv;
9007 channel_id_conv.inner = untag_ptr(channel_id);
9008 channel_id_conv.is_owned = ptr_is_owned(channel_id);
9009 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
9010 channel_id_conv = OutPoint_clone(&channel_id_conv);
9011 LDKChannelMonitorUpdate update_conv;
9012 update_conv.inner = untag_ptr(update);
9013 update_conv.is_owned = ptr_is_owned(update);
9014 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
9015 update_conv.is_owned = false;
9016 LDKChannelMonitor data_conv;
9017 data_conv.inner = untag_ptr(data);
9018 data_conv.is_owned = ptr_is_owned(data);
9019 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
9020 data_conv.is_owned = false;
9021 LDKMonitorUpdateId update_id_conv;
9022 update_id_conv.inner = untag_ptr(update_id);
9023 update_id_conv.is_owned = ptr_is_owned(update_id);
9024 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
9025 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
9026 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv));
9030 typedef struct LDKChannelMessageHandler_JCalls {
9031 atomic_size_t refcnt;
9032 uint32_t instance_ptr;
9033 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9034 } LDKChannelMessageHandler_JCalls;
9035 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
9036 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9037 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9041 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
9042 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9043 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9044 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9045 LDKInitFeatures their_features_var = their_features;
9046 uint64_t their_features_ref = 0;
9047 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9048 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9049 LDKOpenChannel msg_var = *msg;
9050 uint64_t msg_ref = 0;
9051 msg_var = OpenChannel_clone(&msg_var);
9052 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9053 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9054 js_invoke_function_ubbuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9056 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
9057 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9058 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9059 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9060 LDKInitFeatures their_features_var = their_features;
9061 uint64_t their_features_ref = 0;
9062 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9063 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9064 LDKAcceptChannel msg_var = *msg;
9065 uint64_t msg_ref = 0;
9066 msg_var = AcceptChannel_clone(&msg_var);
9067 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9068 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9069 js_invoke_function_ubbuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9071 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
9072 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9073 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9074 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9075 LDKFundingCreated msg_var = *msg;
9076 uint64_t msg_ref = 0;
9077 msg_var = FundingCreated_clone(&msg_var);
9078 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9079 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9080 js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9082 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
9083 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9084 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9085 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9086 LDKFundingSigned msg_var = *msg;
9087 uint64_t msg_ref = 0;
9088 msg_var = FundingSigned_clone(&msg_var);
9089 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9090 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9091 js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9093 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
9094 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9095 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9096 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9097 LDKChannelReady msg_var = *msg;
9098 uint64_t msg_ref = 0;
9099 msg_var = ChannelReady_clone(&msg_var);
9100 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9101 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9102 js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9104 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
9105 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9106 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9107 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9108 LDKInitFeatures their_features_var = *their_features;
9109 uint64_t their_features_ref = 0;
9110 their_features_var = InitFeatures_clone(&their_features_var);
9111 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9112 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9113 LDKShutdown msg_var = *msg;
9114 uint64_t msg_ref = 0;
9115 msg_var = Shutdown_clone(&msg_var);
9116 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9117 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9118 js_invoke_function_ubbuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9120 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
9121 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9122 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9123 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9124 LDKClosingSigned msg_var = *msg;
9125 uint64_t msg_ref = 0;
9126 msg_var = ClosingSigned_clone(&msg_var);
9127 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9128 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9129 js_invoke_function_ubuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9131 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
9132 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9133 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9134 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9135 LDKUpdateAddHTLC msg_var = *msg;
9136 uint64_t msg_ref = 0;
9137 msg_var = UpdateAddHTLC_clone(&msg_var);
9138 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9139 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9140 js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9142 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
9143 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9144 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9145 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9146 LDKUpdateFulfillHTLC msg_var = *msg;
9147 uint64_t msg_ref = 0;
9148 msg_var = UpdateFulfillHTLC_clone(&msg_var);
9149 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9150 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9151 js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9153 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
9154 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9155 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9156 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9157 LDKUpdateFailHTLC msg_var = *msg;
9158 uint64_t msg_ref = 0;
9159 msg_var = UpdateFailHTLC_clone(&msg_var);
9160 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9161 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9162 js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9164 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
9165 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9166 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9167 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9168 LDKUpdateFailMalformedHTLC msg_var = *msg;
9169 uint64_t msg_ref = 0;
9170 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
9171 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9172 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9173 js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9175 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
9176 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9177 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9178 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9179 LDKCommitmentSigned msg_var = *msg;
9180 uint64_t msg_ref = 0;
9181 msg_var = CommitmentSigned_clone(&msg_var);
9182 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9183 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9184 js_invoke_function_ubuuuu(j_calls->instance_ptr, 75, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9186 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
9187 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9188 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9189 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9190 LDKRevokeAndACK msg_var = *msg;
9191 uint64_t msg_ref = 0;
9192 msg_var = RevokeAndACK_clone(&msg_var);
9193 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9194 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9195 js_invoke_function_ubuuuu(j_calls->instance_ptr, 76, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9197 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
9198 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9199 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9200 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9201 LDKUpdateFee msg_var = *msg;
9202 uint64_t msg_ref = 0;
9203 msg_var = UpdateFee_clone(&msg_var);
9204 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9205 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9206 js_invoke_function_ubuuuu(j_calls->instance_ptr, 77, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9208 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
9209 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9210 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9211 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9212 LDKAnnouncementSignatures msg_var = *msg;
9213 uint64_t msg_ref = 0;
9214 msg_var = AnnouncementSignatures_clone(&msg_var);
9215 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9216 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9217 js_invoke_function_ubuuuu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9219 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
9220 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9221 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9222 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9223 jboolean no_connection_possible_conv = no_connection_possible;
9224 js_invoke_function_uuuuuu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
9226 LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
9227 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9228 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9229 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9230 LDKInit msg_var = *msg;
9231 uint64_t msg_ref = 0;
9232 msg_var = Init_clone(&msg_var);
9233 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9234 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9235 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9236 void* ret_ptr = untag_ptr(ret);
9237 CHECK_ACCESS(ret_ptr);
9238 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
9239 FREE(untag_ptr(ret));
9242 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
9243 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9244 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9245 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9246 LDKChannelReestablish msg_var = *msg;
9247 uint64_t msg_ref = 0;
9248 msg_var = ChannelReestablish_clone(&msg_var);
9249 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9250 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9251 js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9253 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
9254 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9255 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9256 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9257 LDKChannelUpdate msg_var = *msg;
9258 uint64_t msg_ref = 0;
9259 msg_var = ChannelUpdate_clone(&msg_var);
9260 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9261 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9262 js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9264 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
9265 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9266 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9267 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9268 LDKErrorMessage msg_var = *msg;
9269 uint64_t msg_ref = 0;
9270 msg_var = ErrorMessage_clone(&msg_var);
9271 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9272 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9273 js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9275 LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
9276 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9277 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 84, 0, 0, 0, 0, 0, 0);
9278 LDKNodeFeatures ret_conv;
9279 ret_conv.inner = untag_ptr(ret);
9280 ret_conv.is_owned = ptr_is_owned(ret);
9281 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9284 LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
9285 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9286 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9287 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9288 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
9289 LDKInitFeatures ret_conv;
9290 ret_conv.inner = untag_ptr(ret);
9291 ret_conv.is_owned = ptr_is_owned(ret);
9292 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9295 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
9296 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
9297 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9298 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9300 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9301 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
9302 atomic_init(&calls->refcnt, 1);
9303 calls->instance_ptr = o;
9305 LDKChannelMessageHandler ret = {
9306 .this_arg = (void*) calls,
9307 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
9308 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
9309 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
9310 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
9311 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
9312 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
9313 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
9314 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
9315 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
9316 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
9317 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
9318 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
9319 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
9320 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
9321 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
9322 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
9323 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
9324 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
9325 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
9326 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
9327 .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
9328 .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
9329 .free = LDKChannelMessageHandler_JCalls_free,
9330 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9332 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9335 uint64_t __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChannelMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9336 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
9337 *res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
9338 return tag_ptr(res_ptr, true);
9340 void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel"))) TS_ChannelMessageHandler_handle_open_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
9341 void* this_arg_ptr = untag_ptr(this_arg);
9342 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9343 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9344 LDKPublicKey their_node_id_ref;
9345 CHECK(their_node_id->arr_len == 33);
9346 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9347 LDKInitFeatures their_features_conv;
9348 their_features_conv.inner = untag_ptr(their_features);
9349 their_features_conv.is_owned = ptr_is_owned(their_features);
9350 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9351 their_features_conv = InitFeatures_clone(&their_features_conv);
9352 LDKOpenChannel msg_conv;
9353 msg_conv.inner = untag_ptr(msg);
9354 msg_conv.is_owned = ptr_is_owned(msg);
9355 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9356 msg_conv.is_owned = false;
9357 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
9360 void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel"))) TS_ChannelMessageHandler_handle_accept_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
9361 void* this_arg_ptr = untag_ptr(this_arg);
9362 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9363 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9364 LDKPublicKey their_node_id_ref;
9365 CHECK(their_node_id->arr_len == 33);
9366 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9367 LDKInitFeatures their_features_conv;
9368 their_features_conv.inner = untag_ptr(their_features);
9369 their_features_conv.is_owned = ptr_is_owned(their_features);
9370 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9371 their_features_conv = InitFeatures_clone(&their_features_conv);
9372 LDKAcceptChannel msg_conv;
9373 msg_conv.inner = untag_ptr(msg);
9374 msg_conv.is_owned = ptr_is_owned(msg);
9375 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9376 msg_conv.is_owned = false;
9377 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
9380 void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_created"))) TS_ChannelMessageHandler_handle_funding_created(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9381 void* this_arg_ptr = untag_ptr(this_arg);
9382 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9383 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9384 LDKPublicKey their_node_id_ref;
9385 CHECK(their_node_id->arr_len == 33);
9386 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9387 LDKFundingCreated msg_conv;
9388 msg_conv.inner = untag_ptr(msg);
9389 msg_conv.is_owned = ptr_is_owned(msg);
9390 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9391 msg_conv.is_owned = false;
9392 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9395 void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_signed"))) TS_ChannelMessageHandler_handle_funding_signed(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9396 void* this_arg_ptr = untag_ptr(this_arg);
9397 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9398 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9399 LDKPublicKey their_node_id_ref;
9400 CHECK(their_node_id->arr_len == 33);
9401 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9402 LDKFundingSigned msg_conv;
9403 msg_conv.inner = untag_ptr(msg);
9404 msg_conv.is_owned = ptr_is_owned(msg);
9405 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9406 msg_conv.is_owned = false;
9407 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9410 void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_ready"))) TS_ChannelMessageHandler_handle_channel_ready(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9411 void* this_arg_ptr = untag_ptr(this_arg);
9412 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9413 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9414 LDKPublicKey their_node_id_ref;
9415 CHECK(their_node_id->arr_len == 33);
9416 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9417 LDKChannelReady msg_conv;
9418 msg_conv.inner = untag_ptr(msg);
9419 msg_conv.is_owned = ptr_is_owned(msg);
9420 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9421 msg_conv.is_owned = false;
9422 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9425 void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) TS_ChannelMessageHandler_handle_shutdown(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
9426 void* this_arg_ptr = untag_ptr(this_arg);
9427 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9428 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9429 LDKPublicKey their_node_id_ref;
9430 CHECK(their_node_id->arr_len == 33);
9431 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9432 LDKInitFeatures their_features_conv;
9433 their_features_conv.inner = untag_ptr(their_features);
9434 their_features_conv.is_owned = ptr_is_owned(their_features);
9435 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9436 their_features_conv.is_owned = false;
9437 LDKShutdown msg_conv;
9438 msg_conv.inner = untag_ptr(msg);
9439 msg_conv.is_owned = ptr_is_owned(msg);
9440 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9441 msg_conv.is_owned = false;
9442 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
9445 void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed"))) TS_ChannelMessageHandler_handle_closing_signed(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9446 void* this_arg_ptr = untag_ptr(this_arg);
9447 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9448 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9449 LDKPublicKey their_node_id_ref;
9450 CHECK(their_node_id->arr_len == 33);
9451 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9452 LDKClosingSigned msg_conv;
9453 msg_conv.inner = untag_ptr(msg);
9454 msg_conv.is_owned = ptr_is_owned(msg);
9455 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9456 msg_conv.is_owned = false;
9457 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9460 void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_add_htlc"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9461 void* this_arg_ptr = untag_ptr(this_arg);
9462 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9463 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9464 LDKPublicKey their_node_id_ref;
9465 CHECK(their_node_id->arr_len == 33);
9466 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9467 LDKUpdateAddHTLC msg_conv;
9468 msg_conv.inner = untag_ptr(msg);
9469 msg_conv.is_owned = ptr_is_owned(msg);
9470 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9471 msg_conv.is_owned = false;
9472 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9475 void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fulfill_htlc"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9476 void* this_arg_ptr = untag_ptr(this_arg);
9477 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9478 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9479 LDKPublicKey their_node_id_ref;
9480 CHECK(their_node_id->arr_len == 33);
9481 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9482 LDKUpdateFulfillHTLC msg_conv;
9483 msg_conv.inner = untag_ptr(msg);
9484 msg_conv.is_owned = ptr_is_owned(msg);
9485 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9486 msg_conv.is_owned = false;
9487 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9490 void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_htlc"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9491 void* this_arg_ptr = untag_ptr(this_arg);
9492 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9493 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9494 LDKPublicKey their_node_id_ref;
9495 CHECK(their_node_id->arr_len == 33);
9496 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9497 LDKUpdateFailHTLC msg_conv;
9498 msg_conv.inner = untag_ptr(msg);
9499 msg_conv.is_owned = ptr_is_owned(msg);
9500 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9501 msg_conv.is_owned = false;
9502 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9505 void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_malformed_htlc"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9506 void* this_arg_ptr = untag_ptr(this_arg);
9507 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9508 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9509 LDKPublicKey their_node_id_ref;
9510 CHECK(their_node_id->arr_len == 33);
9511 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9512 LDKUpdateFailMalformedHTLC msg_conv;
9513 msg_conv.inner = untag_ptr(msg);
9514 msg_conv.is_owned = ptr_is_owned(msg);
9515 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9516 msg_conv.is_owned = false;
9517 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9520 void __attribute__((export_name("TS_ChannelMessageHandler_handle_commitment_signed"))) TS_ChannelMessageHandler_handle_commitment_signed(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9521 void* this_arg_ptr = untag_ptr(this_arg);
9522 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9523 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9524 LDKPublicKey their_node_id_ref;
9525 CHECK(their_node_id->arr_len == 33);
9526 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9527 LDKCommitmentSigned msg_conv;
9528 msg_conv.inner = untag_ptr(msg);
9529 msg_conv.is_owned = ptr_is_owned(msg);
9530 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9531 msg_conv.is_owned = false;
9532 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9535 void __attribute__((export_name("TS_ChannelMessageHandler_handle_revoke_and_ack"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9536 void* this_arg_ptr = untag_ptr(this_arg);
9537 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9538 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9539 LDKPublicKey their_node_id_ref;
9540 CHECK(their_node_id->arr_len == 33);
9541 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9542 LDKRevokeAndACK msg_conv;
9543 msg_conv.inner = untag_ptr(msg);
9544 msg_conv.is_owned = ptr_is_owned(msg);
9545 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9546 msg_conv.is_owned = false;
9547 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9550 void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fee"))) TS_ChannelMessageHandler_handle_update_fee(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9551 void* this_arg_ptr = untag_ptr(this_arg);
9552 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9553 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9554 LDKPublicKey their_node_id_ref;
9555 CHECK(their_node_id->arr_len == 33);
9556 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9557 LDKUpdateFee msg_conv;
9558 msg_conv.inner = untag_ptr(msg);
9559 msg_conv.is_owned = ptr_is_owned(msg);
9560 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9561 msg_conv.is_owned = false;
9562 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9565 void __attribute__((export_name("TS_ChannelMessageHandler_handle_announcement_signatures"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9566 void* this_arg_ptr = untag_ptr(this_arg);
9567 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9568 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9569 LDKPublicKey their_node_id_ref;
9570 CHECK(their_node_id->arr_len == 33);
9571 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9572 LDKAnnouncementSignatures msg_conv;
9573 msg_conv.inner = untag_ptr(msg);
9574 msg_conv.is_owned = ptr_is_owned(msg);
9575 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9576 msg_conv.is_owned = false;
9577 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9580 void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) TS_ChannelMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
9581 void* this_arg_ptr = untag_ptr(this_arg);
9582 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9583 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9584 LDKPublicKey their_node_id_ref;
9585 CHECK(their_node_id->arr_len == 33);
9586 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9587 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
9590 uint64_t __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9591 void* this_arg_ptr = untag_ptr(this_arg);
9592 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9593 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9594 LDKPublicKey their_node_id_ref;
9595 CHECK(their_node_id->arr_len == 33);
9596 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9598 msg_conv.inner = untag_ptr(msg);
9599 msg_conv.is_owned = ptr_is_owned(msg);
9600 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9601 msg_conv.is_owned = false;
9602 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
9603 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9604 return tag_ptr(ret_conv, true);
9607 void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reestablish"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9608 void* this_arg_ptr = untag_ptr(this_arg);
9609 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9610 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9611 LDKPublicKey their_node_id_ref;
9612 CHECK(their_node_id->arr_len == 33);
9613 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9614 LDKChannelReestablish msg_conv;
9615 msg_conv.inner = untag_ptr(msg);
9616 msg_conv.is_owned = ptr_is_owned(msg);
9617 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9618 msg_conv.is_owned = false;
9619 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9622 void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_update"))) TS_ChannelMessageHandler_handle_channel_update(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9623 void* this_arg_ptr = untag_ptr(this_arg);
9624 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9625 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9626 LDKPublicKey their_node_id_ref;
9627 CHECK(their_node_id->arr_len == 33);
9628 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9629 LDKChannelUpdate msg_conv;
9630 msg_conv.inner = untag_ptr(msg);
9631 msg_conv.is_owned = ptr_is_owned(msg);
9632 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9633 msg_conv.is_owned = false;
9634 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9637 void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9638 void* this_arg_ptr = untag_ptr(this_arg);
9639 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9640 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9641 LDKPublicKey their_node_id_ref;
9642 CHECK(their_node_id->arr_len == 33);
9643 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9644 LDKErrorMessage msg_conv;
9645 msg_conv.inner = untag_ptr(msg);
9646 msg_conv.is_owned = ptr_is_owned(msg);
9647 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9648 msg_conv.is_owned = false;
9649 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9652 uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_node_features"))) TS_ChannelMessageHandler_provided_node_features(uint64_t this_arg) {
9653 void* this_arg_ptr = untag_ptr(this_arg);
9654 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9655 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9656 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
9657 uint64_t ret_ref = 0;
9658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9659 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9663 uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_init_features"))) TS_ChannelMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
9664 void* this_arg_ptr = untag_ptr(this_arg);
9665 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9666 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9667 LDKPublicKey their_node_id_ref;
9668 CHECK(their_node_id->arr_len == 33);
9669 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9670 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
9671 uint64_t ret_ref = 0;
9672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9677 typedef struct LDKRoutingMessageHandler_JCalls {
9678 atomic_size_t refcnt;
9679 uint32_t instance_ptr;
9680 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9681 } LDKRoutingMessageHandler_JCalls;
9682 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
9683 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9684 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9688 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
9689 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9690 LDKNodeAnnouncement msg_var = *msg;
9691 uint64_t msg_ref = 0;
9692 msg_var = NodeAnnouncement_clone(&msg_var);
9693 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9694 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9695 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 86, msg_ref, 0, 0, 0, 0, 0);
9696 void* ret_ptr = untag_ptr(ret);
9697 CHECK_ACCESS(ret_ptr);
9698 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9699 FREE(untag_ptr(ret));
9702 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
9703 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9704 LDKChannelAnnouncement msg_var = *msg;
9705 uint64_t msg_ref = 0;
9706 msg_var = ChannelAnnouncement_clone(&msg_var);
9707 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9708 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9709 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 87, msg_ref, 0, 0, 0, 0, 0);
9710 void* ret_ptr = untag_ptr(ret);
9711 CHECK_ACCESS(ret_ptr);
9712 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9713 FREE(untag_ptr(ret));
9716 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
9717 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9718 LDKChannelUpdate msg_var = *msg;
9719 uint64_t msg_ref = 0;
9720 msg_var = ChannelUpdate_clone(&msg_var);
9721 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9722 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9723 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 88, msg_ref, 0, 0, 0, 0, 0);
9724 void* ret_ptr = untag_ptr(ret);
9725 CHECK_ACCESS(ret_ptr);
9726 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9727 FREE(untag_ptr(ret));
9730 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
9731 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9732 int64_t starting_point_conv = starting_point;
9733 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 89, starting_point_conv, 0, 0, 0, 0, 0);
9734 void* ret_ptr = untag_ptr(ret);
9735 CHECK_ACCESS(ret_ptr);
9736 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
9737 FREE(untag_ptr(ret));
9740 LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point) {
9741 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9742 int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
9743 memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
9744 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 90, (uint32_t)starting_point_arr, 0, 0, 0, 0, 0);
9745 LDKNodeAnnouncement ret_conv;
9746 ret_conv.inner = untag_ptr(ret);
9747 ret_conv.is_owned = ptr_is_owned(ret);
9748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9751 LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
9752 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9753 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9754 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9755 LDKInit init_var = *init;
9756 uint64_t init_ref = 0;
9757 init_var = Init_clone(&init_var);
9758 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
9759 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
9760 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 91, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
9761 void* ret_ptr = untag_ptr(ret);
9762 CHECK_ACCESS(ret_ptr);
9763 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
9764 FREE(untag_ptr(ret));
9767 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
9768 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9769 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9770 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9771 LDKReplyChannelRange msg_var = msg;
9772 uint64_t msg_ref = 0;
9773 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9774 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9775 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 92, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9776 void* ret_ptr = untag_ptr(ret);
9777 CHECK_ACCESS(ret_ptr);
9778 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9779 FREE(untag_ptr(ret));
9782 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
9783 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9784 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9785 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9786 LDKReplyShortChannelIdsEnd msg_var = msg;
9787 uint64_t msg_ref = 0;
9788 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9789 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9790 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 93, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9791 void* ret_ptr = untag_ptr(ret);
9792 CHECK_ACCESS(ret_ptr);
9793 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9794 FREE(untag_ptr(ret));
9797 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
9798 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9799 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9800 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9801 LDKQueryChannelRange msg_var = msg;
9802 uint64_t msg_ref = 0;
9803 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9804 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9805 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9806 void* ret_ptr = untag_ptr(ret);
9807 CHECK_ACCESS(ret_ptr);
9808 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9809 FREE(untag_ptr(ret));
9812 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
9813 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9814 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9815 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9816 LDKQueryShortChannelIds msg_var = msg;
9817 uint64_t msg_ref = 0;
9818 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9819 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9820 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9821 void* ret_ptr = untag_ptr(ret);
9822 CHECK_ACCESS(ret_ptr);
9823 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9824 FREE(untag_ptr(ret));
9827 LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
9828 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9829 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 96, 0, 0, 0, 0, 0, 0);
9830 LDKNodeFeatures ret_conv;
9831 ret_conv.inner = untag_ptr(ret);
9832 ret_conv.is_owned = ptr_is_owned(ret);
9833 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9836 LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
9837 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9838 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9839 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9840 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 97, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
9841 LDKInitFeatures ret_conv;
9842 ret_conv.inner = untag_ptr(ret);
9843 ret_conv.is_owned = ptr_is_owned(ret);
9844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9847 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
9848 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
9849 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9850 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9852 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9853 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
9854 atomic_init(&calls->refcnt, 1);
9855 calls->instance_ptr = o;
9857 LDKRoutingMessageHandler ret = {
9858 .this_arg = (void*) calls,
9859 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
9860 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
9861 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
9862 .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
9863 .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
9864 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
9865 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
9866 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
9867 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
9868 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
9869 .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
9870 .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
9871 .free = LDKRoutingMessageHandler_JCalls_free,
9872 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9874 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9877 uint64_t __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRoutingMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9878 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9879 *res_ptr = LDKRoutingMessageHandler_init(o, MessageSendEventsProvider);
9880 return tag_ptr(res_ptr, true);
9882 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint64_t this_arg, uint64_t msg) {
9883 void* this_arg_ptr = untag_ptr(this_arg);
9884 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9885 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9886 LDKNodeAnnouncement msg_conv;
9887 msg_conv.inner = untag_ptr(msg);
9888 msg_conv.is_owned = ptr_is_owned(msg);
9889 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9890 msg_conv.is_owned = false;
9891 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9892 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
9893 return tag_ptr(ret_conv, true);
9896 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint64_t this_arg, uint64_t msg) {
9897 void* this_arg_ptr = untag_ptr(this_arg);
9898 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9899 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9900 LDKChannelAnnouncement msg_conv;
9901 msg_conv.inner = untag_ptr(msg);
9902 msg_conv.is_owned = ptr_is_owned(msg);
9903 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9904 msg_conv.is_owned = false;
9905 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9906 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
9907 return tag_ptr(ret_conv, true);
9910 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint64_t this_arg, uint64_t msg) {
9911 void* this_arg_ptr = untag_ptr(this_arg);
9912 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9913 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9914 LDKChannelUpdate msg_conv;
9915 msg_conv.inner = untag_ptr(msg);
9916 msg_conv.is_owned = ptr_is_owned(msg);
9917 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9918 msg_conv.is_owned = false;
9919 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9920 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
9921 return tag_ptr(ret_conv, true);
9924 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcement"))) TS_RoutingMessageHandler_get_next_channel_announcement(uint64_t this_arg, int64_t starting_point) {
9925 void* this_arg_ptr = untag_ptr(this_arg);
9926 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9927 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9928 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
9929 *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
9930 uint64_t ret_ref = tag_ptr(ret_copy, true);
9934 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcement"))) TS_RoutingMessageHandler_get_next_node_announcement(uint64_t this_arg, int8_tArray starting_point) {
9935 void* this_arg_ptr = untag_ptr(this_arg);
9936 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9937 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9938 LDKPublicKey starting_point_ref;
9939 CHECK(starting_point->arr_len == 33);
9940 memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
9941 LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_ref);
9942 uint64_t ret_ref = 0;
9943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9948 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
9949 void* this_arg_ptr = untag_ptr(this_arg);
9950 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9951 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9952 LDKPublicKey their_node_id_ref;
9953 CHECK(their_node_id->arr_len == 33);
9954 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9956 init_conv.inner = untag_ptr(init);
9957 init_conv.is_owned = ptr_is_owned(init);
9958 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
9959 init_conv.is_owned = false;
9960 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
9961 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
9962 return tag_ptr(ret_conv, true);
9965 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_channel_range"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9966 void* this_arg_ptr = untag_ptr(this_arg);
9967 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9968 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9969 LDKPublicKey their_node_id_ref;
9970 CHECK(their_node_id->arr_len == 33);
9971 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9972 LDKReplyChannelRange msg_conv;
9973 msg_conv.inner = untag_ptr(msg);
9974 msg_conv.is_owned = ptr_is_owned(msg);
9975 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9976 msg_conv = ReplyChannelRange_clone(&msg_conv);
9977 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9978 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9979 return tag_ptr(ret_conv, true);
9982 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_short_channel_ids_end"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9983 void* this_arg_ptr = untag_ptr(this_arg);
9984 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9985 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9986 LDKPublicKey their_node_id_ref;
9987 CHECK(their_node_id->arr_len == 33);
9988 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9989 LDKReplyShortChannelIdsEnd msg_conv;
9990 msg_conv.inner = untag_ptr(msg);
9991 msg_conv.is_owned = ptr_is_owned(msg);
9992 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9993 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
9994 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9995 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9996 return tag_ptr(ret_conv, true);
9999 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_channel_range"))) TS_RoutingMessageHandler_handle_query_channel_range(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
10000 void* this_arg_ptr = untag_ptr(this_arg);
10001 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10002 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
10003 LDKPublicKey their_node_id_ref;
10004 CHECK(their_node_id->arr_len == 33);
10005 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10006 LDKQueryChannelRange msg_conv;
10007 msg_conv.inner = untag_ptr(msg);
10008 msg_conv.is_owned = ptr_is_owned(msg);
10009 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
10010 msg_conv = QueryChannelRange_clone(&msg_conv);
10011 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
10012 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
10013 return tag_ptr(ret_conv, true);
10016 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_short_channel_ids"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
10017 void* this_arg_ptr = untag_ptr(this_arg);
10018 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10019 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
10020 LDKPublicKey their_node_id_ref;
10021 CHECK(their_node_id->arr_len == 33);
10022 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10023 LDKQueryShortChannelIds msg_conv;
10024 msg_conv.inner = untag_ptr(msg);
10025 msg_conv.is_owned = ptr_is_owned(msg);
10026 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
10027 msg_conv = QueryShortChannelIds_clone(&msg_conv);
10028 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
10029 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
10030 return tag_ptr(ret_conv, true);
10033 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_node_features"))) TS_RoutingMessageHandler_provided_node_features(uint64_t this_arg) {
10034 void* this_arg_ptr = untag_ptr(this_arg);
10035 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10036 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
10037 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
10038 uint64_t ret_ref = 0;
10039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10044 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_init_features"))) TS_RoutingMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
10045 void* this_arg_ptr = untag_ptr(this_arg);
10046 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10047 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
10048 LDKPublicKey their_node_id_ref;
10049 CHECK(their_node_id->arr_len == 33);
10050 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10051 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
10052 uint64_t ret_ref = 0;
10053 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10054 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10058 typedef struct LDKOnionMessageHandler_JCalls {
10059 atomic_size_t refcnt;
10060 uint32_t instance_ptr;
10061 LDKOnionMessageProvider_JCalls* OnionMessageProvider;
10062 } LDKOnionMessageHandler_JCalls;
10063 static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
10064 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10065 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10069 void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
10070 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10071 int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
10072 memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
10073 LDKOnionMessage msg_var = *msg;
10074 uint64_t msg_ref = 0;
10075 msg_var = OnionMessage_clone(&msg_var);
10076 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10077 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10078 js_invoke_function_ubuuuu(j_calls->instance_ptr, 98, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0);
10080 LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
10081 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10082 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10083 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10084 LDKInit init_var = *init;
10085 uint64_t init_ref = 0;
10086 init_var = Init_clone(&init_var);
10087 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
10088 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
10089 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 99, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
10090 void* ret_ptr = untag_ptr(ret);
10091 CHECK_ACCESS(ret_ptr);
10092 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
10093 FREE(untag_ptr(ret));
10096 void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
10097 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10098 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10099 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10100 jboolean no_connection_possible_conv = no_connection_possible;
10101 js_invoke_function_uuuuuu(j_calls->instance_ptr, 100, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
10103 LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
10104 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10105 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 101, 0, 0, 0, 0, 0, 0);
10106 LDKNodeFeatures ret_conv;
10107 ret_conv.inner = untag_ptr(ret);
10108 ret_conv.is_owned = ptr_is_owned(ret);
10109 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
10112 LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
10113 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10114 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10115 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10116 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 102, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
10117 LDKInitFeatures ret_conv;
10118 ret_conv.inner = untag_ptr(ret);
10119 ret_conv.is_owned = ptr_is_owned(ret);
10120 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
10123 static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
10124 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
10125 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10126 atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
10128 static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JSValue o, JSValue OnionMessageProvider) {
10129 LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
10130 atomic_init(&calls->refcnt, 1);
10131 calls->instance_ptr = o;
10133 LDKOnionMessageHandler ret = {
10134 .this_arg = (void*) calls,
10135 .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
10136 .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
10137 .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
10138 .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
10139 .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
10140 .free = LDKOnionMessageHandler_JCalls_free,
10141 .OnionMessageProvider = LDKOnionMessageProvider_init(OnionMessageProvider),
10143 calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
10146 uint64_t __attribute__((export_name("TS_LDKOnionMessageHandler_new"))) TS_LDKOnionMessageHandler_new(JSValue o, JSValue OnionMessageProvider) {
10147 LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
10148 *res_ptr = LDKOnionMessageHandler_init(o, OnionMessageProvider);
10149 return tag_ptr(res_ptr, true);
10151 void __attribute__((export_name("TS_OnionMessageHandler_handle_onion_message"))) TS_OnionMessageHandler_handle_onion_message(uint64_t this_arg, int8_tArray peer_node_id, uint64_t msg) {
10152 void* this_arg_ptr = untag_ptr(this_arg);
10153 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10154 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10155 LDKPublicKey peer_node_id_ref;
10156 CHECK(peer_node_id->arr_len == 33);
10157 memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
10158 LDKOnionMessage msg_conv;
10159 msg_conv.inner = untag_ptr(msg);
10160 msg_conv.is_owned = ptr_is_owned(msg);
10161 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
10162 msg_conv.is_owned = false;
10163 (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
10166 uint64_t __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_OnionMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
10167 void* this_arg_ptr = untag_ptr(this_arg);
10168 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10169 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10170 LDKPublicKey their_node_id_ref;
10171 CHECK(their_node_id->arr_len == 33);
10172 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10174 init_conv.inner = untag_ptr(init);
10175 init_conv.is_owned = ptr_is_owned(init);
10176 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
10177 init_conv.is_owned = false;
10178 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10179 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
10180 return tag_ptr(ret_conv, true);
10183 void __attribute__((export_name("TS_OnionMessageHandler_peer_disconnected"))) TS_OnionMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
10184 void* this_arg_ptr = untag_ptr(this_arg);
10185 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10186 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10187 LDKPublicKey their_node_id_ref;
10188 CHECK(their_node_id->arr_len == 33);
10189 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10190 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
10193 uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_node_features"))) TS_OnionMessageHandler_provided_node_features(uint64_t this_arg) {
10194 void* this_arg_ptr = untag_ptr(this_arg);
10195 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10196 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10197 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
10198 uint64_t ret_ref = 0;
10199 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10200 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10204 uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_init_features"))) TS_OnionMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
10205 void* this_arg_ptr = untag_ptr(this_arg);
10206 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10207 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10208 LDKPublicKey their_node_id_ref;
10209 CHECK(their_node_id->arr_len == 33);
10210 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10211 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
10212 uint64_t ret_ref = 0;
10213 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10214 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10218 typedef struct LDKCustomMessageReader_JCalls {
10219 atomic_size_t refcnt;
10220 uint32_t instance_ptr;
10221 } LDKCustomMessageReader_JCalls;
10222 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
10223 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
10224 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10228 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
10229 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
10230 int16_t message_type_conv = message_type;
10231 LDKu8slice buffer_var = buffer;
10232 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
10233 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
10234 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 103, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
10235 void* ret_ptr = untag_ptr(ret);
10236 CHECK_ACCESS(ret_ptr);
10237 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
10238 FREE(untag_ptr(ret));
10241 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
10242 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
10243 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10245 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JSValue o) {
10246 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
10247 atomic_init(&calls->refcnt, 1);
10248 calls->instance_ptr = o;
10250 LDKCustomMessageReader ret = {
10251 .this_arg = (void*) calls,
10252 .read = read_LDKCustomMessageReader_jcall,
10253 .free = LDKCustomMessageReader_JCalls_free,
10257 uint64_t __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustomMessageReader_new(JSValue o) {
10258 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
10259 *res_ptr = LDKCustomMessageReader_init(o);
10260 return tag_ptr(res_ptr, true);
10262 uint64_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint64_t this_arg, int16_t message_type, int8_tArray buffer) {
10263 void* this_arg_ptr = untag_ptr(this_arg);
10264 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10265 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
10266 LDKu8slice buffer_ref;
10267 buffer_ref.datalen = buffer->arr_len;
10268 buffer_ref.data = buffer->elems;
10269 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
10270 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
10272 return tag_ptr(ret_conv, true);
10275 typedef struct LDKCustomMessageHandler_JCalls {
10276 atomic_size_t refcnt;
10277 uint32_t instance_ptr;
10278 LDKCustomMessageReader_JCalls* CustomMessageReader;
10279 } LDKCustomMessageHandler_JCalls;
10280 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
10281 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10282 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10286 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
10287 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10288 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
10290 int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
10291 memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
10292 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 104, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0);
10293 void* ret_ptr = untag_ptr(ret);
10294 CHECK_ACCESS(ret_ptr);
10295 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
10296 FREE(untag_ptr(ret));
10299 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
10300 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10301 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 105, 0, 0, 0, 0, 0, 0);
10302 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
10303 ret_constr.datalen = ret->arr_len;
10304 if (ret_constr.datalen > 0)
10305 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
10307 ret_constr.data = NULL;
10308 uint64_t* ret_vals = ret->elems;
10309 for (size_t z = 0; z < ret_constr.datalen; z++) {
10310 uint64_t ret_conv_25 = ret_vals[z];
10311 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
10312 CHECK_ACCESS(ret_conv_25_ptr);
10313 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
10314 FREE(untag_ptr(ret_conv_25));
10315 ret_constr.data[z] = ret_conv_25_conv;
10320 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
10321 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
10322 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10323 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
10325 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JSValue o, JSValue CustomMessageReader) {
10326 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
10327 atomic_init(&calls->refcnt, 1);
10328 calls->instance_ptr = o;
10330 LDKCustomMessageHandler ret = {
10331 .this_arg = (void*) calls,
10332 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
10333 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
10334 .free = LDKCustomMessageHandler_JCalls_free,
10335 .CustomMessageReader = LDKCustomMessageReader_init(CustomMessageReader),
10337 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
10340 uint64_t __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCustomMessageHandler_new(JSValue o, JSValue CustomMessageReader) {
10341 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
10342 *res_ptr = LDKCustomMessageHandler_init(o, CustomMessageReader);
10343 return tag_ptr(res_ptr, true);
10345 uint64_t __attribute__((export_name("TS_CustomMessageHandler_handle_custom_message"))) TS_CustomMessageHandler_handle_custom_message(uint64_t this_arg, uint64_t msg, int8_tArray sender_node_id) {
10346 void* this_arg_ptr = untag_ptr(this_arg);
10347 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10348 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
10349 void* msg_ptr = untag_ptr(msg);
10350 CHECK_ACCESS(msg_ptr);
10351 LDKType msg_conv = *(LDKType*)(msg_ptr);
10352 if (msg_conv.free == LDKType_JCalls_free) {
10353 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
10354 LDKType_JCalls_cloned(&msg_conv);
10356 LDKPublicKey sender_node_id_ref;
10357 CHECK(sender_node_id->arr_len == 33);
10358 memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id);
10359 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
10360 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
10361 return tag_ptr(ret_conv, true);
10364 uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint64_t this_arg) {
10365 void* this_arg_ptr = untag_ptr(this_arg);
10366 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10367 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
10368 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
10369 uint64_tArray ret_arr = NULL;
10370 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10371 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10372 for (size_t z = 0; z < ret_var.datalen; z++) {
10373 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
10374 *ret_conv_25_conv = ret_var.data[z];
10375 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
10378 FREE(ret_var.data);
10382 typedef struct LDKCustomOnionMessageHandler_JCalls {
10383 atomic_size_t refcnt;
10384 uint32_t instance_ptr;
10385 } LDKCustomOnionMessageHandler_JCalls;
10386 static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
10387 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
10388 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10392 void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
10393 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
10394 LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
10396 js_invoke_function_buuuuu(j_calls->instance_ptr, 106, tag_ptr(msg_ret, true), 0, 0, 0, 0, 0);
10398 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
10399 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
10400 int64_t message_type_conv = message_type;
10401 LDKu8slice buffer_var = buffer;
10402 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
10403 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
10404 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 107, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
10405 void* ret_ptr = untag_ptr(ret);
10406 CHECK_ACCESS(ret_ptr);
10407 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
10408 FREE(untag_ptr(ret));
10411 static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
10412 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
10413 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10415 static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JSValue o) {
10416 LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
10417 atomic_init(&calls->refcnt, 1);
10418 calls->instance_ptr = o;
10420 LDKCustomOnionMessageHandler ret = {
10421 .this_arg = (void*) calls,
10422 .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
10423 .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
10424 .free = LDKCustomOnionMessageHandler_JCalls_free,
10428 uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageHandler_new"))) TS_LDKCustomOnionMessageHandler_new(JSValue o) {
10429 LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
10430 *res_ptr = LDKCustomOnionMessageHandler_init(o);
10431 return tag_ptr(res_ptr, true);
10433 void __attribute__((export_name("TS_CustomOnionMessageHandler_handle_custom_message"))) TS_CustomOnionMessageHandler_handle_custom_message(uint64_t this_arg, uint64_t msg) {
10434 void* this_arg_ptr = untag_ptr(this_arg);
10435 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10436 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
10437 void* msg_ptr = untag_ptr(msg);
10438 CHECK_ACCESS(msg_ptr);
10439 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
10440 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
10441 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
10442 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
10444 (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
10447 uint64_t __attribute__((export_name("TS_CustomOnionMessageHandler_read_custom_message"))) TS_CustomOnionMessageHandler_read_custom_message(uint64_t this_arg, int64_t message_type, int8_tArray buffer) {
10448 void* this_arg_ptr = untag_ptr(this_arg);
10449 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10450 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
10451 LDKu8slice buffer_ref;
10452 buffer_ref.datalen = buffer->arr_len;
10453 buffer_ref.data = buffer->elems;
10454 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
10455 *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
10457 return tag_ptr(ret_conv, true);
10460 typedef struct LDKSocketDescriptor_JCalls {
10461 atomic_size_t refcnt;
10462 uint32_t instance_ptr;
10463 } LDKSocketDescriptor_JCalls;
10464 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
10465 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10466 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10470 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
10471 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10472 LDKu8slice data_var = data;
10473 int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
10474 memcpy(data_arr->elems, data_var.data, data_var.datalen);
10475 jboolean resume_read_conv = resume_read;
10476 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 108, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
10478 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
10479 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10480 js_invoke_function_uuuuuu(j_calls->instance_ptr, 109, 0, 0, 0, 0, 0, 0);
10482 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
10483 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10484 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
10485 *other_arg_clone = SocketDescriptor_clone(other_arg);
10486 return js_invoke_function_buuuuu(j_calls->instance_ptr, 110, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
10488 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
10489 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10490 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 111, 0, 0, 0, 0, 0, 0);
10492 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
10493 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
10494 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10496 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JSValue o) {
10497 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
10498 atomic_init(&calls->refcnt, 1);
10499 calls->instance_ptr = o;
10501 LDKSocketDescriptor ret = {
10502 .this_arg = (void*) calls,
10503 .send_data = send_data_LDKSocketDescriptor_jcall,
10504 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
10505 .eq = eq_LDKSocketDescriptor_jcall,
10506 .hash = hash_LDKSocketDescriptor_jcall,
10507 .cloned = LDKSocketDescriptor_JCalls_cloned,
10508 .free = LDKSocketDescriptor_JCalls_free,
10512 uint64_t __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDescriptor_new(JSValue o) {
10513 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
10514 *res_ptr = LDKSocketDescriptor_init(o);
10515 return tag_ptr(res_ptr, true);
10517 uint32_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint64_t this_arg, int8_tArray data, jboolean resume_read) {
10518 void* this_arg_ptr = untag_ptr(this_arg);
10519 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10520 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10521 LDKu8slice data_ref;
10522 data_ref.datalen = data->arr_len;
10523 data_ref.data = data->elems;
10524 uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
10529 void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint64_t this_arg) {
10530 void* this_arg_ptr = untag_ptr(this_arg);
10531 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10532 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10533 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
10536 int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint64_t this_arg) {
10537 void* this_arg_ptr = untag_ptr(this_arg);
10538 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10539 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10540 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
10544 uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) {
10545 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10547 case LDKEffectiveCapacity_ExactLiquidity: return 0;
10548 case LDKEffectiveCapacity_MaximumHTLC: return 1;
10549 case LDKEffectiveCapacity_Total: return 2;
10550 case LDKEffectiveCapacity_Infinite: return 3;
10551 case LDKEffectiveCapacity_Unknown: return 4;
10555 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat"))) TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(uint64_t ptr) {
10556 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10557 assert(obj->tag == LDKEffectiveCapacity_ExactLiquidity);
10558 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
10559 return liquidity_msat_conv;
10561 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat"))) TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(uint64_t ptr) {
10562 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10563 assert(obj->tag == LDKEffectiveCapacity_MaximumHTLC);
10564 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
10565 return amount_msat_conv;
10567 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_capacity_msat"))) TS_LDKEffectiveCapacity_Total_get_capacity_msat(uint64_t ptr) {
10568 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10569 assert(obj->tag == LDKEffectiveCapacity_Total);
10570 int64_t capacity_msat_conv = obj->total.capacity_msat;
10571 return capacity_msat_conv;
10573 uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
10574 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10575 assert(obj->tag == LDKEffectiveCapacity_Total);
10576 uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
10577 return htlc_maximum_msat_ref;
10579 uint32_t __attribute__((export_name("TS_LDKDestination_ty_from_ptr"))) TS_LDKDestination_ty_from_ptr(uint64_t ptr) {
10580 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10582 case LDKDestination_Node: return 0;
10583 case LDKDestination_BlindedRoute: return 1;
10587 int8_tArray __attribute__((export_name("TS_LDKDestination_Node_get_node"))) TS_LDKDestination_Node_get_node(uint64_t ptr) {
10588 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10589 assert(obj->tag == LDKDestination_Node);
10590 int8_tArray node_arr = init_int8_tArray(33, __LINE__);
10591 memcpy(node_arr->elems, obj->node.compressed_form, 33);
10594 uint64_t __attribute__((export_name("TS_LDKDestination_BlindedRoute_get_blinded_route"))) TS_LDKDestination_BlindedRoute_get_blinded_route(uint64_t ptr) {
10595 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10596 assert(obj->tag == LDKDestination_BlindedRoute);
10597 LDKBlindedRoute blinded_route_var = obj->blinded_route;
10598 uint64_t blinded_route_ref = 0;
10599 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_var);
10600 blinded_route_ref = tag_ptr(blinded_route_var.inner, false);
10601 return blinded_route_ref;
10603 uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
10604 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10606 case LDKFallback_SegWitProgram: return 0;
10607 case LDKFallback_PubKeyHash: return 1;
10608 case LDKFallback_ScriptHash: return 2;
10612 int8_t __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_version"))) TS_LDKFallback_SegWitProgram_get_version(uint64_t ptr) {
10613 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10614 assert(obj->tag == LDKFallback_SegWitProgram);
10615 uint8_t version_val = obj->seg_wit_program.version._0;
10616 return version_val;
10618 int8_tArray __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_program"))) TS_LDKFallback_SegWitProgram_get_program(uint64_t ptr) {
10619 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10620 assert(obj->tag == LDKFallback_SegWitProgram);
10621 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
10622 int8_tArray program_arr = init_int8_tArray(program_var.datalen, __LINE__);
10623 memcpy(program_arr->elems, program_var.data, program_var.datalen);
10624 return program_arr;
10626 int8_tArray __attribute__((export_name("TS_LDKFallback_PubKeyHash_get_pub_key_hash"))) TS_LDKFallback_PubKeyHash_get_pub_key_hash(uint64_t ptr) {
10627 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10628 assert(obj->tag == LDKFallback_PubKeyHash);
10629 int8_tArray pub_key_hash_arr = init_int8_tArray(20, __LINE__);
10630 memcpy(pub_key_hash_arr->elems, obj->pub_key_hash.data, 20);
10631 return pub_key_hash_arr;
10633 int8_tArray __attribute__((export_name("TS_LDKFallback_ScriptHash_get_script_hash"))) TS_LDKFallback_ScriptHash_get_script_hash(uint64_t ptr) {
10634 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10635 assert(obj->tag == LDKFallback_ScriptHash);
10636 int8_tArray script_hash_arr = init_int8_tArray(20, __LINE__);
10637 memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
10638 return script_hash_arr;
10640 typedef struct LDKPayer_JCalls {
10641 atomic_size_t refcnt;
10642 uint32_t instance_ptr;
10644 static void LDKPayer_JCalls_free(void* this_arg) {
10645 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10646 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10650 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
10651 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10652 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 112, 0, 0, 0, 0, 0, 0);
10653 LDKPublicKey ret_ref;
10654 CHECK(ret->arr_len == 33);
10655 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
10658 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
10659 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10660 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 113, 0, 0, 0, 0, 0, 0);
10661 LDKCVec_ChannelDetailsZ ret_constr;
10662 ret_constr.datalen = ret->arr_len;
10663 if (ret_constr.datalen > 0)
10664 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
10666 ret_constr.data = NULL;
10667 uint64_t* ret_vals = ret->elems;
10668 for (size_t q = 0; q < ret_constr.datalen; q++) {
10669 uint64_t ret_conv_16 = ret_vals[q];
10670 LDKChannelDetails ret_conv_16_conv;
10671 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
10672 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
10673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
10674 ret_constr.data[q] = ret_conv_16_conv;
10679 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
10680 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10681 LDKRoute route_var = *route;
10682 uint64_t route_ref = 0;
10683 route_var = Route_clone(&route_var);
10684 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10685 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10686 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10687 memcpy(payment_hash_arr->elems, payment_hash.data, 32);
10688 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
10689 memcpy(payment_secret_arr->elems, payment_secret.data, 32);
10690 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 114, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0);
10691 void* ret_ptr = untag_ptr(ret);
10692 CHECK_ACCESS(ret_ptr);
10693 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
10694 FREE(untag_ptr(ret));
10697 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
10698 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10699 LDKRoute route_var = *route;
10700 uint64_t route_ref = 0;
10701 route_var = Route_clone(&route_var);
10702 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10703 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10704 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
10705 memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
10706 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 115, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
10707 void* ret_ptr = untag_ptr(ret);
10708 CHECK_ACCESS(ret_ptr);
10709 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
10710 FREE(untag_ptr(ret));
10713 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
10714 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10715 LDKRoute route_var = *route;
10716 uint64_t route_ref = 0;
10717 route_var = Route_clone(&route_var);
10718 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10719 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10720 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
10721 memcpy(payment_id_arr->elems, payment_id.data, 32);
10722 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 116, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
10723 void* ret_ptr = untag_ptr(ret);
10724 CHECK_ACCESS(ret_ptr);
10725 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
10726 FREE(untag_ptr(ret));
10729 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
10730 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10731 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
10732 memcpy(payment_id_arr->elems, payment_id.data, 32);
10733 js_invoke_function_uuuuuu(j_calls->instance_ptr, 117, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
10735 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
10736 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
10737 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10739 static inline LDKPayer LDKPayer_init (JSValue o) {
10740 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
10741 atomic_init(&calls->refcnt, 1);
10742 calls->instance_ptr = o;
10745 .this_arg = (void*) calls,
10746 .node_id = node_id_LDKPayer_jcall,
10747 .first_hops = first_hops_LDKPayer_jcall,
10748 .send_payment = send_payment_LDKPayer_jcall,
10749 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
10750 .retry_payment = retry_payment_LDKPayer_jcall,
10751 .abandon_payment = abandon_payment_LDKPayer_jcall,
10752 .free = LDKPayer_JCalls_free,
10756 uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
10757 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
10758 *res_ptr = LDKPayer_init(o);
10759 return tag_ptr(res_ptr, true);
10761 int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
10762 void* this_arg_ptr = untag_ptr(this_arg);
10763 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10764 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10765 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
10766 memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
10770 uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
10771 void* this_arg_ptr = untag_ptr(this_arg);
10772 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10773 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10774 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
10775 uint64_tArray ret_arr = NULL;
10776 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10777 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10778 for (size_t q = 0; q < ret_var.datalen; q++) {
10779 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
10780 uint64_t ret_conv_16_ref = 0;
10781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
10782 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
10783 ret_arr_ptr[q] = ret_conv_16_ref;
10786 FREE(ret_var.data);
10790 uint64_t __attribute__((export_name("TS_Payer_send_payment"))) TS_Payer_send_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
10791 void* this_arg_ptr = untag_ptr(this_arg);
10792 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10793 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10794 LDKRoute route_conv;
10795 route_conv.inner = untag_ptr(route);
10796 route_conv.is_owned = ptr_is_owned(route);
10797 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10798 route_conv.is_owned = false;
10799 LDKThirtyTwoBytes payment_hash_ref;
10800 CHECK(payment_hash->arr_len == 32);
10801 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
10802 LDKThirtyTwoBytes payment_secret_ref;
10803 CHECK(payment_secret->arr_len == 32);
10804 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
10805 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10806 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
10807 return tag_ptr(ret_conv, true);
10810 uint64_t __attribute__((export_name("TS_Payer_send_spontaneous_payment"))) TS_Payer_send_spontaneous_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_preimage) {
10811 void* this_arg_ptr = untag_ptr(this_arg);
10812 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10813 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10814 LDKRoute route_conv;
10815 route_conv.inner = untag_ptr(route);
10816 route_conv.is_owned = ptr_is_owned(route);
10817 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10818 route_conv.is_owned = false;
10819 LDKThirtyTwoBytes payment_preimage_ref;
10820 CHECK(payment_preimage->arr_len == 32);
10821 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
10822 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10823 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
10824 return tag_ptr(ret_conv, true);
10827 uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
10828 void* this_arg_ptr = untag_ptr(this_arg);
10829 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10830 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10831 LDKRoute route_conv;
10832 route_conv.inner = untag_ptr(route);
10833 route_conv.is_owned = ptr_is_owned(route);
10834 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10835 route_conv.is_owned = false;
10836 LDKThirtyTwoBytes payment_id_ref;
10837 CHECK(payment_id->arr_len == 32);
10838 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10839 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
10840 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
10841 return tag_ptr(ret_conv, true);
10844 void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
10845 void* this_arg_ptr = untag_ptr(this_arg);
10846 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10847 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10848 LDKThirtyTwoBytes payment_id_ref;
10849 CHECK(payment_id->arr_len == 32);
10850 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10851 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
10854 typedef struct LDKRouter_JCalls {
10855 atomic_size_t refcnt;
10856 uint32_t instance_ptr;
10857 } LDKRouter_JCalls;
10858 static void LDKRouter_JCalls_free(void* this_arg) {
10859 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10860 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10864 LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) {
10865 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10866 int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
10867 memcpy(payer_arr->elems, payer.compressed_form, 33);
10868 LDKRouteParameters route_params_var = *route_params;
10869 uint64_t route_params_ref = 0;
10870 route_params_var = RouteParameters_clone(&route_params_var);
10871 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
10872 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
10873 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10874 memcpy(payment_hash_arr->elems, *payment_hash, 32);
10875 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
10876 uint64_tArray first_hops_arr = NULL;
10877 if (first_hops != NULL) {
10878 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
10879 first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
10880 uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
10881 for (size_t q = 0; q < first_hops_var.datalen; q++) {
10882 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
10883 uint64_t first_hops_conv_16_ref = 0;
10884 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
10885 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
10886 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
10890 LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs;
10891 uint64_t inflight_htlcs_ref = 0;
10892 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
10893 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
10894 uint64_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 118, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, inflight_htlcs_ref, 0);
10895 void* ret_ptr = untag_ptr(ret);
10896 CHECK_ACCESS(ret_ptr);
10897 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
10898 FREE(untag_ptr(ret));
10901 void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
10902 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10903 LDKCVec_RouteHopZ path_var = path;
10904 uint64_tArray path_arr = NULL;
10905 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10906 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10907 for (size_t k = 0; k < path_var.datalen; k++) {
10908 LDKRouteHop path_conv_10_var = path_var.data[k];
10909 uint64_t path_conv_10_ref = 0;
10910 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10911 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10912 path_arr_ptr[k] = path_conv_10_ref;
10915 FREE(path_var.data);
10916 int64_t short_channel_id_conv = short_channel_id;
10917 js_invoke_function_ubuuuu(j_calls->instance_ptr, 119, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
10919 void notify_payment_path_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
10920 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10921 LDKCVec_RouteHopZ path_var = path;
10922 uint64_tArray path_arr = NULL;
10923 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10924 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10925 for (size_t k = 0; k < path_var.datalen; k++) {
10926 LDKRouteHop path_conv_10_var = path_var.data[k];
10927 uint64_t path_conv_10_ref = 0;
10928 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10929 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10930 path_arr_ptr[k] = path_conv_10_ref;
10933 FREE(path_var.data);
10934 js_invoke_function_uuuuuu(j_calls->instance_ptr, 120, (uint32_t)path_arr, 0, 0, 0, 0, 0);
10936 void notify_payment_probe_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
10937 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10938 LDKCVec_RouteHopZ path_var = path;
10939 uint64_tArray path_arr = NULL;
10940 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10941 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10942 for (size_t k = 0; k < path_var.datalen; k++) {
10943 LDKRouteHop path_conv_10_var = path_var.data[k];
10944 uint64_t path_conv_10_ref = 0;
10945 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10946 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10947 path_arr_ptr[k] = path_conv_10_ref;
10950 FREE(path_var.data);
10951 js_invoke_function_uuuuuu(j_calls->instance_ptr, 121, (uint32_t)path_arr, 0, 0, 0, 0, 0);
10953 void notify_payment_probe_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
10954 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10955 LDKCVec_RouteHopZ path_var = path;
10956 uint64_tArray path_arr = NULL;
10957 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10958 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10959 for (size_t k = 0; k < path_var.datalen; k++) {
10960 LDKRouteHop path_conv_10_var = path_var.data[k];
10961 uint64_t path_conv_10_ref = 0;
10962 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10963 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10964 path_arr_ptr[k] = path_conv_10_ref;
10967 FREE(path_var.data);
10968 int64_t short_channel_id_conv = short_channel_id;
10969 js_invoke_function_ubuuuu(j_calls->instance_ptr, 122, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
10971 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
10972 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
10973 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10975 static inline LDKRouter LDKRouter_init (JSValue o) {
10976 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
10977 atomic_init(&calls->refcnt, 1);
10978 calls->instance_ptr = o;
10981 .this_arg = (void*) calls,
10982 .find_route = find_route_LDKRouter_jcall,
10983 .notify_payment_path_failed = notify_payment_path_failed_LDKRouter_jcall,
10984 .notify_payment_path_successful = notify_payment_path_successful_LDKRouter_jcall,
10985 .notify_payment_probe_successful = notify_payment_probe_successful_LDKRouter_jcall,
10986 .notify_payment_probe_failed = notify_payment_probe_failed_LDKRouter_jcall,
10987 .free = LDKRouter_JCalls_free,
10991 uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
10992 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
10993 *res_ptr = LDKRouter_init(o);
10994 return tag_ptr(res_ptr, true);
10996 uint64_t __attribute__((export_name("TS_Router_find_route"))) TS_Router_find_route(uint64_t this_arg, int8_tArray payer, uint64_t route_params, int8_tArray payment_hash, uint64_tArray first_hops, uint64_t inflight_htlcs) {
10997 void* this_arg_ptr = untag_ptr(this_arg);
10998 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10999 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
11000 LDKPublicKey payer_ref;
11001 CHECK(payer->arr_len == 33);
11002 memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
11003 LDKRouteParameters route_params_conv;
11004 route_params_conv.inner = untag_ptr(route_params);
11005 route_params_conv.is_owned = ptr_is_owned(route_params);
11006 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
11007 route_params_conv.is_owned = false;
11008 unsigned char payment_hash_arr[32];
11009 CHECK(payment_hash->arr_len == 32);
11010 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
11011 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
11012 LDKCVec_ChannelDetailsZ first_hops_constr;
11013 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
11014 if (first_hops != 0) {
11015 first_hops_constr.datalen = first_hops->arr_len;
11016 if (first_hops_constr.datalen > 0)
11017 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
11019 first_hops_constr.data = NULL;
11020 uint64_t* first_hops_vals = first_hops->elems;
11021 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
11022 uint64_t first_hops_conv_16 = first_hops_vals[q];
11023 LDKChannelDetails first_hops_conv_16_conv;
11024 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
11025 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
11026 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
11027 first_hops_conv_16_conv.is_owned = false;
11028 first_hops_constr.data[q] = first_hops_conv_16_conv;
11031 first_hops_ptr = &first_hops_constr;
11033 LDKInFlightHtlcs inflight_htlcs_conv;
11034 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
11035 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
11036 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
11037 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
11039 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11040 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, inflight_htlcs_conv);
11041 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
11042 return tag_ptr(ret_conv, true);
11045 void __attribute__((export_name("TS_Router_notify_payment_path_failed"))) TS_Router_notify_payment_path_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
11046 void* this_arg_ptr = untag_ptr(this_arg);
11047 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11048 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
11049 LDKCVec_RouteHopZ path_constr;
11050 path_constr.datalen = path->arr_len;
11051 if (path_constr.datalen > 0)
11052 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11054 path_constr.data = NULL;
11055 uint64_t* path_vals = path->elems;
11056 for (size_t k = 0; k < path_constr.datalen; k++) {
11057 uint64_t path_conv_10 = path_vals[k];
11058 LDKRouteHop path_conv_10_conv;
11059 path_conv_10_conv.inner = untag_ptr(path_conv_10);
11060 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
11061 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
11062 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
11063 path_constr.data[k] = path_conv_10_conv;
11066 (this_arg_conv->notify_payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
11069 void __attribute__((export_name("TS_Router_notify_payment_path_successful"))) TS_Router_notify_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
11070 void* this_arg_ptr = untag_ptr(this_arg);
11071 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11072 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
11073 LDKCVec_RouteHopZ path_constr;
11074 path_constr.datalen = path->arr_len;
11075 if (path_constr.datalen > 0)
11076 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11078 path_constr.data = NULL;
11079 uint64_t* path_vals = path->elems;
11080 for (size_t k = 0; k < path_constr.datalen; k++) {
11081 uint64_t path_conv_10 = path_vals[k];
11082 LDKRouteHop path_conv_10_conv;
11083 path_conv_10_conv.inner = untag_ptr(path_conv_10);
11084 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
11085 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
11086 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
11087 path_constr.data[k] = path_conv_10_conv;
11090 (this_arg_conv->notify_payment_path_successful)(this_arg_conv->this_arg, path_constr);
11093 void __attribute__((export_name("TS_Router_notify_payment_probe_successful"))) TS_Router_notify_payment_probe_successful(uint64_t this_arg, uint64_tArray path) {
11094 void* this_arg_ptr = untag_ptr(this_arg);
11095 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11096 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
11097 LDKCVec_RouteHopZ path_constr;
11098 path_constr.datalen = path->arr_len;
11099 if (path_constr.datalen > 0)
11100 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11102 path_constr.data = NULL;
11103 uint64_t* path_vals = path->elems;
11104 for (size_t k = 0; k < path_constr.datalen; k++) {
11105 uint64_t path_conv_10 = path_vals[k];
11106 LDKRouteHop path_conv_10_conv;
11107 path_conv_10_conv.inner = untag_ptr(path_conv_10);
11108 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
11109 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
11110 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
11111 path_constr.data[k] = path_conv_10_conv;
11114 (this_arg_conv->notify_payment_probe_successful)(this_arg_conv->this_arg, path_constr);
11117 void __attribute__((export_name("TS_Router_notify_payment_probe_failed"))) TS_Router_notify_payment_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
11118 void* this_arg_ptr = untag_ptr(this_arg);
11119 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11120 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
11121 LDKCVec_RouteHopZ path_constr;
11122 path_constr.datalen = path->arr_len;
11123 if (path_constr.datalen > 0)
11124 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11126 path_constr.data = NULL;
11127 uint64_t* path_vals = path->elems;
11128 for (size_t k = 0; k < path_constr.datalen; k++) {
11129 uint64_t path_conv_10 = path_vals[k];
11130 LDKRouteHop path_conv_10_conv;
11131 path_conv_10_conv.inner = untag_ptr(path_conv_10);
11132 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
11133 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
11134 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
11135 path_constr.data[k] = path_conv_10_conv;
11138 (this_arg_conv->notify_payment_probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
11141 uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
11142 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
11144 case LDKRetry_Attempts: return 0;
11148 uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
11149 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
11150 assert(obj->tag == LDKRetry_Attempts);
11151 uint32_t attempts_conv = obj->attempts;
11152 return attempts_conv;
11154 jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
11155 LDKStr ret_str = _ldk_get_compiled_version();
11156 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
11161 jstring __attribute__((export_name("TS__ldk_c_bindings_get_compiled_version"))) TS__ldk_c_bindings_get_compiled_version() {
11162 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
11163 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
11168 uint64_t __attribute__((export_name("TS_BigEndianScalar_new"))) TS_BigEndianScalar_new(int8_tArray big_endian_bytes) {
11169 LDKThirtyTwoBytes big_endian_bytes_ref;
11170 CHECK(big_endian_bytes->arr_len == 32);
11171 memcpy(big_endian_bytes_ref.data, big_endian_bytes->elems, 32); FREE(big_endian_bytes);
11172 LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
11173 *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
11174 return tag_ptr(ret_ref, true);
11177 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
11178 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
11179 *ret_copy = Bech32Error_clone(arg);
11180 uint64_t ret_ref = tag_ptr(ret_copy, true);
11183 int64_t __attribute__((export_name("TS_Bech32Error_clone_ptr"))) TS_Bech32Error_clone_ptr(uint64_t arg) {
11184 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
11185 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
11189 uint64_t __attribute__((export_name("TS_Bech32Error_clone"))) TS_Bech32Error_clone(uint64_t orig) {
11190 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
11191 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
11192 *ret_copy = Bech32Error_clone(orig_conv);
11193 uint64_t ret_ref = tag_ptr(ret_copy, true);
11197 void __attribute__((export_name("TS_Bech32Error_free"))) TS_Bech32Error_free(uint64_t o) {
11198 if (!ptr_is_owned(o)) return;
11199 void* o_ptr = untag_ptr(o);
11200 CHECK_ACCESS(o_ptr);
11201 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
11202 FREE(untag_ptr(o));
11203 Bech32Error_free(o_conv);
11206 void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(int8_tArray _res) {
11207 LDKTransaction _res_ref;
11208 _res_ref.datalen = _res->arr_len;
11209 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
11210 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
11211 _res_ref.data_is_owned = true;
11212 Transaction_free(_res_ref);
11215 uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
11216 LDKCVec_u8Z script_pubkey_ref;
11217 script_pubkey_ref.datalen = script_pubkey->arr_len;
11218 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
11219 memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey);
11220 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11221 *ret_ref = TxOut_new(script_pubkey_ref, value);
11222 return tag_ptr(ret_ref, true);
11225 void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint64_t _res) {
11226 if (!ptr_is_owned(_res)) return;
11227 void* _res_ptr = untag_ptr(_res);
11228 CHECK_ACCESS(_res_ptr);
11229 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
11230 FREE(untag_ptr(_res));
11231 TxOut_free(_res_conv);
11234 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
11235 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11236 *ret_ref = TxOut_clone(arg);
11237 return tag_ptr(ret_ref, true);
11239 int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint64_t arg) {
11240 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
11241 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
11245 uint64_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint64_t orig) {
11246 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
11247 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11248 *ret_ref = TxOut_clone(orig_conv);
11249 return tag_ptr(ret_ref, true);
11252 void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) {
11253 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
11257 void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
11258 LDKCVec_PublicKeyZ _res_constr;
11259 _res_constr.datalen = _res->arr_len;
11260 if (_res_constr.datalen > 0)
11261 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
11263 _res_constr.data = NULL;
11264 int8_tArray* _res_vals = (void*) _res->elems;
11265 for (size_t m = 0; m < _res_constr.datalen; m++) {
11266 int8_tArray _res_conv_12 = _res_vals[m];
11267 LDKPublicKey _res_conv_12_ref;
11268 CHECK(_res_conv_12->arr_len == 33);
11269 memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
11270 _res_constr.data[m] = _res_conv_12_ref;
11273 CVec_PublicKeyZ_free(_res_constr);
11276 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_ok"))) TS_CResult_BlindedRouteNoneZ_ok(uint64_t o) {
11277 LDKBlindedRoute o_conv;
11278 o_conv.inner = untag_ptr(o);
11279 o_conv.is_owned = ptr_is_owned(o);
11280 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11281 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
11283 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
11284 *ret_conv = CResult_BlindedRouteNoneZ_ok(o_conv);
11285 return tag_ptr(ret_conv, true);
11288 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_err"))) TS_CResult_BlindedRouteNoneZ_err() {
11289 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
11290 *ret_conv = CResult_BlindedRouteNoneZ_err();
11291 return tag_ptr(ret_conv, true);
11294 jboolean __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_is_ok"))) TS_CResult_BlindedRouteNoneZ_is_ok(uint64_t o) {
11295 LDKCResult_BlindedRouteNoneZ* o_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(o);
11296 jboolean ret_conv = CResult_BlindedRouteNoneZ_is_ok(o_conv);
11300 void __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_free"))) TS_CResult_BlindedRouteNoneZ_free(uint64_t _res) {
11301 if (!ptr_is_owned(_res)) return;
11302 void* _res_ptr = untag_ptr(_res);
11303 CHECK_ACCESS(_res_ptr);
11304 LDKCResult_BlindedRouteNoneZ _res_conv = *(LDKCResult_BlindedRouteNoneZ*)(_res_ptr);
11305 FREE(untag_ptr(_res));
11306 CResult_BlindedRouteNoneZ_free(_res_conv);
11309 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_ok(uint64_t o) {
11310 LDKBlindedRoute o_conv;
11311 o_conv.inner = untag_ptr(o);
11312 o_conv.is_owned = ptr_is_owned(o);
11313 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11314 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
11316 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
11317 *ret_conv = CResult_BlindedRouteDecodeErrorZ_ok(o_conv);
11318 return tag_ptr(ret_conv, true);
11321 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_err"))) TS_CResult_BlindedRouteDecodeErrorZ_err(uint64_t e) {
11322 void* e_ptr = untag_ptr(e);
11323 CHECK_ACCESS(e_ptr);
11324 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11325 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11326 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
11327 *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv);
11328 return tag_ptr(ret_conv, true);
11331 jboolean __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_is_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_is_ok(uint64_t o) {
11332 LDKCResult_BlindedRouteDecodeErrorZ* o_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(o);
11333 jboolean ret_conv = CResult_BlindedRouteDecodeErrorZ_is_ok(o_conv);
11337 void __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_free"))) TS_CResult_BlindedRouteDecodeErrorZ_free(uint64_t _res) {
11338 if (!ptr_is_owned(_res)) return;
11339 void* _res_ptr = untag_ptr(_res);
11340 CHECK_ACCESS(_res_ptr);
11341 LDKCResult_BlindedRouteDecodeErrorZ _res_conv = *(LDKCResult_BlindedRouteDecodeErrorZ*)(_res_ptr);
11342 FREE(untag_ptr(_res));
11343 CResult_BlindedRouteDecodeErrorZ_free(_res_conv);
11346 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_ok"))) TS_CResult_BlindedHopDecodeErrorZ_ok(uint64_t o) {
11347 LDKBlindedHop o_conv;
11348 o_conv.inner = untag_ptr(o);
11349 o_conv.is_owned = ptr_is_owned(o);
11350 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11351 // WARNING: we need a move here but no clone is available for LDKBlindedHop
11353 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
11354 *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
11355 return tag_ptr(ret_conv, true);
11358 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_err"))) TS_CResult_BlindedHopDecodeErrorZ_err(uint64_t e) {
11359 void* e_ptr = untag_ptr(e);
11360 CHECK_ACCESS(e_ptr);
11361 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11362 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11363 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
11364 *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
11365 return tag_ptr(ret_conv, true);
11368 jboolean __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_is_ok"))) TS_CResult_BlindedHopDecodeErrorZ_is_ok(uint64_t o) {
11369 LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
11370 jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
11374 void __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_free"))) TS_CResult_BlindedHopDecodeErrorZ_free(uint64_t _res) {
11375 if (!ptr_is_owned(_res)) return;
11376 void* _res_ptr = untag_ptr(_res);
11377 CHECK_ACCESS(_res_ptr);
11378 LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
11379 FREE(untag_ptr(_res));
11380 CResult_BlindedHopDecodeErrorZ_free(_res_conv);
11383 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
11384 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11385 *ret_conv = CResult_NoneNoneZ_ok();
11386 return tag_ptr(ret_conv, true);
11389 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() {
11390 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11391 *ret_conv = CResult_NoneNoneZ_err();
11392 return tag_ptr(ret_conv, true);
11395 jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint64_t o) {
11396 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
11397 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
11401 void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint64_t _res) {
11402 if (!ptr_is_owned(_res)) return;
11403 void* _res_ptr = untag_ptr(_res);
11404 CHECK_ACCESS(_res_ptr);
11405 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
11406 FREE(untag_ptr(_res));
11407 CResult_NoneNoneZ_free(_res_conv);
11410 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
11411 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11412 *ret_conv = CResult_NoneNoneZ_clone(arg);
11413 return tag_ptr(ret_conv, true);
11415 int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint64_t arg) {
11416 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
11417 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
11421 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_NoneNoneZ_clone(uint64_t orig) {
11422 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
11423 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11424 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
11425 return tag_ptr(ret_conv, true);
11428 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) {
11429 LDKCounterpartyCommitmentSecrets o_conv;
11430 o_conv.inner = untag_ptr(o);
11431 o_conv.is_owned = ptr_is_owned(o);
11432 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11433 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
11434 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11435 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
11436 return tag_ptr(ret_conv, true);
11439 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
11440 void* e_ptr = untag_ptr(e);
11441 CHECK_ACCESS(e_ptr);
11442 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11443 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11444 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11445 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
11446 return tag_ptr(ret_conv, true);
11449 jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) {
11450 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
11451 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
11455 void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) {
11456 if (!ptr_is_owned(_res)) return;
11457 void* _res_ptr = untag_ptr(_res);
11458 CHECK_ACCESS(_res_ptr);
11459 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
11460 FREE(untag_ptr(_res));
11461 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
11464 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
11465 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11466 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
11467 return tag_ptr(ret_conv, true);
11469 int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) {
11470 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
11471 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
11475 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) {
11476 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
11477 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11478 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
11479 return tag_ptr(ret_conv, true);
11482 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
11483 LDKSecretKey o_ref;
11484 CHECK(o->arr_len == 32);
11485 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
11486 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11487 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
11488 return tag_ptr(ret_conv, true);
11491 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
11492 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11493 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11494 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
11495 return tag_ptr(ret_conv, true);
11498 jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
11499 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
11500 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
11504 void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
11505 if (!ptr_is_owned(_res)) return;
11506 void* _res_ptr = untag_ptr(_res);
11507 CHECK_ACCESS(_res_ptr);
11508 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
11509 FREE(untag_ptr(_res));
11510 CResult_SecretKeyErrorZ_free(_res_conv);
11513 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
11514 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11515 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
11516 return tag_ptr(ret_conv, true);
11518 int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
11519 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
11520 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
11524 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
11525 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
11526 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11527 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
11528 return tag_ptr(ret_conv, true);
11531 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
11532 LDKPublicKey o_ref;
11533 CHECK(o->arr_len == 33);
11534 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
11535 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11536 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
11537 return tag_ptr(ret_conv, true);
11540 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
11541 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11542 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11543 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
11544 return tag_ptr(ret_conv, true);
11547 jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
11548 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
11549 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
11553 void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
11554 if (!ptr_is_owned(_res)) return;
11555 void* _res_ptr = untag_ptr(_res);
11556 CHECK_ACCESS(_res_ptr);
11557 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
11558 FREE(untag_ptr(_res));
11559 CResult_PublicKeyErrorZ_free(_res_conv);
11562 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
11563 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11564 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
11565 return tag_ptr(ret_conv, true);
11567 int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
11568 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
11569 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
11573 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
11574 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
11575 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11576 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
11577 return tag_ptr(ret_conv, true);
11580 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
11581 LDKTxCreationKeys o_conv;
11582 o_conv.inner = untag_ptr(o);
11583 o_conv.is_owned = ptr_is_owned(o);
11584 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11585 o_conv = TxCreationKeys_clone(&o_conv);
11586 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11587 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
11588 return tag_ptr(ret_conv, true);
11591 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
11592 void* e_ptr = untag_ptr(e);
11593 CHECK_ACCESS(e_ptr);
11594 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11595 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11596 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11597 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
11598 return tag_ptr(ret_conv, true);
11601 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
11602 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
11603 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
11607 void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
11608 if (!ptr_is_owned(_res)) return;
11609 void* _res_ptr = untag_ptr(_res);
11610 CHECK_ACCESS(_res_ptr);
11611 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
11612 FREE(untag_ptr(_res));
11613 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
11616 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
11617 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11618 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
11619 return tag_ptr(ret_conv, true);
11621 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
11622 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
11623 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
11627 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
11628 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
11629 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11630 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
11631 return tag_ptr(ret_conv, true);
11634 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
11635 LDKChannelPublicKeys o_conv;
11636 o_conv.inner = untag_ptr(o);
11637 o_conv.is_owned = ptr_is_owned(o);
11638 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11639 o_conv = ChannelPublicKeys_clone(&o_conv);
11640 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11641 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
11642 return tag_ptr(ret_conv, true);
11645 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
11646 void* e_ptr = untag_ptr(e);
11647 CHECK_ACCESS(e_ptr);
11648 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11649 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11650 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11651 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
11652 return tag_ptr(ret_conv, true);
11655 jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) {
11656 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
11657 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
11661 void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) {
11662 if (!ptr_is_owned(_res)) return;
11663 void* _res_ptr = untag_ptr(_res);
11664 CHECK_ACCESS(_res_ptr);
11665 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
11666 FREE(untag_ptr(_res));
11667 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
11670 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
11671 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11672 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
11673 return tag_ptr(ret_conv, true);
11675 int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
11676 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
11677 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
11681 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) {
11682 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
11683 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11684 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
11685 return tag_ptr(ret_conv, true);
11688 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
11689 LDKTxCreationKeys o_conv;
11690 o_conv.inner = untag_ptr(o);
11691 o_conv.is_owned = ptr_is_owned(o);
11692 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11693 o_conv = TxCreationKeys_clone(&o_conv);
11694 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11695 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
11696 return tag_ptr(ret_conv, true);
11699 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
11700 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11701 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11702 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
11703 return tag_ptr(ret_conv, true);
11706 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
11707 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
11708 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
11712 void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
11713 if (!ptr_is_owned(_res)) return;
11714 void* _res_ptr = untag_ptr(_res);
11715 CHECK_ACCESS(_res_ptr);
11716 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
11717 FREE(untag_ptr(_res));
11718 CResult_TxCreationKeysErrorZ_free(_res_conv);
11721 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
11722 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11723 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
11724 return tag_ptr(ret_conv, true);
11726 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
11727 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
11728 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
11732 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
11733 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
11734 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11735 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
11736 return tag_ptr(ret_conv, true);
11739 uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
11740 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11741 *ret_copy = COption_u32Z_some(o);
11742 uint64_t ret_ref = tag_ptr(ret_copy, true);
11746 uint64_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() {
11747 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11748 *ret_copy = COption_u32Z_none();
11749 uint64_t ret_ref = tag_ptr(ret_copy, true);
11753 void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint64_t _res) {
11754 if (!ptr_is_owned(_res)) return;
11755 void* _res_ptr = untag_ptr(_res);
11756 CHECK_ACCESS(_res_ptr);
11757 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
11758 FREE(untag_ptr(_res));
11759 COption_u32Z_free(_res_conv);
11762 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
11763 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11764 *ret_copy = COption_u32Z_clone(arg);
11765 uint64_t ret_ref = tag_ptr(ret_copy, true);
11768 int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint64_t arg) {
11769 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
11770 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
11774 uint64_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_clone(uint64_t orig) {
11775 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
11776 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11777 *ret_copy = COption_u32Z_clone(orig_conv);
11778 uint64_t ret_ref = tag_ptr(ret_copy, true);
11782 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) {
11783 LDKHTLCOutputInCommitment o_conv;
11784 o_conv.inner = untag_ptr(o);
11785 o_conv.is_owned = ptr_is_owned(o);
11786 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11787 o_conv = HTLCOutputInCommitment_clone(&o_conv);
11788 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11789 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
11790 return tag_ptr(ret_conv, true);
11793 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
11794 void* e_ptr = untag_ptr(e);
11795 CHECK_ACCESS(e_ptr);
11796 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11797 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11798 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11799 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
11800 return tag_ptr(ret_conv, true);
11803 jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) {
11804 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
11805 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
11809 void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) {
11810 if (!ptr_is_owned(_res)) return;
11811 void* _res_ptr = untag_ptr(_res);
11812 CHECK_ACCESS(_res_ptr);
11813 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
11814 FREE(untag_ptr(_res));
11815 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
11818 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
11819 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11820 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
11821 return tag_ptr(ret_conv, true);
11823 int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) {
11824 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
11825 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
11829 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) {
11830 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
11831 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11832 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
11833 return tag_ptr(ret_conv, true);
11836 uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() {
11837 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
11841 uint32_t __attribute__((export_name("TS_COption_NoneZ_none"))) TS_COption_NoneZ_none() {
11842 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
11846 void __attribute__((export_name("TS_COption_NoneZ_free"))) TS_COption_NoneZ_free(uint32_t _res) {
11847 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
11848 COption_NoneZ_free(_res_conv);
11851 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
11852 LDKCounterpartyChannelTransactionParameters o_conv;
11853 o_conv.inner = untag_ptr(o);
11854 o_conv.is_owned = ptr_is_owned(o);
11855 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11856 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
11857 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11858 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
11859 return tag_ptr(ret_conv, true);
11862 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
11863 void* e_ptr = untag_ptr(e);
11864 CHECK_ACCESS(e_ptr);
11865 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11866 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11867 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11868 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
11869 return tag_ptr(ret_conv, true);
11872 jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
11873 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
11874 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
11878 void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
11879 if (!ptr_is_owned(_res)) return;
11880 void* _res_ptr = untag_ptr(_res);
11881 CHECK_ACCESS(_res_ptr);
11882 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
11883 FREE(untag_ptr(_res));
11884 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
11887 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
11888 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11889 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
11890 return tag_ptr(ret_conv, true);
11892 int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11893 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
11894 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
11898 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
11899 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
11900 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11901 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
11902 return tag_ptr(ret_conv, true);
11905 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
11906 LDKChannelTransactionParameters o_conv;
11907 o_conv.inner = untag_ptr(o);
11908 o_conv.is_owned = ptr_is_owned(o);
11909 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11910 o_conv = ChannelTransactionParameters_clone(&o_conv);
11911 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11912 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
11913 return tag_ptr(ret_conv, true);
11916 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
11917 void* e_ptr = untag_ptr(e);
11918 CHECK_ACCESS(e_ptr);
11919 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11920 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11921 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11922 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
11923 return tag_ptr(ret_conv, true);
11926 jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
11927 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
11928 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
11932 void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
11933 if (!ptr_is_owned(_res)) return;
11934 void* _res_ptr = untag_ptr(_res);
11935 CHECK_ACCESS(_res_ptr);
11936 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
11937 FREE(untag_ptr(_res));
11938 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
11941 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
11942 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11943 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
11944 return tag_ptr(ret_conv, true);
11946 int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11947 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
11948 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
11952 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
11953 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
11954 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11955 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
11956 return tag_ptr(ret_conv, true);
11959 void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) {
11960 LDKCVec_SignatureZ _res_constr;
11961 _res_constr.datalen = _res->arr_len;
11962 if (_res_constr.datalen > 0)
11963 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
11965 _res_constr.data = NULL;
11966 int8_tArray* _res_vals = (void*) _res->elems;
11967 for (size_t m = 0; m < _res_constr.datalen; m++) {
11968 int8_tArray _res_conv_12 = _res_vals[m];
11969 LDKSignature _res_conv_12_ref;
11970 CHECK(_res_conv_12->arr_len == 64);
11971 memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
11972 _res_constr.data[m] = _res_conv_12_ref;
11975 CVec_SignatureZ_free(_res_constr);
11978 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
11979 LDKHolderCommitmentTransaction o_conv;
11980 o_conv.inner = untag_ptr(o);
11981 o_conv.is_owned = ptr_is_owned(o);
11982 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11983 o_conv = HolderCommitmentTransaction_clone(&o_conv);
11984 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11985 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
11986 return tag_ptr(ret_conv, true);
11989 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
11990 void* e_ptr = untag_ptr(e);
11991 CHECK_ACCESS(e_ptr);
11992 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
11993 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
11994 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11995 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
11996 return tag_ptr(ret_conv, true);
11999 jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
12000 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
12001 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
12005 void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
12006 if (!ptr_is_owned(_res)) return;
12007 void* _res_ptr = untag_ptr(_res);
12008 CHECK_ACCESS(_res_ptr);
12009 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
12010 FREE(untag_ptr(_res));
12011 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
12014 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
12015 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
12016 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
12017 return tag_ptr(ret_conv, true);
12019 int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
12020 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
12021 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
12025 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
12026 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
12027 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
12028 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
12029 return tag_ptr(ret_conv, true);
12032 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
12033 LDKBuiltCommitmentTransaction o_conv;
12034 o_conv.inner = untag_ptr(o);
12035 o_conv.is_owned = ptr_is_owned(o);
12036 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12037 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
12038 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
12039 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
12040 return tag_ptr(ret_conv, true);
12043 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
12044 void* e_ptr = untag_ptr(e);
12045 CHECK_ACCESS(e_ptr);
12046 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12047 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12048 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
12049 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
12050 return tag_ptr(ret_conv, true);
12053 jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
12054 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
12055 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
12059 void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
12060 if (!ptr_is_owned(_res)) return;
12061 void* _res_ptr = untag_ptr(_res);
12062 CHECK_ACCESS(_res_ptr);
12063 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
12064 FREE(untag_ptr(_res));
12065 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
12068 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
12069 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
12070 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
12071 return tag_ptr(ret_conv, true);
12073 int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
12074 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
12075 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
12079 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
12080 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
12081 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
12082 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
12083 return tag_ptr(ret_conv, true);
12086 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) {
12087 LDKTrustedClosingTransaction o_conv;
12088 o_conv.inner = untag_ptr(o);
12089 o_conv.is_owned = ptr_is_owned(o);
12090 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12091 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
12093 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
12094 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
12095 return tag_ptr(ret_conv, true);
12098 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() {
12099 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
12100 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
12101 return tag_ptr(ret_conv, true);
12104 jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) {
12105 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
12106 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
12110 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) {
12111 if (!ptr_is_owned(_res)) return;
12112 void* _res_ptr = untag_ptr(_res);
12113 CHECK_ACCESS(_res_ptr);
12114 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
12115 FREE(untag_ptr(_res));
12116 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
12119 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
12120 LDKCommitmentTransaction o_conv;
12121 o_conv.inner = untag_ptr(o);
12122 o_conv.is_owned = ptr_is_owned(o);
12123 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12124 o_conv = CommitmentTransaction_clone(&o_conv);
12125 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12126 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
12127 return tag_ptr(ret_conv, true);
12130 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
12131 void* e_ptr = untag_ptr(e);
12132 CHECK_ACCESS(e_ptr);
12133 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12134 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12135 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12136 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
12137 return tag_ptr(ret_conv, true);
12140 jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
12141 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
12142 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
12146 void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
12147 if (!ptr_is_owned(_res)) return;
12148 void* _res_ptr = untag_ptr(_res);
12149 CHECK_ACCESS(_res_ptr);
12150 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
12151 FREE(untag_ptr(_res));
12152 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
12155 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
12156 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12157 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
12158 return tag_ptr(ret_conv, true);
12160 int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
12161 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
12162 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
12166 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
12167 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
12168 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12169 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
12170 return tag_ptr(ret_conv, true);
12173 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) {
12174 LDKTrustedCommitmentTransaction o_conv;
12175 o_conv.inner = untag_ptr(o);
12176 o_conv.is_owned = ptr_is_owned(o);
12177 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12178 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
12180 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
12181 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
12182 return tag_ptr(ret_conv, true);
12185 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() {
12186 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
12187 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
12188 return tag_ptr(ret_conv, true);
12191 jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) {
12192 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
12193 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
12197 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) {
12198 if (!ptr_is_owned(_res)) return;
12199 void* _res_ptr = untag_ptr(_res);
12200 CHECK_ACCESS(_res_ptr);
12201 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
12202 FREE(untag_ptr(_res));
12203 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
12206 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_CResult_CVec_SignatureZNoneZ_ok(ptrArray o) {
12207 LDKCVec_SignatureZ o_constr;
12208 o_constr.datalen = o->arr_len;
12209 if (o_constr.datalen > 0)
12210 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
12212 o_constr.data = NULL;
12213 int8_tArray* o_vals = (void*) o->elems;
12214 for (size_t m = 0; m < o_constr.datalen; m++) {
12215 int8_tArray o_conv_12 = o_vals[m];
12216 LDKSignature o_conv_12_ref;
12217 CHECK(o_conv_12->arr_len == 64);
12218 memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
12219 o_constr.data[m] = o_conv_12_ref;
12222 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12223 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
12224 return tag_ptr(ret_conv, true);
12227 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() {
12228 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12229 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
12230 return tag_ptr(ret_conv, true);
12233 jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint64_t o) {
12234 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
12235 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
12239 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint64_t _res) {
12240 if (!ptr_is_owned(_res)) return;
12241 void* _res_ptr = untag_ptr(_res);
12242 CHECK_ACCESS(_res_ptr);
12243 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
12244 FREE(untag_ptr(_res));
12245 CResult_CVec_SignatureZNoneZ_free(_res_conv);
12248 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
12249 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12250 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
12251 return tag_ptr(ret_conv, true);
12253 int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint64_t arg) {
12254 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
12255 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
12259 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint64_t orig) {
12260 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
12261 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12262 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
12263 return tag_ptr(ret_conv, true);
12266 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) {
12267 LDKShutdownScript o_conv;
12268 o_conv.inner = untag_ptr(o);
12269 o_conv.is_owned = ptr_is_owned(o);
12270 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12271 o_conv = ShutdownScript_clone(&o_conv);
12272 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12273 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
12274 return tag_ptr(ret_conv, true);
12277 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
12278 void* e_ptr = untag_ptr(e);
12279 CHECK_ACCESS(e_ptr);
12280 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12281 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12282 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12283 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
12284 return tag_ptr(ret_conv, true);
12287 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) {
12288 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
12289 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
12293 void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) {
12294 if (!ptr_is_owned(_res)) return;
12295 void* _res_ptr = untag_ptr(_res);
12296 CHECK_ACCESS(_res_ptr);
12297 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
12298 FREE(untag_ptr(_res));
12299 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
12302 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
12303 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12304 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
12305 return tag_ptr(ret_conv, true);
12307 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) {
12308 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
12309 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
12313 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) {
12314 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
12315 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12316 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
12317 return tag_ptr(ret_conv, true);
12320 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) {
12321 LDKShutdownScript o_conv;
12322 o_conv.inner = untag_ptr(o);
12323 o_conv.is_owned = ptr_is_owned(o);
12324 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12325 o_conv = ShutdownScript_clone(&o_conv);
12326 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12327 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
12328 return tag_ptr(ret_conv, true);
12331 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) {
12332 LDKInvalidShutdownScript e_conv;
12333 e_conv.inner = untag_ptr(e);
12334 e_conv.is_owned = ptr_is_owned(e);
12335 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12336 e_conv = InvalidShutdownScript_clone(&e_conv);
12337 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12338 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
12339 return tag_ptr(ret_conv, true);
12342 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) {
12343 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
12344 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
12348 void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) {
12349 if (!ptr_is_owned(_res)) return;
12350 void* _res_ptr = untag_ptr(_res);
12351 CHECK_ACCESS(_res_ptr);
12352 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
12353 FREE(untag_ptr(_res));
12354 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
12357 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
12358 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12359 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
12360 return tag_ptr(ret_conv, true);
12362 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) {
12363 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
12364 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
12368 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) {
12369 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
12370 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12371 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
12372 return tag_ptr(ret_conv, true);
12375 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
12376 LDKRouteHop o_conv;
12377 o_conv.inner = untag_ptr(o);
12378 o_conv.is_owned = ptr_is_owned(o);
12379 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12380 o_conv = RouteHop_clone(&o_conv);
12381 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12382 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
12383 return tag_ptr(ret_conv, true);
12386 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
12387 void* e_ptr = untag_ptr(e);
12388 CHECK_ACCESS(e_ptr);
12389 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12390 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12391 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12392 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
12393 return tag_ptr(ret_conv, true);
12396 jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
12397 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
12398 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
12402 void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
12403 if (!ptr_is_owned(_res)) return;
12404 void* _res_ptr = untag_ptr(_res);
12405 CHECK_ACCESS(_res_ptr);
12406 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
12407 FREE(untag_ptr(_res));
12408 CResult_RouteHopDecodeErrorZ_free(_res_conv);
12411 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
12412 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12413 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
12414 return tag_ptr(ret_conv, true);
12416 int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
12417 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
12418 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
12422 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
12423 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
12424 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12425 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
12426 return tag_ptr(ret_conv, true);
12429 void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) {
12430 LDKCVec_RouteHopZ _res_constr;
12431 _res_constr.datalen = _res->arr_len;
12432 if (_res_constr.datalen > 0)
12433 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
12435 _res_constr.data = NULL;
12436 uint64_t* _res_vals = _res->elems;
12437 for (size_t k = 0; k < _res_constr.datalen; k++) {
12438 uint64_t _res_conv_10 = _res_vals[k];
12439 LDKRouteHop _res_conv_10_conv;
12440 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
12441 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
12442 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
12443 _res_constr.data[k] = _res_conv_10_conv;
12446 CVec_RouteHopZ_free(_res_constr);
12449 void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
12450 LDKCVec_CVec_RouteHopZZ _res_constr;
12451 _res_constr.datalen = _res->arr_len;
12452 if (_res_constr.datalen > 0)
12453 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
12455 _res_constr.data = NULL;
12456 uint64_tArray* _res_vals = (void*) _res->elems;
12457 for (size_t m = 0; m < _res_constr.datalen; m++) {
12458 uint64_tArray _res_conv_12 = _res_vals[m];
12459 LDKCVec_RouteHopZ _res_conv_12_constr;
12460 _res_conv_12_constr.datalen = _res_conv_12->arr_len;
12461 if (_res_conv_12_constr.datalen > 0)
12462 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
12464 _res_conv_12_constr.data = NULL;
12465 uint64_t* _res_conv_12_vals = _res_conv_12->elems;
12466 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
12467 uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
12468 LDKRouteHop _res_conv_12_conv_10_conv;
12469 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
12470 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
12471 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
12472 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
12474 FREE(_res_conv_12);
12475 _res_constr.data[m] = _res_conv_12_constr;
12478 CVec_CVec_RouteHopZZ_free(_res_constr);
12481 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) {
12483 o_conv.inner = untag_ptr(o);
12484 o_conv.is_owned = ptr_is_owned(o);
12485 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12486 o_conv = Route_clone(&o_conv);
12487 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12488 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
12489 return tag_ptr(ret_conv, true);
12492 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
12493 void* e_ptr = untag_ptr(e);
12494 CHECK_ACCESS(e_ptr);
12495 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12496 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12497 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12498 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
12499 return tag_ptr(ret_conv, true);
12502 jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint64_t o) {
12503 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
12504 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
12508 void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint64_t _res) {
12509 if (!ptr_is_owned(_res)) return;
12510 void* _res_ptr = untag_ptr(_res);
12511 CHECK_ACCESS(_res_ptr);
12512 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
12513 FREE(untag_ptr(_res));
12514 CResult_RouteDecodeErrorZ_free(_res_conv);
12517 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
12518 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12519 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
12520 return tag_ptr(ret_conv, true);
12522 int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint64_t arg) {
12523 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
12524 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
12528 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_CResult_RouteDecodeErrorZ_clone(uint64_t orig) {
12529 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
12530 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12531 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
12532 return tag_ptr(ret_conv, true);
12535 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint64_t o) {
12536 LDKRouteParameters o_conv;
12537 o_conv.inner = untag_ptr(o);
12538 o_conv.is_owned = ptr_is_owned(o);
12539 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12540 o_conv = RouteParameters_clone(&o_conv);
12541 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12542 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
12543 return tag_ptr(ret_conv, true);
12546 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
12547 void* e_ptr = untag_ptr(e);
12548 CHECK_ACCESS(e_ptr);
12549 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12550 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12551 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12552 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
12553 return tag_ptr(ret_conv, true);
12556 jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint64_t o) {
12557 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
12558 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
12562 void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint64_t _res) {
12563 if (!ptr_is_owned(_res)) return;
12564 void* _res_ptr = untag_ptr(_res);
12565 CHECK_ACCESS(_res_ptr);
12566 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
12567 FREE(untag_ptr(_res));
12568 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
12571 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
12572 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12573 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
12574 return tag_ptr(ret_conv, true);
12576 int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
12577 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
12578 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
12582 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint64_t orig) {
12583 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
12584 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12585 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
12586 return tag_ptr(ret_conv, true);
12589 void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) {
12590 LDKCVec_RouteHintZ _res_constr;
12591 _res_constr.datalen = _res->arr_len;
12592 if (_res_constr.datalen > 0)
12593 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
12595 _res_constr.data = NULL;
12596 uint64_t* _res_vals = _res->elems;
12597 for (size_t l = 0; l < _res_constr.datalen; l++) {
12598 uint64_t _res_conv_11 = _res_vals[l];
12599 LDKRouteHint _res_conv_11_conv;
12600 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
12601 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
12602 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
12603 _res_constr.data[l] = _res_conv_11_conv;
12606 CVec_RouteHintZ_free(_res_constr);
12609 uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
12610 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12611 *ret_copy = COption_u64Z_some(o);
12612 uint64_t ret_ref = tag_ptr(ret_copy, true);
12616 uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
12617 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12618 *ret_copy = COption_u64Z_none();
12619 uint64_t ret_ref = tag_ptr(ret_copy, true);
12623 void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
12624 if (!ptr_is_owned(_res)) return;
12625 void* _res_ptr = untag_ptr(_res);
12626 CHECK_ACCESS(_res_ptr);
12627 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
12628 FREE(untag_ptr(_res));
12629 COption_u64Z_free(_res_conv);
12632 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
12633 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12634 *ret_copy = COption_u64Z_clone(arg);
12635 uint64_t ret_ref = tag_ptr(ret_copy, true);
12638 int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
12639 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
12640 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
12644 uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
12645 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
12646 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12647 *ret_copy = COption_u64Z_clone(orig_conv);
12648 uint64_t ret_ref = tag_ptr(ret_copy, true);
12652 void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
12653 LDKCVec_u64Z _res_constr;
12654 _res_constr.datalen = _res->arr_len;
12655 if (_res_constr.datalen > 0)
12656 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
12658 _res_constr.data = NULL;
12659 int64_t* _res_vals = _res->elems;
12660 for (size_t i = 0; i < _res_constr.datalen; i++) {
12661 int64_t _res_conv_8 = _res_vals[i];
12662 _res_constr.data[i] = _res_conv_8;
12665 CVec_u64Z_free(_res_constr);
12668 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_ok(uint64_t o) {
12669 LDKPaymentParameters o_conv;
12670 o_conv.inner = untag_ptr(o);
12671 o_conv.is_owned = ptr_is_owned(o);
12672 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12673 o_conv = PaymentParameters_clone(&o_conv);
12674 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12675 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
12676 return tag_ptr(ret_conv, true);
12679 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
12680 void* e_ptr = untag_ptr(e);
12681 CHECK_ACCESS(e_ptr);
12682 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12683 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12684 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12685 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
12686 return tag_ptr(ret_conv, true);
12689 jboolean __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_is_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_is_ok(uint64_t o) {
12690 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
12691 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
12695 void __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_free"))) TS_CResult_PaymentParametersDecodeErrorZ_free(uint64_t _res) {
12696 if (!ptr_is_owned(_res)) return;
12697 void* _res_ptr = untag_ptr(_res);
12698 CHECK_ACCESS(_res_ptr);
12699 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
12700 FREE(untag_ptr(_res));
12701 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
12704 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
12705 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12706 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
12707 return tag_ptr(ret_conv, true);
12709 int64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
12710 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
12711 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
12715 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone"))) TS_CResult_PaymentParametersDecodeErrorZ_clone(uint64_t orig) {
12716 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
12717 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12718 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
12719 return tag_ptr(ret_conv, true);
12722 void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) {
12723 LDKCVec_RouteHintHopZ _res_constr;
12724 _res_constr.datalen = _res->arr_len;
12725 if (_res_constr.datalen > 0)
12726 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
12728 _res_constr.data = NULL;
12729 uint64_t* _res_vals = _res->elems;
12730 for (size_t o = 0; o < _res_constr.datalen; o++) {
12731 uint64_t _res_conv_14 = _res_vals[o];
12732 LDKRouteHintHop _res_conv_14_conv;
12733 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
12734 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
12735 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
12736 _res_constr.data[o] = _res_conv_14_conv;
12739 CVec_RouteHintHopZ_free(_res_constr);
12742 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint64_t o) {
12743 LDKRouteHint o_conv;
12744 o_conv.inner = untag_ptr(o);
12745 o_conv.is_owned = ptr_is_owned(o);
12746 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12747 o_conv = RouteHint_clone(&o_conv);
12748 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12749 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
12750 return tag_ptr(ret_conv, true);
12753 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
12754 void* e_ptr = untag_ptr(e);
12755 CHECK_ACCESS(e_ptr);
12756 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12757 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12758 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12759 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
12760 return tag_ptr(ret_conv, true);
12763 jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint64_t o) {
12764 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
12765 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
12769 void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint64_t _res) {
12770 if (!ptr_is_owned(_res)) return;
12771 void* _res_ptr = untag_ptr(_res);
12772 CHECK_ACCESS(_res_ptr);
12773 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
12774 FREE(untag_ptr(_res));
12775 CResult_RouteHintDecodeErrorZ_free(_res_conv);
12778 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
12779 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12780 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
12781 return tag_ptr(ret_conv, true);
12783 int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint64_t arg) {
12784 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
12785 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
12789 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint64_t orig) {
12790 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
12791 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12792 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
12793 return tag_ptr(ret_conv, true);
12796 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint64_t o) {
12797 LDKRouteHintHop o_conv;
12798 o_conv.inner = untag_ptr(o);
12799 o_conv.is_owned = ptr_is_owned(o);
12800 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12801 o_conv = RouteHintHop_clone(&o_conv);
12802 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12803 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
12804 return tag_ptr(ret_conv, true);
12807 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
12808 void* e_ptr = untag_ptr(e);
12809 CHECK_ACCESS(e_ptr);
12810 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12811 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12812 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12813 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
12814 return tag_ptr(ret_conv, true);
12817 jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint64_t o) {
12818 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
12819 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
12823 void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint64_t _res) {
12824 if (!ptr_is_owned(_res)) return;
12825 void* _res_ptr = untag_ptr(_res);
12826 CHECK_ACCESS(_res_ptr);
12827 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
12828 FREE(untag_ptr(_res));
12829 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
12832 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
12833 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12834 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
12835 return tag_ptr(ret_conv, true);
12837 int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint64_t arg) {
12838 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
12839 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
12843 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint64_t orig) {
12844 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
12845 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12846 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
12847 return tag_ptr(ret_conv, true);
12850 void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
12851 LDKCVec_ChannelDetailsZ _res_constr;
12852 _res_constr.datalen = _res->arr_len;
12853 if (_res_constr.datalen > 0)
12854 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
12856 _res_constr.data = NULL;
12857 uint64_t* _res_vals = _res->elems;
12858 for (size_t q = 0; q < _res_constr.datalen; q++) {
12859 uint64_t _res_conv_16 = _res_vals[q];
12860 LDKChannelDetails _res_conv_16_conv;
12861 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
12862 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
12863 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
12864 _res_constr.data[q] = _res_conv_16_conv;
12867 CVec_ChannelDetailsZ_free(_res_constr);
12870 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
12872 o_conv.inner = untag_ptr(o);
12873 o_conv.is_owned = ptr_is_owned(o);
12874 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12875 o_conv = Route_clone(&o_conv);
12876 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12877 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
12878 return tag_ptr(ret_conv, true);
12881 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
12882 LDKLightningError e_conv;
12883 e_conv.inner = untag_ptr(e);
12884 e_conv.is_owned = ptr_is_owned(e);
12885 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12886 e_conv = LightningError_clone(&e_conv);
12887 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12888 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
12889 return tag_ptr(ret_conv, true);
12892 jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
12893 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
12894 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
12898 void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
12899 if (!ptr_is_owned(_res)) return;
12900 void* _res_ptr = untag_ptr(_res);
12901 CHECK_ACCESS(_res_ptr);
12902 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
12903 FREE(untag_ptr(_res));
12904 CResult_RouteLightningErrorZ_free(_res_conv);
12907 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
12908 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12909 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
12910 return tag_ptr(ret_conv, true);
12912 int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
12913 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
12914 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
12918 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
12919 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
12920 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12921 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
12922 return tag_ptr(ret_conv, true);
12925 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
12926 void* o_ptr = untag_ptr(o);
12927 CHECK_ACCESS(o_ptr);
12928 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
12929 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
12930 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12931 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
12932 return tag_ptr(ret_conv, true);
12935 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
12936 void* e_ptr = untag_ptr(e);
12937 CHECK_ACCESS(e_ptr);
12938 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
12939 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
12940 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12941 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
12942 return tag_ptr(ret_conv, true);
12945 jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
12946 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
12947 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
12951 void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
12952 if (!ptr_is_owned(_res)) return;
12953 void* _res_ptr = untag_ptr(_res);
12954 CHECK_ACCESS(_res_ptr);
12955 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
12956 FREE(untag_ptr(_res));
12957 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
12960 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
12961 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12962 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
12963 return tag_ptr(ret_conv, true);
12965 int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
12966 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
12967 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
12971 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
12972 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
12973 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12974 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
12975 return tag_ptr(ret_conv, true);
12978 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) {
12979 void* o_ptr = untag_ptr(o);
12980 CHECK_ACCESS(o_ptr);
12981 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
12982 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
12983 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12984 *ret_copy = COption_ClosureReasonZ_some(o_conv);
12985 uint64_t ret_ref = tag_ptr(ret_copy, true);
12989 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() {
12990 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12991 *ret_copy = COption_ClosureReasonZ_none();
12992 uint64_t ret_ref = tag_ptr(ret_copy, true);
12996 void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) {
12997 if (!ptr_is_owned(_res)) return;
12998 void* _res_ptr = untag_ptr(_res);
12999 CHECK_ACCESS(_res_ptr);
13000 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
13001 FREE(untag_ptr(_res));
13002 COption_ClosureReasonZ_free(_res_conv);
13005 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
13006 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
13007 *ret_copy = COption_ClosureReasonZ_clone(arg);
13008 uint64_t ret_ref = tag_ptr(ret_copy, true);
13011 int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) {
13012 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
13013 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
13017 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) {
13018 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
13019 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
13020 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
13021 uint64_t ret_ref = tag_ptr(ret_copy, true);
13025 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) {
13026 void* o_ptr = untag_ptr(o);
13027 CHECK_ACCESS(o_ptr);
13028 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
13029 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
13030 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
13031 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
13032 return tag_ptr(ret_conv, true);
13035 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
13036 void* e_ptr = untag_ptr(e);
13037 CHECK_ACCESS(e_ptr);
13038 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13039 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13040 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
13041 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
13042 return tag_ptr(ret_conv, true);
13045 jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) {
13046 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
13047 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
13051 void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) {
13052 if (!ptr_is_owned(_res)) return;
13053 void* _res_ptr = untag_ptr(_res);
13054 CHECK_ACCESS(_res_ptr);
13055 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
13056 FREE(untag_ptr(_res));
13057 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
13060 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
13061 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
13062 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
13063 return tag_ptr(ret_conv, true);
13065 int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) {
13066 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
13067 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
13071 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) {
13072 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
13073 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
13074 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
13075 return tag_ptr(ret_conv, true);
13078 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) {
13079 void* o_ptr = untag_ptr(o);
13080 CHECK_ACCESS(o_ptr);
13081 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
13082 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
13083 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13084 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
13085 uint64_t ret_ref = tag_ptr(ret_copy, true);
13089 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() {
13090 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13091 *ret_copy = COption_HTLCDestinationZ_none();
13092 uint64_t ret_ref = tag_ptr(ret_copy, true);
13096 void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) {
13097 if (!ptr_is_owned(_res)) return;
13098 void* _res_ptr = untag_ptr(_res);
13099 CHECK_ACCESS(_res_ptr);
13100 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
13101 FREE(untag_ptr(_res));
13102 COption_HTLCDestinationZ_free(_res_conv);
13105 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
13106 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13107 *ret_copy = COption_HTLCDestinationZ_clone(arg);
13108 uint64_t ret_ref = tag_ptr(ret_copy, true);
13111 int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) {
13112 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
13113 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
13117 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) {
13118 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
13119 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13120 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
13121 uint64_t ret_ref = tag_ptr(ret_copy, true);
13125 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) {
13126 void* o_ptr = untag_ptr(o);
13127 CHECK_ACCESS(o_ptr);
13128 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
13129 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
13130 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13131 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
13132 return tag_ptr(ret_conv, true);
13135 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
13136 void* e_ptr = untag_ptr(e);
13137 CHECK_ACCESS(e_ptr);
13138 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13139 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13140 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13141 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
13142 return tag_ptr(ret_conv, true);
13145 jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) {
13146 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
13147 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
13151 void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) {
13152 if (!ptr_is_owned(_res)) return;
13153 void* _res_ptr = untag_ptr(_res);
13154 CHECK_ACCESS(_res_ptr);
13155 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
13156 FREE(untag_ptr(_res));
13157 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
13160 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
13161 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13162 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
13163 return tag_ptr(ret_conv, true);
13165 int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) {
13166 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
13167 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
13171 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) {
13172 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
13173 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13174 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
13175 return tag_ptr(ret_conv, true);
13178 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
13179 void* o_ptr = untag_ptr(o);
13180 CHECK_ACCESS(o_ptr);
13181 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
13182 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
13183 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13184 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
13185 uint64_t ret_ref = tag_ptr(ret_copy, true);
13189 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
13190 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13191 *ret_copy = COption_NetworkUpdateZ_none();
13192 uint64_t ret_ref = tag_ptr(ret_copy, true);
13196 void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
13197 if (!ptr_is_owned(_res)) return;
13198 void* _res_ptr = untag_ptr(_res);
13199 CHECK_ACCESS(_res_ptr);
13200 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
13201 FREE(untag_ptr(_res));
13202 COption_NetworkUpdateZ_free(_res_conv);
13205 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
13206 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13207 *ret_copy = COption_NetworkUpdateZ_clone(arg);
13208 uint64_t ret_ref = tag_ptr(ret_copy, true);
13211 int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
13212 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
13213 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
13217 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
13218 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
13219 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13220 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
13221 uint64_t ret_ref = tag_ptr(ret_copy, true);
13225 void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) {
13226 LDKCVec_SpendableOutputDescriptorZ _res_constr;
13227 _res_constr.datalen = _res->arr_len;
13228 if (_res_constr.datalen > 0)
13229 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
13231 _res_constr.data = NULL;
13232 uint64_t* _res_vals = _res->elems;
13233 for (size_t b = 0; b < _res_constr.datalen; b++) {
13234 uint64_t _res_conv_27 = _res_vals[b];
13235 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
13236 CHECK_ACCESS(_res_conv_27_ptr);
13237 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
13238 FREE(untag_ptr(_res_conv_27));
13239 _res_constr.data[b] = _res_conv_27_conv;
13242 CVec_SpendableOutputDescriptorZ_free(_res_constr);
13245 uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) {
13246 void* o_ptr = untag_ptr(o);
13247 CHECK_ACCESS(o_ptr);
13248 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
13249 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
13250 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13251 *ret_copy = COption_EventZ_some(o_conv);
13252 uint64_t ret_ref = tag_ptr(ret_copy, true);
13256 uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() {
13257 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13258 *ret_copy = COption_EventZ_none();
13259 uint64_t ret_ref = tag_ptr(ret_copy, true);
13263 void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) {
13264 if (!ptr_is_owned(_res)) return;
13265 void* _res_ptr = untag_ptr(_res);
13266 CHECK_ACCESS(_res_ptr);
13267 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
13268 FREE(untag_ptr(_res));
13269 COption_EventZ_free(_res_conv);
13272 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
13273 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13274 *ret_copy = COption_EventZ_clone(arg);
13275 uint64_t ret_ref = tag_ptr(ret_copy, true);
13278 int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) {
13279 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
13280 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
13284 uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) {
13285 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
13286 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13287 *ret_copy = COption_EventZ_clone(orig_conv);
13288 uint64_t ret_ref = tag_ptr(ret_copy, true);
13292 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) {
13293 void* o_ptr = untag_ptr(o);
13294 CHECK_ACCESS(o_ptr);
13295 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
13296 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
13297 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13298 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
13299 return tag_ptr(ret_conv, true);
13302 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
13303 void* e_ptr = untag_ptr(e);
13304 CHECK_ACCESS(e_ptr);
13305 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13306 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13307 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13308 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
13309 return tag_ptr(ret_conv, true);
13312 jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) {
13313 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
13314 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
13318 void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) {
13319 if (!ptr_is_owned(_res)) return;
13320 void* _res_ptr = untag_ptr(_res);
13321 CHECK_ACCESS(_res_ptr);
13322 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
13323 FREE(untag_ptr(_res));
13324 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
13327 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
13328 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13329 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
13330 return tag_ptr(ret_conv, true);
13332 int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) {
13333 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
13334 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
13338 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) {
13339 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
13340 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13341 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
13342 return tag_ptr(ret_conv, true);
13345 void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) {
13346 LDKCVec_MessageSendEventZ _res_constr;
13347 _res_constr.datalen = _res->arr_len;
13348 if (_res_constr.datalen > 0)
13349 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
13351 _res_constr.data = NULL;
13352 uint64_t* _res_vals = _res->elems;
13353 for (size_t s = 0; s < _res_constr.datalen; s++) {
13354 uint64_t _res_conv_18 = _res_vals[s];
13355 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
13356 CHECK_ACCESS(_res_conv_18_ptr);
13357 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
13358 FREE(untag_ptr(_res_conv_18));
13359 _res_constr.data[s] = _res_conv_18_conv;
13362 CVec_MessageSendEventZ_free(_res_constr);
13365 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
13366 void* o_ptr = untag_ptr(o);
13367 CHECK_ACCESS(o_ptr);
13368 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
13369 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
13370 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13371 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
13372 return tag_ptr(ret_conv, true);
13375 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
13376 LDKAccessError e_conv = LDKAccessError_from_js(e);
13377 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13378 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
13379 return tag_ptr(ret_conv, true);
13382 jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
13383 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
13384 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
13388 void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
13389 if (!ptr_is_owned(_res)) return;
13390 void* _res_ptr = untag_ptr(_res);
13391 CHECK_ACCESS(_res_ptr);
13392 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
13393 FREE(untag_ptr(_res));
13394 CResult_TxOutAccessErrorZ_free(_res_conv);
13397 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
13398 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13399 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
13400 return tag_ptr(ret_conv, true);
13402 int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
13403 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
13404 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
13408 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
13409 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
13410 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13411 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
13412 return tag_ptr(ret_conv, true);
13415 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
13416 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13417 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
13418 return tag_ptr(ret_conv, true);
13420 int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) {
13421 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
13422 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
13426 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) {
13427 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
13428 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13429 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
13430 return tag_ptr(ret_conv, true);
13433 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) {
13434 LDKTransaction b_ref;
13435 b_ref.datalen = b->arr_len;
13436 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
13437 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
13438 b_ref.data_is_owned = true;
13439 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13440 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
13441 return tag_ptr(ret_conv, true);
13444 void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) {
13445 if (!ptr_is_owned(_res)) return;
13446 void* _res_ptr = untag_ptr(_res);
13447 CHECK_ACCESS(_res_ptr);
13448 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
13449 FREE(untag_ptr(_res));
13450 C2Tuple_usizeTransactionZ_free(_res_conv);
13453 void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) {
13454 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
13455 _res_constr.datalen = _res->arr_len;
13456 if (_res_constr.datalen > 0)
13457 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
13459 _res_constr.data = NULL;
13460 uint64_t* _res_vals = _res->elems;
13461 for (size_t c = 0; c < _res_constr.datalen; c++) {
13462 uint64_t _res_conv_28 = _res_vals[c];
13463 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
13464 CHECK_ACCESS(_res_conv_28_ptr);
13465 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
13466 FREE(untag_ptr(_res_conv_28));
13467 _res_constr.data[c] = _res_conv_28_conv;
13470 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
13473 void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
13474 LDKCVec_TxidZ _res_constr;
13475 _res_constr.datalen = _res->arr_len;
13476 if (_res_constr.datalen > 0)
13477 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
13479 _res_constr.data = NULL;
13480 int8_tArray* _res_vals = (void*) _res->elems;
13481 for (size_t m = 0; m < _res_constr.datalen; m++) {
13482 int8_tArray _res_conv_12 = _res_vals[m];
13483 LDKThirtyTwoBytes _res_conv_12_ref;
13484 CHECK(_res_conv_12->arr_len == 32);
13485 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
13486 _res_constr.data[m] = _res_conv_12_ref;
13489 CVec_TxidZ_free(_res_constr);
13492 void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
13493 LDKCVec_MonitorEventZ _res_constr;
13494 _res_constr.datalen = _res->arr_len;
13495 if (_res_constr.datalen > 0)
13496 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
13498 _res_constr.data = NULL;
13499 uint64_t* _res_vals = _res->elems;
13500 for (size_t o = 0; o < _res_constr.datalen; o++) {
13501 uint64_t _res_conv_14 = _res_vals[o];
13502 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
13503 CHECK_ACCESS(_res_conv_14_ptr);
13504 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
13505 FREE(untag_ptr(_res_conv_14));
13506 _res_constr.data[o] = _res_conv_14_conv;
13509 CVec_MonitorEventZ_free(_res_constr);
13512 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
13513 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13514 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
13515 return tag_ptr(ret_conv, true);
13517 int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) {
13518 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
13519 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
13523 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) {
13524 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
13525 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13526 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
13527 return tag_ptr(ret_conv, true);
13530 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) {
13531 LDKOutPoint a_conv;
13532 a_conv.inner = untag_ptr(a);
13533 a_conv.is_owned = ptr_is_owned(a);
13534 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
13535 a_conv = OutPoint_clone(&a_conv);
13536 LDKCVec_MonitorEventZ b_constr;
13537 b_constr.datalen = b->arr_len;
13538 if (b_constr.datalen > 0)
13539 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
13541 b_constr.data = NULL;
13542 uint64_t* b_vals = b->elems;
13543 for (size_t o = 0; o < b_constr.datalen; o++) {
13544 uint64_t b_conv_14 = b_vals[o];
13545 void* b_conv_14_ptr = untag_ptr(b_conv_14);
13546 CHECK_ACCESS(b_conv_14_ptr);
13547 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
13548 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
13549 b_constr.data[o] = b_conv_14_conv;
13552 LDKPublicKey c_ref;
13553 CHECK(c->arr_len == 33);
13554 memcpy(c_ref.compressed_form, c->elems, 33); FREE(c);
13555 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13556 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
13557 return tag_ptr(ret_conv, true);
13560 void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) {
13561 if (!ptr_is_owned(_res)) return;
13562 void* _res_ptr = untag_ptr(_res);
13563 CHECK_ACCESS(_res_ptr);
13564 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
13565 FREE(untag_ptr(_res));
13566 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
13569 void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) {
13570 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
13571 _res_constr.datalen = _res->arr_len;
13572 if (_res_constr.datalen > 0)
13573 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
13575 _res_constr.data = NULL;
13576 uint64_t* _res_vals = _res->elems;
13577 for (size_t x = 0; x < _res_constr.datalen; x++) {
13578 uint64_t _res_conv_49 = _res_vals[x];
13579 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
13580 CHECK_ACCESS(_res_conv_49_ptr);
13581 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
13582 FREE(untag_ptr(_res_conv_49));
13583 _res_constr.data[x] = _res_conv_49_conv;
13586 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
13589 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
13590 LDKFixedPenaltyScorer o_conv;
13591 o_conv.inner = untag_ptr(o);
13592 o_conv.is_owned = ptr_is_owned(o);
13593 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13594 o_conv = FixedPenaltyScorer_clone(&o_conv);
13595 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13596 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
13597 return tag_ptr(ret_conv, true);
13600 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
13601 void* e_ptr = untag_ptr(e);
13602 CHECK_ACCESS(e_ptr);
13603 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13604 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13605 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13606 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
13607 return tag_ptr(ret_conv, true);
13610 jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) {
13611 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
13612 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
13616 void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) {
13617 if (!ptr_is_owned(_res)) return;
13618 void* _res_ptr = untag_ptr(_res);
13619 CHECK_ACCESS(_res_ptr);
13620 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
13621 FREE(untag_ptr(_res));
13622 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
13625 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
13626 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13627 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
13628 return tag_ptr(ret_conv, true);
13630 int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) {
13631 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
13632 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
13636 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) {
13637 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
13638 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13639 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
13640 return tag_ptr(ret_conv, true);
13643 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
13644 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13645 *ret_conv = C2Tuple_u64u64Z_clone(arg);
13646 return tag_ptr(ret_conv, true);
13648 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) {
13649 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
13650 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
13654 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) {
13655 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
13656 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13657 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
13658 return tag_ptr(ret_conv, true);
13661 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
13662 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13663 *ret_conv = C2Tuple_u64u64Z_new(a, b);
13664 return tag_ptr(ret_conv, true);
13667 void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) {
13668 if (!ptr_is_owned(_res)) return;
13669 void* _res_ptr = untag_ptr(_res);
13670 CHECK_ACCESS(_res_ptr);
13671 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
13672 FREE(untag_ptr(_res));
13673 C2Tuple_u64u64Z_free(_res_conv);
13676 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) {
13677 void* o_ptr = untag_ptr(o);
13678 CHECK_ACCESS(o_ptr);
13679 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
13680 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
13681 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13682 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
13683 uint64_t ret_ref = tag_ptr(ret_copy, true);
13687 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() {
13688 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13689 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
13690 uint64_t ret_ref = tag_ptr(ret_copy, true);
13694 void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) {
13695 if (!ptr_is_owned(_res)) return;
13696 void* _res_ptr = untag_ptr(_res);
13697 CHECK_ACCESS(_res_ptr);
13698 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
13699 FREE(untag_ptr(_res));
13700 COption_C2Tuple_u64u64ZZ_free(_res_conv);
13703 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
13704 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13705 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
13706 uint64_t ret_ref = tag_ptr(ret_copy, true);
13709 int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) {
13710 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
13711 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
13715 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) {
13716 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
13717 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13718 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
13719 uint64_t ret_ref = tag_ptr(ret_copy, true);
13723 void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
13724 LDKCVec_NodeIdZ _res_constr;
13725 _res_constr.datalen = _res->arr_len;
13726 if (_res_constr.datalen > 0)
13727 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
13729 _res_constr.data = NULL;
13730 uint64_t* _res_vals = _res->elems;
13731 for (size_t i = 0; i < _res_constr.datalen; i++) {
13732 uint64_t _res_conv_8 = _res_vals[i];
13733 LDKNodeId _res_conv_8_conv;
13734 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
13735 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
13736 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
13737 _res_constr.data[i] = _res_conv_8_conv;
13740 CVec_NodeIdZ_free(_res_constr);
13743 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) {
13744 LDKProbabilisticScorer o_conv;
13745 o_conv.inner = untag_ptr(o);
13746 o_conv.is_owned = ptr_is_owned(o);
13747 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13748 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
13750 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
13751 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
13752 return tag_ptr(ret_conv, true);
13755 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
13756 void* e_ptr = untag_ptr(e);
13757 CHECK_ACCESS(e_ptr);
13758 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13759 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13760 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
13761 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
13762 return tag_ptr(ret_conv, true);
13765 jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) {
13766 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
13767 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
13771 void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) {
13772 if (!ptr_is_owned(_res)) return;
13773 void* _res_ptr = untag_ptr(_res);
13774 CHECK_ACCESS(_res_ptr);
13775 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
13776 FREE(untag_ptr(_res));
13777 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
13780 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) {
13781 LDKInitFeatures o_conv;
13782 o_conv.inner = untag_ptr(o);
13783 o_conv.is_owned = ptr_is_owned(o);
13784 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13785 o_conv = InitFeatures_clone(&o_conv);
13786 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13787 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
13788 return tag_ptr(ret_conv, true);
13791 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
13792 void* e_ptr = untag_ptr(e);
13793 CHECK_ACCESS(e_ptr);
13794 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13795 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13796 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13797 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
13798 return tag_ptr(ret_conv, true);
13801 jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13802 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
13803 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
13807 void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) {
13808 if (!ptr_is_owned(_res)) return;
13809 void* _res_ptr = untag_ptr(_res);
13810 CHECK_ACCESS(_res_ptr);
13811 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
13812 FREE(untag_ptr(_res));
13813 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
13816 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13817 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13818 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
13819 return tag_ptr(ret_conv, true);
13821 int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13822 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
13823 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13827 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) {
13828 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
13829 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13830 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
13831 return tag_ptr(ret_conv, true);
13834 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) {
13835 LDKChannelFeatures o_conv;
13836 o_conv.inner = untag_ptr(o);
13837 o_conv.is_owned = ptr_is_owned(o);
13838 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13839 o_conv = ChannelFeatures_clone(&o_conv);
13840 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13841 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
13842 return tag_ptr(ret_conv, true);
13845 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
13846 void* e_ptr = untag_ptr(e);
13847 CHECK_ACCESS(e_ptr);
13848 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13849 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13850 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13851 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
13852 return tag_ptr(ret_conv, true);
13855 jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13856 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
13857 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
13861 void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) {
13862 if (!ptr_is_owned(_res)) return;
13863 void* _res_ptr = untag_ptr(_res);
13864 CHECK_ACCESS(_res_ptr);
13865 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
13866 FREE(untag_ptr(_res));
13867 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
13870 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13871 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13872 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
13873 return tag_ptr(ret_conv, true);
13875 int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13876 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
13877 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13881 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) {
13882 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
13883 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13884 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
13885 return tag_ptr(ret_conv, true);
13888 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) {
13889 LDKNodeFeatures o_conv;
13890 o_conv.inner = untag_ptr(o);
13891 o_conv.is_owned = ptr_is_owned(o);
13892 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13893 o_conv = NodeFeatures_clone(&o_conv);
13894 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13895 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
13896 return tag_ptr(ret_conv, true);
13899 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
13900 void* e_ptr = untag_ptr(e);
13901 CHECK_ACCESS(e_ptr);
13902 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13903 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13904 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13905 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
13906 return tag_ptr(ret_conv, true);
13909 jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13910 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
13911 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
13915 void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) {
13916 if (!ptr_is_owned(_res)) return;
13917 void* _res_ptr = untag_ptr(_res);
13918 CHECK_ACCESS(_res_ptr);
13919 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
13920 FREE(untag_ptr(_res));
13921 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
13924 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13925 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13926 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
13927 return tag_ptr(ret_conv, true);
13929 int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13930 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
13931 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13935 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) {
13936 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
13937 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13938 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
13939 return tag_ptr(ret_conv, true);
13942 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) {
13943 LDKInvoiceFeatures o_conv;
13944 o_conv.inner = untag_ptr(o);
13945 o_conv.is_owned = ptr_is_owned(o);
13946 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13947 o_conv = InvoiceFeatures_clone(&o_conv);
13948 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13949 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
13950 return tag_ptr(ret_conv, true);
13953 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
13954 void* e_ptr = untag_ptr(e);
13955 CHECK_ACCESS(e_ptr);
13956 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
13957 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
13958 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13959 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
13960 return tag_ptr(ret_conv, true);
13963 jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13964 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
13965 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
13969 void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) {
13970 if (!ptr_is_owned(_res)) return;
13971 void* _res_ptr = untag_ptr(_res);
13972 CHECK_ACCESS(_res_ptr);
13973 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
13974 FREE(untag_ptr(_res));
13975 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
13978 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13979 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13980 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
13981 return tag_ptr(ret_conv, true);
13983 int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13984 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
13985 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13989 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) {
13990 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
13991 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13992 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
13993 return tag_ptr(ret_conv, true);
13996 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
13997 LDKChannelTypeFeatures o_conv;
13998 o_conv.inner = untag_ptr(o);
13999 o_conv.is_owned = ptr_is_owned(o);
14000 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14001 o_conv = ChannelTypeFeatures_clone(&o_conv);
14002 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
14003 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
14004 return tag_ptr(ret_conv, true);
14007 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
14008 void* e_ptr = untag_ptr(e);
14009 CHECK_ACCESS(e_ptr);
14010 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14011 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14012 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
14013 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
14014 return tag_ptr(ret_conv, true);
14017 jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
14018 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
14019 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
14023 void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) {
14024 if (!ptr_is_owned(_res)) return;
14025 void* _res_ptr = untag_ptr(_res);
14026 CHECK_ACCESS(_res_ptr);
14027 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
14028 FREE(untag_ptr(_res));
14029 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
14032 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
14033 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
14034 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
14035 return tag_ptr(ret_conv, true);
14037 int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
14038 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
14039 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
14043 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) {
14044 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
14045 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
14046 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
14047 return tag_ptr(ret_conv, true);
14050 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) {
14052 o_conv.inner = untag_ptr(o);
14053 o_conv.is_owned = ptr_is_owned(o);
14054 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14055 o_conv = NodeId_clone(&o_conv);
14056 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14057 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
14058 return tag_ptr(ret_conv, true);
14061 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
14062 void* e_ptr = untag_ptr(e);
14063 CHECK_ACCESS(e_ptr);
14064 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14065 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14066 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14067 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
14068 return tag_ptr(ret_conv, true);
14071 jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) {
14072 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
14073 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
14077 void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) {
14078 if (!ptr_is_owned(_res)) return;
14079 void* _res_ptr = untag_ptr(_res);
14080 CHECK_ACCESS(_res_ptr);
14081 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
14082 FREE(untag_ptr(_res));
14083 CResult_NodeIdDecodeErrorZ_free(_res_conv);
14086 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
14087 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14088 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
14089 return tag_ptr(ret_conv, true);
14091 int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) {
14092 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
14093 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
14097 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint64_t orig) {
14098 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
14099 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14100 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
14101 return tag_ptr(ret_conv, true);
14104 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint64_t o) {
14105 void* o_ptr = untag_ptr(o);
14106 CHECK_ACCESS(o_ptr);
14107 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
14108 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
14109 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14110 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
14111 return tag_ptr(ret_conv, true);
14114 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
14115 void* e_ptr = untag_ptr(e);
14116 CHECK_ACCESS(e_ptr);
14117 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14118 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14119 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14120 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
14121 return tag_ptr(ret_conv, true);
14124 jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint64_t o) {
14125 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
14126 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
14130 void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint64_t _res) {
14131 if (!ptr_is_owned(_res)) return;
14132 void* _res_ptr = untag_ptr(_res);
14133 CHECK_ACCESS(_res_ptr);
14134 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
14135 FREE(untag_ptr(_res));
14136 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
14139 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
14140 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14141 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
14142 return tag_ptr(ret_conv, true);
14144 int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint64_t arg) {
14145 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
14146 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
14150 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint64_t orig) {
14151 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
14152 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14153 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
14154 return tag_ptr(ret_conv, true);
14157 uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
14158 void* o_ptr = untag_ptr(o);
14159 CHECK_ACCESS(o_ptr);
14160 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
14161 if (o_conv.free == LDKAccess_JCalls_free) {
14162 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14163 LDKAccess_JCalls_cloned(&o_conv);
14165 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
14166 *ret_copy = COption_AccessZ_some(o_conv);
14167 uint64_t ret_ref = tag_ptr(ret_copy, true);
14171 uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
14172 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
14173 *ret_copy = COption_AccessZ_none();
14174 uint64_t ret_ref = tag_ptr(ret_copy, true);
14178 void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
14179 if (!ptr_is_owned(_res)) return;
14180 void* _res_ptr = untag_ptr(_res);
14181 CHECK_ACCESS(_res_ptr);
14182 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
14183 FREE(untag_ptr(_res));
14184 COption_AccessZ_free(_res_conv);
14187 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
14188 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14189 *ret_conv = CResult_boolLightningErrorZ_ok(o);
14190 return tag_ptr(ret_conv, true);
14193 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint64_t e) {
14194 LDKLightningError e_conv;
14195 e_conv.inner = untag_ptr(e);
14196 e_conv.is_owned = ptr_is_owned(e);
14197 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14198 e_conv = LightningError_clone(&e_conv);
14199 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14200 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
14201 return tag_ptr(ret_conv, true);
14204 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint64_t o) {
14205 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
14206 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
14210 void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint64_t _res) {
14211 if (!ptr_is_owned(_res)) return;
14212 void* _res_ptr = untag_ptr(_res);
14213 CHECK_ACCESS(_res_ptr);
14214 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
14215 FREE(untag_ptr(_res));
14216 CResult_boolLightningErrorZ_free(_res_conv);
14219 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
14220 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14221 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
14222 return tag_ptr(ret_conv, true);
14224 int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint64_t arg) {
14225 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
14226 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
14230 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) TS_CResult_boolLightningErrorZ_clone(uint64_t orig) {
14231 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
14232 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14233 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
14234 return tag_ptr(ret_conv, true);
14237 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
14238 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14239 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
14240 return tag_ptr(ret_conv, true);
14242 int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint64_t arg) {
14243 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
14244 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
14248 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint64_t orig) {
14249 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
14250 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14251 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
14252 return tag_ptr(ret_conv, true);
14255 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint64_t a, uint64_t b, uint64_t c) {
14256 LDKChannelAnnouncement a_conv;
14257 a_conv.inner = untag_ptr(a);
14258 a_conv.is_owned = ptr_is_owned(a);
14259 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
14260 a_conv = ChannelAnnouncement_clone(&a_conv);
14261 LDKChannelUpdate b_conv;
14262 b_conv.inner = untag_ptr(b);
14263 b_conv.is_owned = ptr_is_owned(b);
14264 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
14265 b_conv = ChannelUpdate_clone(&b_conv);
14266 LDKChannelUpdate c_conv;
14267 c_conv.inner = untag_ptr(c);
14268 c_conv.is_owned = ptr_is_owned(c);
14269 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
14270 c_conv = ChannelUpdate_clone(&c_conv);
14271 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14272 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
14273 return tag_ptr(ret_conv, true);
14276 void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint64_t _res) {
14277 if (!ptr_is_owned(_res)) return;
14278 void* _res_ptr = untag_ptr(_res);
14279 CHECK_ACCESS(_res_ptr);
14280 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
14281 FREE(untag_ptr(_res));
14282 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
14285 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(uint64_t o) {
14286 void* o_ptr = untag_ptr(o);
14287 CHECK_ACCESS(o_ptr);
14288 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
14289 o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
14290 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14291 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
14292 uint64_t ret_ref = tag_ptr(ret_copy, true);
14296 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none() {
14297 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14298 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
14299 uint64_t ret_ref = tag_ptr(ret_copy, true);
14303 void __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_t _res) {
14304 if (!ptr_is_owned(_res)) return;
14305 void* _res_ptr = untag_ptr(_res);
14306 CHECK_ACCESS(_res_ptr);
14307 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
14308 FREE(untag_ptr(_res));
14309 COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
14312 static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
14313 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14314 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
14315 uint64_t ret_ref = tag_ptr(ret_copy, true);
14318 int64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(uint64_t arg) {
14319 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
14320 int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
14324 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(uint64_t orig) {
14325 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
14326 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14327 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
14328 uint64_t ret_ref = tag_ptr(ret_copy, true);
14332 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
14333 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14334 *ret_conv = CResult_NoneLightningErrorZ_ok();
14335 return tag_ptr(ret_conv, true);
14338 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint64_t e) {
14339 LDKLightningError e_conv;
14340 e_conv.inner = untag_ptr(e);
14341 e_conv.is_owned = ptr_is_owned(e);
14342 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14343 e_conv = LightningError_clone(&e_conv);
14344 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14345 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
14346 return tag_ptr(ret_conv, true);
14349 jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint64_t o) {
14350 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
14351 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
14355 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint64_t _res) {
14356 if (!ptr_is_owned(_res)) return;
14357 void* _res_ptr = untag_ptr(_res);
14358 CHECK_ACCESS(_res_ptr);
14359 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
14360 FREE(untag_ptr(_res));
14361 CResult_NoneLightningErrorZ_free(_res_conv);
14364 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
14365 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14366 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
14367 return tag_ptr(ret_conv, true);
14369 int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint64_t arg) {
14370 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
14371 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
14375 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) TS_CResult_NoneLightningErrorZ_clone(uint64_t orig) {
14376 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
14377 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14378 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
14379 return tag_ptr(ret_conv, true);
14382 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok(uint64_t o) {
14383 LDKChannelUpdateInfo o_conv;
14384 o_conv.inner = untag_ptr(o);
14385 o_conv.is_owned = ptr_is_owned(o);
14386 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14387 o_conv = ChannelUpdateInfo_clone(&o_conv);
14388 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14389 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
14390 return tag_ptr(ret_conv, true);
14393 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
14394 void* e_ptr = untag_ptr(e);
14395 CHECK_ACCESS(e_ptr);
14396 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14397 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14398 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14399 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
14400 return tag_ptr(ret_conv, true);
14403 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(uint64_t o) {
14404 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
14405 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
14409 void __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_free"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_free(uint64_t _res) {
14410 if (!ptr_is_owned(_res)) return;
14411 void* _res_ptr = untag_ptr(_res);
14412 CHECK_ACCESS(_res_ptr);
14413 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
14414 FREE(untag_ptr(_res));
14415 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
14418 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
14419 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14420 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
14421 return tag_ptr(ret_conv, true);
14423 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14424 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
14425 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
14429 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone(uint64_t orig) {
14430 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
14431 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14432 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
14433 return tag_ptr(ret_conv, true);
14436 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint64_t o) {
14437 LDKChannelInfo o_conv;
14438 o_conv.inner = untag_ptr(o);
14439 o_conv.is_owned = ptr_is_owned(o);
14440 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14441 o_conv = ChannelInfo_clone(&o_conv);
14442 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14443 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
14444 return tag_ptr(ret_conv, true);
14447 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
14448 void* e_ptr = untag_ptr(e);
14449 CHECK_ACCESS(e_ptr);
14450 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14451 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14452 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14453 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
14454 return tag_ptr(ret_conv, true);
14457 jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint64_t o) {
14458 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
14459 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
14463 void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint64_t _res) {
14464 if (!ptr_is_owned(_res)) return;
14465 void* _res_ptr = untag_ptr(_res);
14466 CHECK_ACCESS(_res_ptr);
14467 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
14468 FREE(untag_ptr(_res));
14469 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
14472 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
14473 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14474 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
14475 return tag_ptr(ret_conv, true);
14477 int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14478 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
14479 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
14483 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint64_t orig) {
14484 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
14485 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14486 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
14487 return tag_ptr(ret_conv, true);
14490 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint64_t o) {
14491 LDKRoutingFees o_conv;
14492 o_conv.inner = untag_ptr(o);
14493 o_conv.is_owned = ptr_is_owned(o);
14494 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14495 o_conv = RoutingFees_clone(&o_conv);
14496 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14497 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
14498 return tag_ptr(ret_conv, true);
14501 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
14502 void* e_ptr = untag_ptr(e);
14503 CHECK_ACCESS(e_ptr);
14504 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14505 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14506 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14507 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
14508 return tag_ptr(ret_conv, true);
14511 jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint64_t o) {
14512 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
14513 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
14517 void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint64_t _res) {
14518 if (!ptr_is_owned(_res)) return;
14519 void* _res_ptr = untag_ptr(_res);
14520 CHECK_ACCESS(_res_ptr);
14521 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
14522 FREE(untag_ptr(_res));
14523 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
14526 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
14527 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14528 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
14529 return tag_ptr(ret_conv, true);
14531 int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint64_t arg) {
14532 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
14533 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
14537 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint64_t orig) {
14538 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
14539 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14540 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
14541 return tag_ptr(ret_conv, true);
14544 void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint64_tArray _res) {
14545 LDKCVec_NetAddressZ _res_constr;
14546 _res_constr.datalen = _res->arr_len;
14547 if (_res_constr.datalen > 0)
14548 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
14550 _res_constr.data = NULL;
14551 uint64_t* _res_vals = _res->elems;
14552 for (size_t m = 0; m < _res_constr.datalen; m++) {
14553 uint64_t _res_conv_12 = _res_vals[m];
14554 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
14555 CHECK_ACCESS(_res_conv_12_ptr);
14556 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
14557 FREE(untag_ptr(_res_conv_12));
14558 _res_constr.data[m] = _res_conv_12_conv;
14561 CVec_NetAddressZ_free(_res_constr);
14564 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint64_t o) {
14565 LDKNodeAnnouncementInfo o_conv;
14566 o_conv.inner = untag_ptr(o);
14567 o_conv.is_owned = ptr_is_owned(o);
14568 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14569 o_conv = NodeAnnouncementInfo_clone(&o_conv);
14570 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14571 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
14572 return tag_ptr(ret_conv, true);
14575 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
14576 void* e_ptr = untag_ptr(e);
14577 CHECK_ACCESS(e_ptr);
14578 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14579 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14580 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14581 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
14582 return tag_ptr(ret_conv, true);
14585 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint64_t o) {
14586 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
14587 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
14591 void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint64_t _res) {
14592 if (!ptr_is_owned(_res)) return;
14593 void* _res_ptr = untag_ptr(_res);
14594 CHECK_ACCESS(_res_ptr);
14595 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
14596 FREE(untag_ptr(_res));
14597 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
14600 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
14601 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14602 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
14603 return tag_ptr(ret_conv, true);
14605 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14606 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
14607 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
14611 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint64_t orig) {
14612 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
14613 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14614 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
14615 return tag_ptr(ret_conv, true);
14618 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS_CResult_NodeAliasDecodeErrorZ_ok(uint64_t o) {
14619 LDKNodeAlias o_conv;
14620 o_conv.inner = untag_ptr(o);
14621 o_conv.is_owned = ptr_is_owned(o);
14622 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14623 o_conv = NodeAlias_clone(&o_conv);
14624 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14625 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
14626 return tag_ptr(ret_conv, true);
14629 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
14630 void* e_ptr = untag_ptr(e);
14631 CHECK_ACCESS(e_ptr);
14632 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14633 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14634 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14635 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
14636 return tag_ptr(ret_conv, true);
14639 jboolean __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_is_ok"))) TS_CResult_NodeAliasDecodeErrorZ_is_ok(uint64_t o) {
14640 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
14641 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
14645 void __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_free"))) TS_CResult_NodeAliasDecodeErrorZ_free(uint64_t _res) {
14646 if (!ptr_is_owned(_res)) return;
14647 void* _res_ptr = untag_ptr(_res);
14648 CHECK_ACCESS(_res_ptr);
14649 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
14650 FREE(untag_ptr(_res));
14651 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
14654 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
14655 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14656 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
14657 return tag_ptr(ret_conv, true);
14659 int64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAliasDecodeErrorZ_clone_ptr(uint64_t arg) {
14660 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
14661 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
14665 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone"))) TS_CResult_NodeAliasDecodeErrorZ_clone(uint64_t orig) {
14666 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
14667 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14668 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
14669 return tag_ptr(ret_conv, true);
14672 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_CResult_NodeInfoDecodeErrorZ_ok(uint64_t o) {
14673 LDKNodeInfo o_conv;
14674 o_conv.inner = untag_ptr(o);
14675 o_conv.is_owned = ptr_is_owned(o);
14676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14677 o_conv = NodeInfo_clone(&o_conv);
14678 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14679 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
14680 return tag_ptr(ret_conv, true);
14683 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) {
14684 void* e_ptr = untag_ptr(e);
14685 CHECK_ACCESS(e_ptr);
14686 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14687 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14688 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14689 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
14690 return tag_ptr(ret_conv, true);
14693 jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint64_t o) {
14694 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
14695 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
14699 void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint64_t _res) {
14700 if (!ptr_is_owned(_res)) return;
14701 void* _res_ptr = untag_ptr(_res);
14702 CHECK_ACCESS(_res_ptr);
14703 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
14704 FREE(untag_ptr(_res));
14705 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
14708 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
14709 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14710 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
14711 return tag_ptr(ret_conv, true);
14713 int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14714 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
14715 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
14719 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint64_t orig) {
14720 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
14721 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14722 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
14723 return tag_ptr(ret_conv, true);
14726 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint64_t o) {
14727 LDKNetworkGraph o_conv;
14728 o_conv.inner = untag_ptr(o);
14729 o_conv.is_owned = ptr_is_owned(o);
14730 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14731 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
14733 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
14734 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
14735 return tag_ptr(ret_conv, true);
14738 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
14739 void* e_ptr = untag_ptr(e);
14740 CHECK_ACCESS(e_ptr);
14741 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14742 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14743 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
14744 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
14745 return tag_ptr(ret_conv, true);
14748 jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint64_t o) {
14749 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
14750 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
14754 void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint64_t _res) {
14755 if (!ptr_is_owned(_res)) return;
14756 void* _res_ptr = untag_ptr(_res);
14757 CHECK_ACCESS(_res_ptr);
14758 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
14759 FREE(untag_ptr(_res));
14760 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
14763 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint64_tArray o) {
14764 LDKCVec_NetAddressZ o_constr;
14765 o_constr.datalen = o->arr_len;
14766 if (o_constr.datalen > 0)
14767 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
14769 o_constr.data = NULL;
14770 uint64_t* o_vals = o->elems;
14771 for (size_t m = 0; m < o_constr.datalen; m++) {
14772 uint64_t o_conv_12 = o_vals[m];
14773 void* o_conv_12_ptr = untag_ptr(o_conv_12);
14774 CHECK_ACCESS(o_conv_12_ptr);
14775 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
14776 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
14777 o_constr.data[m] = o_conv_12_conv;
14780 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14781 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
14782 uint64_t ret_ref = tag_ptr(ret_copy, true);
14786 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() {
14787 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14788 *ret_copy = COption_CVec_NetAddressZZ_none();
14789 uint64_t ret_ref = tag_ptr(ret_copy, true);
14793 void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint64_t _res) {
14794 if (!ptr_is_owned(_res)) return;
14795 void* _res_ptr = untag_ptr(_res);
14796 CHECK_ACCESS(_res_ptr);
14797 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
14798 FREE(untag_ptr(_res));
14799 COption_CVec_NetAddressZZ_free(_res_conv);
14802 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
14803 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14804 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
14805 uint64_t ret_ref = tag_ptr(ret_copy, true);
14808 int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint64_t arg) {
14809 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
14810 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
14814 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_COption_CVec_NetAddressZZ_clone(uint64_t orig) {
14815 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
14816 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14817 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
14818 uint64_t ret_ref = tag_ptr(ret_copy, true);
14822 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14823 LDKDelayedPaymentOutputDescriptor o_conv;
14824 o_conv.inner = untag_ptr(o);
14825 o_conv.is_owned = ptr_is_owned(o);
14826 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14827 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
14828 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14829 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
14830 return tag_ptr(ret_conv, true);
14833 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14834 void* e_ptr = untag_ptr(e);
14835 CHECK_ACCESS(e_ptr);
14836 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14837 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14838 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14839 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
14840 return tag_ptr(ret_conv, true);
14843 jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14844 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14845 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14849 void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14850 if (!ptr_is_owned(_res)) return;
14851 void* _res_ptr = untag_ptr(_res);
14852 CHECK_ACCESS(_res_ptr);
14853 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
14854 FREE(untag_ptr(_res));
14855 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
14858 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14859 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14860 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
14861 return tag_ptr(ret_conv, true);
14863 int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14864 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14865 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14869 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14870 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14871 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14872 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
14873 return tag_ptr(ret_conv, true);
14876 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14877 LDKStaticPaymentOutputDescriptor o_conv;
14878 o_conv.inner = untag_ptr(o);
14879 o_conv.is_owned = ptr_is_owned(o);
14880 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14881 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
14882 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14883 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
14884 return tag_ptr(ret_conv, true);
14887 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14888 void* e_ptr = untag_ptr(e);
14889 CHECK_ACCESS(e_ptr);
14890 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14891 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14892 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14893 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
14894 return tag_ptr(ret_conv, true);
14897 jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14898 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14899 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14903 void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14904 if (!ptr_is_owned(_res)) return;
14905 void* _res_ptr = untag_ptr(_res);
14906 CHECK_ACCESS(_res_ptr);
14907 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
14908 FREE(untag_ptr(_res));
14909 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
14912 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14913 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14914 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
14915 return tag_ptr(ret_conv, true);
14917 int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14918 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14919 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14923 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14924 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14925 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14926 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
14927 return tag_ptr(ret_conv, true);
14930 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14931 void* o_ptr = untag_ptr(o);
14932 CHECK_ACCESS(o_ptr);
14933 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
14934 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
14935 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14936 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
14937 return tag_ptr(ret_conv, true);
14940 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14941 void* e_ptr = untag_ptr(e);
14942 CHECK_ACCESS(e_ptr);
14943 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
14944 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
14945 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14946 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
14947 return tag_ptr(ret_conv, true);
14950 jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14951 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14952 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14956 void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14957 if (!ptr_is_owned(_res)) return;
14958 void* _res_ptr = untag_ptr(_res);
14959 CHECK_ACCESS(_res_ptr);
14960 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
14961 FREE(untag_ptr(_res));
14962 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
14965 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14966 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14967 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
14968 return tag_ptr(ret_conv, true);
14970 int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14971 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14972 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14976 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14977 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14978 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14979 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
14980 return tag_ptr(ret_conv, true);
14983 void __attribute__((export_name("TS_CVec_PaymentPreimageZ_free"))) TS_CVec_PaymentPreimageZ_free(ptrArray _res) {
14984 LDKCVec_PaymentPreimageZ _res_constr;
14985 _res_constr.datalen = _res->arr_len;
14986 if (_res_constr.datalen > 0)
14987 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
14989 _res_constr.data = NULL;
14990 int8_tArray* _res_vals = (void*) _res->elems;
14991 for (size_t m = 0; m < _res_constr.datalen; m++) {
14992 int8_tArray _res_conv_12 = _res_vals[m];
14993 LDKThirtyTwoBytes _res_conv_12_ref;
14994 CHECK(_res_conv_12->arr_len == 32);
14995 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
14996 _res_constr.data[m] = _res_conv_12_ref;
14999 CVec_PaymentPreimageZ_free(_res_constr);
15002 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
15003 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
15004 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
15005 return tag_ptr(ret_conv, true);
15007 int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint64_t arg) {
15008 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
15009 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
15013 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint64_t orig) {
15014 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
15015 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
15016 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
15017 return tag_ptr(ret_conv, true);
15020 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
15021 LDKSignature a_ref;
15022 CHECK(a->arr_len == 64);
15023 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
15024 LDKCVec_SignatureZ b_constr;
15025 b_constr.datalen = b->arr_len;
15026 if (b_constr.datalen > 0)
15027 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
15029 b_constr.data = NULL;
15030 int8_tArray* b_vals = (void*) b->elems;
15031 for (size_t m = 0; m < b_constr.datalen; m++) {
15032 int8_tArray b_conv_12 = b_vals[m];
15033 LDKSignature b_conv_12_ref;
15034 CHECK(b_conv_12->arr_len == 64);
15035 memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
15036 b_constr.data[m] = b_conv_12_ref;
15039 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
15040 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
15041 return tag_ptr(ret_conv, true);
15044 void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint64_t _res) {
15045 if (!ptr_is_owned(_res)) return;
15046 void* _res_ptr = untag_ptr(_res);
15047 CHECK_ACCESS(_res_ptr);
15048 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
15049 FREE(untag_ptr(_res));
15050 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
15053 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint64_t o) {
15054 void* o_ptr = untag_ptr(o);
15055 CHECK_ACCESS(o_ptr);
15056 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
15057 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
15058 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15059 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
15060 return tag_ptr(ret_conv, true);
15063 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() {
15064 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15065 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
15066 return tag_ptr(ret_conv, true);
15069 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint64_t o) {
15070 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
15071 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
15075 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint64_t _res) {
15076 if (!ptr_is_owned(_res)) return;
15077 void* _res_ptr = untag_ptr(_res);
15078 CHECK_ACCESS(_res_ptr);
15079 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
15080 FREE(untag_ptr(_res));
15081 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
15084 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
15085 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15086 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
15087 return tag_ptr(ret_conv, true);
15089 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint64_t arg) {
15090 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
15091 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
15095 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint64_t orig) {
15096 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
15097 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15098 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
15099 return tag_ptr(ret_conv, true);
15102 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) {
15103 LDKSignature o_ref;
15104 CHECK(o->arr_len == 64);
15105 memcpy(o_ref.compact_form, o->elems, 64); FREE(o);
15106 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15107 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
15108 return tag_ptr(ret_conv, true);
15111 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() {
15112 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15113 *ret_conv = CResult_SignatureNoneZ_err();
15114 return tag_ptr(ret_conv, true);
15117 jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint64_t o) {
15118 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
15119 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
15123 void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint64_t _res) {
15124 if (!ptr_is_owned(_res)) return;
15125 void* _res_ptr = untag_ptr(_res);
15126 CHECK_ACCESS(_res_ptr);
15127 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
15128 FREE(untag_ptr(_res));
15129 CResult_SignatureNoneZ_free(_res_conv);
15132 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
15133 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15134 *ret_conv = CResult_SignatureNoneZ_clone(arg);
15135 return tag_ptr(ret_conv, true);
15137 int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint64_t arg) {
15138 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
15139 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
15143 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CResult_SignatureNoneZ_clone(uint64_t orig) {
15144 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
15145 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15146 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
15147 return tag_ptr(ret_conv, true);
15150 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
15151 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15152 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
15153 return tag_ptr(ret_conv, true);
15155 int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
15156 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
15157 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
15161 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
15162 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
15163 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15164 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
15165 return tag_ptr(ret_conv, true);
15168 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
15169 LDKSignature a_ref;
15170 CHECK(a->arr_len == 64);
15171 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
15172 LDKSignature b_ref;
15173 CHECK(b->arr_len == 64);
15174 memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
15175 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15176 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
15177 return tag_ptr(ret_conv, true);
15180 void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
15181 if (!ptr_is_owned(_res)) return;
15182 void* _res_ptr = untag_ptr(_res);
15183 CHECK_ACCESS(_res_ptr);
15184 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
15185 FREE(untag_ptr(_res));
15186 C2Tuple_SignatureSignatureZ_free(_res_conv);
15189 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
15190 void* o_ptr = untag_ptr(o);
15191 CHECK_ACCESS(o_ptr);
15192 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
15193 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
15194 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15195 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
15196 return tag_ptr(ret_conv, true);
15199 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
15200 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15201 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
15202 return tag_ptr(ret_conv, true);
15205 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
15206 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
15207 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
15211 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
15212 if (!ptr_is_owned(_res)) return;
15213 void* _res_ptr = untag_ptr(_res);
15214 CHECK_ACCESS(_res_ptr);
15215 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
15216 FREE(untag_ptr(_res));
15217 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
15220 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
15221 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15222 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
15223 return tag_ptr(ret_conv, true);
15225 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
15226 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
15227 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
15231 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
15232 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
15233 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15234 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
15235 return tag_ptr(ret_conv, true);
15238 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
15239 LDKSecretKey o_ref;
15240 CHECK(o->arr_len == 32);
15241 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
15242 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15243 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
15244 return tag_ptr(ret_conv, true);
15247 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
15248 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15249 *ret_conv = CResult_SecretKeyNoneZ_err();
15250 return tag_ptr(ret_conv, true);
15253 jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
15254 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
15255 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
15259 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
15260 if (!ptr_is_owned(_res)) return;
15261 void* _res_ptr = untag_ptr(_res);
15262 CHECK_ACCESS(_res_ptr);
15263 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
15264 FREE(untag_ptr(_res));
15265 CResult_SecretKeyNoneZ_free(_res_conv);
15268 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
15269 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15270 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
15271 return tag_ptr(ret_conv, true);
15273 int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
15274 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
15275 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
15279 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
15280 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
15281 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15282 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
15283 return tag_ptr(ret_conv, true);
15286 uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_ok"))) TS_CResult_PublicKeyNoneZ_ok(int8_tArray o) {
15287 LDKPublicKey o_ref;
15288 CHECK(o->arr_len == 33);
15289 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
15290 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
15291 *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
15292 return tag_ptr(ret_conv, true);
15295 uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_err"))) TS_CResult_PublicKeyNoneZ_err() {
15296 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
15297 *ret_conv = CResult_PublicKeyNoneZ_err();
15298 return tag_ptr(ret_conv, true);
15301 jboolean __attribute__((export_name("TS_CResult_PublicKeyNoneZ_is_ok"))) TS_CResult_PublicKeyNoneZ_is_ok(uint64_t o) {
15302 LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
15303 jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
15307 void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_free"))) TS_CResult_PublicKeyNoneZ_free(uint64_t _res) {
15308 if (!ptr_is_owned(_res)) return;
15309 void* _res_ptr = untag_ptr(_res);
15310 CHECK_ACCESS(_res_ptr);
15311 LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
15312 FREE(untag_ptr(_res));
15313 CResult_PublicKeyNoneZ_free(_res_conv);
15316 static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
15317 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
15318 *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
15319 return tag_ptr(ret_conv, true);
15321 int64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone_ptr"))) TS_CResult_PublicKeyNoneZ_clone_ptr(uint64_t arg) {
15322 LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
15323 int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
15327 uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone"))) TS_CResult_PublicKeyNoneZ_clone(uint64_t orig) {
15328 LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
15329 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
15330 *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
15331 return tag_ptr(ret_conv, true);
15334 uint64_t __attribute__((export_name("TS_COption_ScalarZ_some"))) TS_COption_ScalarZ_some(uint64_t o) {
15335 void* o_ptr = untag_ptr(o);
15336 CHECK_ACCESS(o_ptr);
15337 LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
15338 // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
15339 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
15340 *ret_copy = COption_ScalarZ_some(o_conv);
15341 uint64_t ret_ref = tag_ptr(ret_copy, true);
15345 uint64_t __attribute__((export_name("TS_COption_ScalarZ_none"))) TS_COption_ScalarZ_none() {
15346 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
15347 *ret_copy = COption_ScalarZ_none();
15348 uint64_t ret_ref = tag_ptr(ret_copy, true);
15352 void __attribute__((export_name("TS_COption_ScalarZ_free"))) TS_COption_ScalarZ_free(uint64_t _res) {
15353 if (!ptr_is_owned(_res)) return;
15354 void* _res_ptr = untag_ptr(_res);
15355 CHECK_ACCESS(_res_ptr);
15356 LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
15357 FREE(untag_ptr(_res));
15358 COption_ScalarZ_free(_res_conv);
15361 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_ok"))) TS_CResult_SharedSecretNoneZ_ok(int8_tArray o) {
15362 LDKThirtyTwoBytes o_ref;
15363 CHECK(o->arr_len == 32);
15364 memcpy(o_ref.data, o->elems, 32); FREE(o);
15365 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15366 *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
15367 return tag_ptr(ret_conv, true);
15370 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_err"))) TS_CResult_SharedSecretNoneZ_err() {
15371 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15372 *ret_conv = CResult_SharedSecretNoneZ_err();
15373 return tag_ptr(ret_conv, true);
15376 jboolean __attribute__((export_name("TS_CResult_SharedSecretNoneZ_is_ok"))) TS_CResult_SharedSecretNoneZ_is_ok(uint64_t o) {
15377 LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
15378 jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
15382 void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_free"))) TS_CResult_SharedSecretNoneZ_free(uint64_t _res) {
15383 if (!ptr_is_owned(_res)) return;
15384 void* _res_ptr = untag_ptr(_res);
15385 CHECK_ACCESS(_res_ptr);
15386 LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
15387 FREE(untag_ptr(_res));
15388 CResult_SharedSecretNoneZ_free(_res_conv);
15391 static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
15392 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15393 *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
15394 return tag_ptr(ret_conv, true);
15396 int64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone_ptr"))) TS_CResult_SharedSecretNoneZ_clone_ptr(uint64_t arg) {
15397 LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
15398 int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
15402 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone"))) TS_CResult_SharedSecretNoneZ_clone(uint64_t orig) {
15403 LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
15404 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15405 *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
15406 return tag_ptr(ret_conv, true);
15409 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
15410 void* o_ptr = untag_ptr(o);
15411 CHECK_ACCESS(o_ptr);
15412 LDKSign o_conv = *(LDKSign*)(o_ptr);
15413 if (o_conv.free == LDKSign_JCalls_free) {
15414 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15415 LDKSign_JCalls_cloned(&o_conv);
15417 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15418 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
15419 return tag_ptr(ret_conv, true);
15422 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
15423 void* e_ptr = untag_ptr(e);
15424 CHECK_ACCESS(e_ptr);
15425 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15426 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15427 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15428 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
15429 return tag_ptr(ret_conv, true);
15432 jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
15433 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
15434 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
15438 void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
15439 if (!ptr_is_owned(_res)) return;
15440 void* _res_ptr = untag_ptr(_res);
15441 CHECK_ACCESS(_res_ptr);
15442 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
15443 FREE(untag_ptr(_res));
15444 CResult_SignDecodeErrorZ_free(_res_conv);
15447 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
15448 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15449 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
15450 return tag_ptr(ret_conv, true);
15452 int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
15453 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
15454 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
15458 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
15459 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
15460 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15461 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
15462 return tag_ptr(ret_conv, true);
15465 void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
15466 LDKCVec_u5Z _res_constr;
15467 _res_constr.datalen = _res->arr_len;
15468 if (_res_constr.datalen > 0)
15469 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
15471 _res_constr.data = NULL;
15472 int8_t* _res_vals = (void*) _res->elems;
15473 for (size_t h = 0; h < _res_constr.datalen; h++) {
15474 int8_t _res_conv_7 = _res_vals[h];
15476 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
15479 CVec_u5Z_free(_res_constr);
15482 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
15483 LDKRecoverableSignature o_ref;
15484 CHECK(o->arr_len == 68);
15485 memcpy(o_ref.serialized_form, o->elems, 68); FREE(o);
15486 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15487 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
15488 return tag_ptr(ret_conv, true);
15491 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() {
15492 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15493 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
15494 return tag_ptr(ret_conv, true);
15497 jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint64_t o) {
15498 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
15499 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
15503 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint64_t _res) {
15504 if (!ptr_is_owned(_res)) return;
15505 void* _res_ptr = untag_ptr(_res);
15506 CHECK_ACCESS(_res_ptr);
15507 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
15508 FREE(untag_ptr(_res));
15509 CResult_RecoverableSignatureNoneZ_free(_res_conv);
15512 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
15513 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15514 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
15515 return tag_ptr(ret_conv, true);
15517 int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint64_t arg) {
15518 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
15519 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
15523 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint64_t orig) {
15524 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
15525 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15526 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
15527 return tag_ptr(ret_conv, true);
15530 void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
15531 LDKCVec_u8Z _res_ref;
15532 _res_ref.datalen = _res->arr_len;
15533 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
15534 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
15535 CVec_u8Z_free(_res_ref);
15538 void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
15539 LDKCVec_CVec_u8ZZ _res_constr;
15540 _res_constr.datalen = _res->arr_len;
15541 if (_res_constr.datalen > 0)
15542 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
15544 _res_constr.data = NULL;
15545 int8_tArray* _res_vals = (void*) _res->elems;
15546 for (size_t m = 0; m < _res_constr.datalen; m++) {
15547 int8_tArray _res_conv_12 = _res_vals[m];
15548 LDKCVec_u8Z _res_conv_12_ref;
15549 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
15550 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
15551 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
15552 _res_constr.data[m] = _res_conv_12_ref;
15555 CVec_CVec_u8ZZ_free(_res_constr);
15558 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
15559 LDKCVec_CVec_u8ZZ o_constr;
15560 o_constr.datalen = o->arr_len;
15561 if (o_constr.datalen > 0)
15562 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
15564 o_constr.data = NULL;
15565 int8_tArray* o_vals = (void*) o->elems;
15566 for (size_t m = 0; m < o_constr.datalen; m++) {
15567 int8_tArray o_conv_12 = o_vals[m];
15568 LDKCVec_u8Z o_conv_12_ref;
15569 o_conv_12_ref.datalen = o_conv_12->arr_len;
15570 o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
15571 memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
15572 o_constr.data[m] = o_conv_12_ref;
15575 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15576 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
15577 return tag_ptr(ret_conv, true);
15580 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
15581 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15582 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
15583 return tag_ptr(ret_conv, true);
15586 jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint64_t o) {
15587 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
15588 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
15592 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint64_t _res) {
15593 if (!ptr_is_owned(_res)) return;
15594 void* _res_ptr = untag_ptr(_res);
15595 CHECK_ACCESS(_res_ptr);
15596 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
15597 FREE(untag_ptr(_res));
15598 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
15601 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
15602 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15603 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
15604 return tag_ptr(ret_conv, true);
15606 int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint64_t arg) {
15607 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
15608 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
15612 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint64_t orig) {
15613 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
15614 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15615 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
15616 return tag_ptr(ret_conv, true);
15619 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint64_t o) {
15620 LDKInMemorySigner o_conv;
15621 o_conv.inner = untag_ptr(o);
15622 o_conv.is_owned = ptr_is_owned(o);
15623 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15624 o_conv = InMemorySigner_clone(&o_conv);
15625 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15626 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
15627 return tag_ptr(ret_conv, true);
15630 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
15631 void* e_ptr = untag_ptr(e);
15632 CHECK_ACCESS(e_ptr);
15633 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15634 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15635 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15636 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
15637 return tag_ptr(ret_conv, true);
15640 jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint64_t o) {
15641 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
15642 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
15646 void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint64_t _res) {
15647 if (!ptr_is_owned(_res)) return;
15648 void* _res_ptr = untag_ptr(_res);
15649 CHECK_ACCESS(_res_ptr);
15650 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
15651 FREE(untag_ptr(_res));
15652 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
15655 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
15656 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15657 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
15658 return tag_ptr(ret_conv, true);
15660 int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint64_t arg) {
15661 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
15662 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
15666 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint64_t orig) {
15667 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
15668 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15669 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
15670 return tag_ptr(ret_conv, true);
15673 void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint64_tArray _res) {
15674 LDKCVec_TxOutZ _res_constr;
15675 _res_constr.datalen = _res->arr_len;
15676 if (_res_constr.datalen > 0)
15677 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
15679 _res_constr.data = NULL;
15680 uint64_t* _res_vals = _res->elems;
15681 for (size_t h = 0; h < _res_constr.datalen; h++) {
15682 uint64_t _res_conv_7 = _res_vals[h];
15683 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
15684 CHECK_ACCESS(_res_conv_7_ptr);
15685 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
15686 FREE(untag_ptr(_res_conv_7));
15687 _res_constr.data[h] = _res_conv_7_conv;
15690 CVec_TxOutZ_free(_res_constr);
15693 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
15694 LDKTransaction o_ref;
15695 o_ref.datalen = o->arr_len;
15696 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
15697 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
15698 o_ref.data_is_owned = true;
15699 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15700 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
15701 return tag_ptr(ret_conv, true);
15704 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() {
15705 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15706 *ret_conv = CResult_TransactionNoneZ_err();
15707 return tag_ptr(ret_conv, true);
15710 jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) {
15711 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
15712 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
15716 void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) {
15717 if (!ptr_is_owned(_res)) return;
15718 void* _res_ptr = untag_ptr(_res);
15719 CHECK_ACCESS(_res_ptr);
15720 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
15721 FREE(untag_ptr(_res));
15722 CResult_TransactionNoneZ_free(_res_conv);
15725 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
15726 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15727 *ret_conv = CResult_TransactionNoneZ_clone(arg);
15728 return tag_ptr(ret_conv, true);
15730 int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) {
15731 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
15732 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
15736 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) {
15737 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
15738 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15739 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
15740 return tag_ptr(ret_conv, true);
15743 uint64_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) {
15744 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15745 *ret_copy = COption_u16Z_some(o);
15746 uint64_t ret_ref = tag_ptr(ret_copy, true);
15750 uint64_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() {
15751 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15752 *ret_copy = COption_u16Z_none();
15753 uint64_t ret_ref = tag_ptr(ret_copy, true);
15757 void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint64_t _res) {
15758 if (!ptr_is_owned(_res)) return;
15759 void* _res_ptr = untag_ptr(_res);
15760 CHECK_ACCESS(_res_ptr);
15761 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
15762 FREE(untag_ptr(_res));
15763 COption_u16Z_free(_res_conv);
15766 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
15767 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15768 *ret_copy = COption_u16Z_clone(arg);
15769 uint64_t ret_ref = tag_ptr(ret_copy, true);
15772 int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint64_t arg) {
15773 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
15774 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
15778 uint64_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_clone(uint64_t orig) {
15779 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
15780 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15781 *ret_copy = COption_u16Z_clone(orig_conv);
15782 uint64_t ret_ref = tag_ptr(ret_copy, true);
15786 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
15787 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15788 *ret_conv = CResult_NoneAPIErrorZ_ok();
15789 return tag_ptr(ret_conv, true);
15792 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
15793 void* e_ptr = untag_ptr(e);
15794 CHECK_ACCESS(e_ptr);
15795 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15796 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15797 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15798 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
15799 return tag_ptr(ret_conv, true);
15802 jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
15803 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
15804 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
15808 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
15809 if (!ptr_is_owned(_res)) return;
15810 void* _res_ptr = untag_ptr(_res);
15811 CHECK_ACCESS(_res_ptr);
15812 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
15813 FREE(untag_ptr(_res));
15814 CResult_NoneAPIErrorZ_free(_res_conv);
15817 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
15818 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15819 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
15820 return tag_ptr(ret_conv, true);
15822 int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
15823 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
15824 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
15828 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
15829 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
15830 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15831 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
15832 return tag_ptr(ret_conv, true);
15835 void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
15836 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
15837 _res_constr.datalen = _res->arr_len;
15838 if (_res_constr.datalen > 0)
15839 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
15841 _res_constr.data = NULL;
15842 uint64_t* _res_vals = _res->elems;
15843 for (size_t w = 0; w < _res_constr.datalen; w++) {
15844 uint64_t _res_conv_22 = _res_vals[w];
15845 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
15846 CHECK_ACCESS(_res_conv_22_ptr);
15847 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
15848 FREE(untag_ptr(_res_conv_22));
15849 _res_constr.data[w] = _res_conv_22_conv;
15852 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
15855 void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
15856 LDKCVec_APIErrorZ _res_constr;
15857 _res_constr.datalen = _res->arr_len;
15858 if (_res_constr.datalen > 0)
15859 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
15861 _res_constr.data = NULL;
15862 uint64_t* _res_vals = _res->elems;
15863 for (size_t k = 0; k < _res_constr.datalen; k++) {
15864 uint64_t _res_conv_10 = _res_vals[k];
15865 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
15866 CHECK_ACCESS(_res_conv_10_ptr);
15867 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
15868 FREE(untag_ptr(_res_conv_10));
15869 _res_constr.data[k] = _res_conv_10_conv;
15872 CVec_APIErrorZ_free(_res_constr);
15875 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
15876 LDKThirtyTwoBytes o_ref;
15877 CHECK(o->arr_len == 32);
15878 memcpy(o_ref.data, o->elems, 32); FREE(o);
15879 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15880 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
15881 return tag_ptr(ret_conv, true);
15884 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
15885 void* e_ptr = untag_ptr(e);
15886 CHECK_ACCESS(e_ptr);
15887 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15888 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15889 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15890 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
15891 return tag_ptr(ret_conv, true);
15894 jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
15895 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
15896 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
15900 void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
15901 if (!ptr_is_owned(_res)) return;
15902 void* _res_ptr = untag_ptr(_res);
15903 CHECK_ACCESS(_res_ptr);
15904 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
15905 FREE(untag_ptr(_res));
15906 CResult__u832APIErrorZ_free(_res_conv);
15909 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
15910 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15911 *ret_conv = CResult__u832APIErrorZ_clone(arg);
15912 return tag_ptr(ret_conv, true);
15914 int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
15915 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
15916 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
15920 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
15921 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
15922 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15923 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
15924 return tag_ptr(ret_conv, true);
15927 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
15928 LDKThirtyTwoBytes o_ref;
15929 CHECK(o->arr_len == 32);
15930 memcpy(o_ref.data, o->elems, 32); FREE(o);
15931 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15932 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
15933 return tag_ptr(ret_conv, true);
15936 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
15937 void* e_ptr = untag_ptr(e);
15938 CHECK_ACCESS(e_ptr);
15939 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15940 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15941 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15942 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
15943 return tag_ptr(ret_conv, true);
15946 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
15947 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
15948 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
15952 void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
15953 if (!ptr_is_owned(_res)) return;
15954 void* _res_ptr = untag_ptr(_res);
15955 CHECK_ACCESS(_res_ptr);
15956 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
15957 FREE(untag_ptr(_res));
15958 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
15961 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
15962 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15963 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
15964 return tag_ptr(ret_conv, true);
15966 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
15967 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
15968 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
15972 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
15973 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
15974 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15975 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
15976 return tag_ptr(ret_conv, true);
15979 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
15980 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15981 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
15982 return tag_ptr(ret_conv, true);
15985 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
15986 void* e_ptr = untag_ptr(e);
15987 CHECK_ACCESS(e_ptr);
15988 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15989 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15990 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15991 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
15992 return tag_ptr(ret_conv, true);
15995 jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
15996 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
15997 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
16001 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
16002 if (!ptr_is_owned(_res)) return;
16003 void* _res_ptr = untag_ptr(_res);
16004 CHECK_ACCESS(_res_ptr);
16005 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
16006 FREE(untag_ptr(_res));
16007 CResult_NonePaymentSendFailureZ_free(_res_conv);
16010 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
16011 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
16012 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
16013 return tag_ptr(ret_conv, true);
16015 int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
16016 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
16017 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
16021 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
16022 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
16023 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
16024 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
16025 return tag_ptr(ret_conv, true);
16028 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
16029 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
16030 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
16031 return tag_ptr(ret_conv, true);
16033 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint64_t arg) {
16034 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
16035 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
16039 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint64_t orig) {
16040 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
16041 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
16042 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
16043 return tag_ptr(ret_conv, true);
16046 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
16047 LDKThirtyTwoBytes a_ref;
16048 CHECK(a->arr_len == 32);
16049 memcpy(a_ref.data, a->elems, 32); FREE(a);
16050 LDKThirtyTwoBytes b_ref;
16051 CHECK(b->arr_len == 32);
16052 memcpy(b_ref.data, b->elems, 32); FREE(b);
16053 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
16054 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
16055 return tag_ptr(ret_conv, true);
16058 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint64_t _res) {
16059 if (!ptr_is_owned(_res)) return;
16060 void* _res_ptr = untag_ptr(_res);
16061 CHECK_ACCESS(_res_ptr);
16062 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
16063 FREE(untag_ptr(_res));
16064 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
16067 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint64_t o) {
16068 void* o_ptr = untag_ptr(o);
16069 CHECK_ACCESS(o_ptr);
16070 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
16071 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
16072 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16073 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
16074 return tag_ptr(ret_conv, true);
16077 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint64_t e) {
16078 void* e_ptr = untag_ptr(e);
16079 CHECK_ACCESS(e_ptr);
16080 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
16081 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
16082 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16083 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
16084 return tag_ptr(ret_conv, true);
16087 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint64_t o) {
16088 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
16089 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
16093 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint64_t _res) {
16094 if (!ptr_is_owned(_res)) return;
16095 void* _res_ptr = untag_ptr(_res);
16096 CHECK_ACCESS(_res_ptr);
16097 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
16098 FREE(untag_ptr(_res));
16099 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
16102 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
16103 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16104 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
16105 return tag_ptr(ret_conv, true);
16107 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint64_t arg) {
16108 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
16109 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
16113 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint64_t orig) {
16114 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
16115 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16116 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
16117 return tag_ptr(ret_conv, true);
16120 void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) {
16121 LDKCVec_ThirtyTwoBytesZ _res_constr;
16122 _res_constr.datalen = _res->arr_len;
16123 if (_res_constr.datalen > 0)
16124 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
16126 _res_constr.data = NULL;
16127 int8_tArray* _res_vals = (void*) _res->elems;
16128 for (size_t m = 0; m < _res_constr.datalen; m++) {
16129 int8_tArray _res_conv_12 = _res_vals[m];
16130 LDKThirtyTwoBytes _res_conv_12_ref;
16131 CHECK(_res_conv_12->arr_len == 32);
16132 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
16133 _res_constr.data[m] = _res_conv_12_ref;
16136 CVec_ThirtyTwoBytesZ_free(_res_constr);
16139 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
16140 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16141 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
16142 return tag_ptr(ret_conv, true);
16144 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint64_t arg) {
16145 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
16146 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
16150 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint64_t orig) {
16151 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
16152 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16153 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
16154 return tag_ptr(ret_conv, true);
16157 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
16158 LDKThirtyTwoBytes a_ref;
16159 CHECK(a->arr_len == 32);
16160 memcpy(a_ref.data, a->elems, 32); FREE(a);
16161 LDKThirtyTwoBytes b_ref;
16162 CHECK(b->arr_len == 32);
16163 memcpy(b_ref.data, b->elems, 32); FREE(b);
16164 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16165 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
16166 return tag_ptr(ret_conv, true);
16169 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint64_t _res) {
16170 if (!ptr_is_owned(_res)) return;
16171 void* _res_ptr = untag_ptr(_res);
16172 CHECK_ACCESS(_res_ptr);
16173 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
16174 FREE(untag_ptr(_res));
16175 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
16178 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint64_t o) {
16179 void* o_ptr = untag_ptr(o);
16180 CHECK_ACCESS(o_ptr);
16181 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
16182 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
16183 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16184 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
16185 return tag_ptr(ret_conv, true);
16188 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
16189 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16190 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
16191 return tag_ptr(ret_conv, true);
16194 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint64_t o) {
16195 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
16196 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
16200 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint64_t _res) {
16201 if (!ptr_is_owned(_res)) return;
16202 void* _res_ptr = untag_ptr(_res);
16203 CHECK_ACCESS(_res_ptr);
16204 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
16205 FREE(untag_ptr(_res));
16206 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
16209 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
16210 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16211 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
16212 return tag_ptr(ret_conv, true);
16214 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint64_t arg) {
16215 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
16216 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
16220 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint64_t orig) {
16221 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
16222 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16223 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
16224 return tag_ptr(ret_conv, true);
16227 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint64_t o) {
16228 void* o_ptr = untag_ptr(o);
16229 CHECK_ACCESS(o_ptr);
16230 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
16231 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
16232 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16233 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
16234 return tag_ptr(ret_conv, true);
16237 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint64_t e) {
16238 void* e_ptr = untag_ptr(e);
16239 CHECK_ACCESS(e_ptr);
16240 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16241 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16242 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16243 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
16244 return tag_ptr(ret_conv, true);
16247 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint64_t o) {
16248 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
16249 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
16253 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint64_t _res) {
16254 if (!ptr_is_owned(_res)) return;
16255 void* _res_ptr = untag_ptr(_res);
16256 CHECK_ACCESS(_res_ptr);
16257 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
16258 FREE(untag_ptr(_res));
16259 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
16262 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
16263 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16264 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
16265 return tag_ptr(ret_conv, true);
16267 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint64_t arg) {
16268 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
16269 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
16273 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint64_t orig) {
16274 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
16275 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16276 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
16277 return tag_ptr(ret_conv, true);
16280 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
16281 LDKThirtyTwoBytes o_ref;
16282 CHECK(o->arr_len == 32);
16283 memcpy(o_ref.data, o->elems, 32); FREE(o);
16284 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16285 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
16286 return tag_ptr(ret_conv, true);
16289 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() {
16290 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16291 *ret_conv = CResult_PaymentSecretNoneZ_err();
16292 return tag_ptr(ret_conv, true);
16295 jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint64_t o) {
16296 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
16297 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
16301 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint64_t _res) {
16302 if (!ptr_is_owned(_res)) return;
16303 void* _res_ptr = untag_ptr(_res);
16304 CHECK_ACCESS(_res_ptr);
16305 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
16306 FREE(untag_ptr(_res));
16307 CResult_PaymentSecretNoneZ_free(_res_conv);
16310 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
16311 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16312 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
16313 return tag_ptr(ret_conv, true);
16315 int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint64_t arg) {
16316 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
16317 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
16321 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS_CResult_PaymentSecretNoneZ_clone(uint64_t orig) {
16322 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
16323 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16324 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
16325 return tag_ptr(ret_conv, true);
16328 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
16329 LDKThirtyTwoBytes o_ref;
16330 CHECK(o->arr_len == 32);
16331 memcpy(o_ref.data, o->elems, 32); FREE(o);
16332 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16333 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
16334 return tag_ptr(ret_conv, true);
16337 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint64_t e) {
16338 void* e_ptr = untag_ptr(e);
16339 CHECK_ACCESS(e_ptr);
16340 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16341 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16342 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16343 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
16344 return tag_ptr(ret_conv, true);
16347 jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint64_t o) {
16348 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
16349 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
16353 void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint64_t _res) {
16354 if (!ptr_is_owned(_res)) return;
16355 void* _res_ptr = untag_ptr(_res);
16356 CHECK_ACCESS(_res_ptr);
16357 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
16358 FREE(untag_ptr(_res));
16359 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
16362 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
16363 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16364 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
16365 return tag_ptr(ret_conv, true);
16367 int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint64_t arg) {
16368 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
16369 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
16373 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint64_t orig) {
16374 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
16375 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16376 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
16377 return tag_ptr(ret_conv, true);
16380 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
16381 LDKThirtyTwoBytes o_ref;
16382 CHECK(o->arr_len == 32);
16383 memcpy(o_ref.data, o->elems, 32); FREE(o);
16384 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16385 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
16386 return tag_ptr(ret_conv, true);
16389 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint64_t e) {
16390 void* e_ptr = untag_ptr(e);
16391 CHECK_ACCESS(e_ptr);
16392 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16393 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16394 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16395 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
16396 return tag_ptr(ret_conv, true);
16399 jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint64_t o) {
16400 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
16401 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
16405 void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint64_t _res) {
16406 if (!ptr_is_owned(_res)) return;
16407 void* _res_ptr = untag_ptr(_res);
16408 CHECK_ACCESS(_res_ptr);
16409 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
16410 FREE(untag_ptr(_res));
16411 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
16414 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
16415 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16416 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
16417 return tag_ptr(ret_conv, true);
16419 int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint64_t arg) {
16420 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
16421 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
16425 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint64_t orig) {
16426 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
16427 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16428 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
16429 return tag_ptr(ret_conv, true);
16432 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) {
16433 LDKCounterpartyForwardingInfo o_conv;
16434 o_conv.inner = untag_ptr(o);
16435 o_conv.is_owned = ptr_is_owned(o);
16436 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16437 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
16438 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16439 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
16440 return tag_ptr(ret_conv, true);
16443 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
16444 void* e_ptr = untag_ptr(e);
16445 CHECK_ACCESS(e_ptr);
16446 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16447 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16448 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16449 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
16450 return tag_ptr(ret_conv, true);
16453 jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) {
16454 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
16455 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
16459 void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) {
16460 if (!ptr_is_owned(_res)) return;
16461 void* _res_ptr = untag_ptr(_res);
16462 CHECK_ACCESS(_res_ptr);
16463 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
16464 FREE(untag_ptr(_res));
16465 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
16468 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
16469 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16470 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
16471 return tag_ptr(ret_conv, true);
16473 int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
16474 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
16475 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
16479 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) {
16480 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
16481 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16482 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
16483 return tag_ptr(ret_conv, true);
16486 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) {
16487 LDKChannelCounterparty o_conv;
16488 o_conv.inner = untag_ptr(o);
16489 o_conv.is_owned = ptr_is_owned(o);
16490 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16491 o_conv = ChannelCounterparty_clone(&o_conv);
16492 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16493 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
16494 return tag_ptr(ret_conv, true);
16497 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
16498 void* e_ptr = untag_ptr(e);
16499 CHECK_ACCESS(e_ptr);
16500 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16501 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16502 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16503 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
16504 return tag_ptr(ret_conv, true);
16507 jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) {
16508 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
16509 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
16513 void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) {
16514 if (!ptr_is_owned(_res)) return;
16515 void* _res_ptr = untag_ptr(_res);
16516 CHECK_ACCESS(_res_ptr);
16517 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
16518 FREE(untag_ptr(_res));
16519 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
16522 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
16523 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16524 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
16525 return tag_ptr(ret_conv, true);
16527 int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) {
16528 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
16529 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
16533 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) {
16534 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
16535 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16536 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
16537 return tag_ptr(ret_conv, true);
16540 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) {
16541 LDKChannelDetails o_conv;
16542 o_conv.inner = untag_ptr(o);
16543 o_conv.is_owned = ptr_is_owned(o);
16544 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16545 o_conv = ChannelDetails_clone(&o_conv);
16546 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16547 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
16548 return tag_ptr(ret_conv, true);
16551 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
16552 void* e_ptr = untag_ptr(e);
16553 CHECK_ACCESS(e_ptr);
16554 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16555 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16556 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16557 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
16558 return tag_ptr(ret_conv, true);
16561 jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) {
16562 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
16563 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
16567 void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) {
16568 if (!ptr_is_owned(_res)) return;
16569 void* _res_ptr = untag_ptr(_res);
16570 CHECK_ACCESS(_res_ptr);
16571 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
16572 FREE(untag_ptr(_res));
16573 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
16576 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
16577 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16578 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
16579 return tag_ptr(ret_conv, true);
16581 int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) {
16582 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
16583 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
16587 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) {
16588 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
16589 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16590 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
16591 return tag_ptr(ret_conv, true);
16594 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) {
16595 LDKPhantomRouteHints o_conv;
16596 o_conv.inner = untag_ptr(o);
16597 o_conv.is_owned = ptr_is_owned(o);
16598 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16599 o_conv = PhantomRouteHints_clone(&o_conv);
16600 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16601 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
16602 return tag_ptr(ret_conv, true);
16605 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) {
16606 void* e_ptr = untag_ptr(e);
16607 CHECK_ACCESS(e_ptr);
16608 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16609 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16610 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16611 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
16612 return tag_ptr(ret_conv, true);
16615 jboolean __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(uint64_t o) {
16616 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
16617 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
16621 void __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_free"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_free(uint64_t _res) {
16622 if (!ptr_is_owned(_res)) return;
16623 void* _res_ptr = untag_ptr(_res);
16624 CHECK_ACCESS(_res_ptr);
16625 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
16626 FREE(untag_ptr(_res));
16627 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
16630 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
16631 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16632 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
16633 return tag_ptr(ret_conv, true);
16635 int64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(uint64_t arg) {
16636 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
16637 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
16641 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone(uint64_t orig) {
16642 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
16643 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16644 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
16645 return tag_ptr(ret_conv, true);
16648 void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) {
16649 LDKCVec_ChannelMonitorZ _res_constr;
16650 _res_constr.datalen = _res->arr_len;
16651 if (_res_constr.datalen > 0)
16652 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
16654 _res_constr.data = NULL;
16655 uint64_t* _res_vals = _res->elems;
16656 for (size_t q = 0; q < _res_constr.datalen; q++) {
16657 uint64_t _res_conv_16 = _res_vals[q];
16658 LDKChannelMonitor _res_conv_16_conv;
16659 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
16660 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
16661 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
16662 _res_constr.data[q] = _res_conv_16_conv;
16665 CVec_ChannelMonitorZ_free(_res_constr);
16668 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint64_t b) {
16669 LDKThirtyTwoBytes a_ref;
16670 CHECK(a->arr_len == 32);
16671 memcpy(a_ref.data, a->elems, 32); FREE(a);
16672 LDKChannelManager b_conv;
16673 b_conv.inner = untag_ptr(b);
16674 b_conv.is_owned = ptr_is_owned(b);
16675 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
16676 // WARNING: we need a move here but no clone is available for LDKChannelManager
16678 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
16679 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
16680 return tag_ptr(ret_conv, true);
16683 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint64_t _res) {
16684 if (!ptr_is_owned(_res)) return;
16685 void* _res_ptr = untag_ptr(_res);
16686 CHECK_ACCESS(_res_ptr);
16687 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
16688 FREE(untag_ptr(_res));
16689 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
16692 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint64_t o) {
16693 void* o_ptr = untag_ptr(o);
16694 CHECK_ACCESS(o_ptr);
16695 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
16696 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
16697 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
16698 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
16699 return tag_ptr(ret_conv, true);
16702 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
16703 void* e_ptr = untag_ptr(e);
16704 CHECK_ACCESS(e_ptr);
16705 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16706 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16707 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
16708 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
16709 return tag_ptr(ret_conv, true);
16712 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint64_t o) {
16713 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
16714 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
16718 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint64_t _res) {
16719 if (!ptr_is_owned(_res)) return;
16720 void* _res_ptr = untag_ptr(_res);
16721 CHECK_ACCESS(_res_ptr);
16722 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
16723 FREE(untag_ptr(_res));
16724 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
16727 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint64_t o) {
16728 LDKChannelConfig o_conv;
16729 o_conv.inner = untag_ptr(o);
16730 o_conv.is_owned = ptr_is_owned(o);
16731 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16732 o_conv = ChannelConfig_clone(&o_conv);
16733 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16734 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
16735 return tag_ptr(ret_conv, true);
16738 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
16739 void* e_ptr = untag_ptr(e);
16740 CHECK_ACCESS(e_ptr);
16741 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16742 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16743 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16744 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
16745 return tag_ptr(ret_conv, true);
16748 jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint64_t o) {
16749 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
16750 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
16754 void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint64_t _res) {
16755 if (!ptr_is_owned(_res)) return;
16756 void* _res_ptr = untag_ptr(_res);
16757 CHECK_ACCESS(_res_ptr);
16758 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
16759 FREE(untag_ptr(_res));
16760 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
16763 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
16764 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16765 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
16766 return tag_ptr(ret_conv, true);
16768 int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint64_t arg) {
16769 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
16770 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
16774 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint64_t orig) {
16775 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
16776 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16777 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
16778 return tag_ptr(ret_conv, true);
16781 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
16782 LDKOutPoint o_conv;
16783 o_conv.inner = untag_ptr(o);
16784 o_conv.is_owned = ptr_is_owned(o);
16785 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16786 o_conv = OutPoint_clone(&o_conv);
16787 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16788 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
16789 return tag_ptr(ret_conv, true);
16792 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
16793 void* e_ptr = untag_ptr(e);
16794 CHECK_ACCESS(e_ptr);
16795 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16796 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16797 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16798 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
16799 return tag_ptr(ret_conv, true);
16802 jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) {
16803 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
16804 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
16808 void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) {
16809 if (!ptr_is_owned(_res)) return;
16810 void* _res_ptr = untag_ptr(_res);
16811 CHECK_ACCESS(_res_ptr);
16812 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
16813 FREE(untag_ptr(_res));
16814 CResult_OutPointDecodeErrorZ_free(_res_conv);
16817 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
16818 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16819 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
16820 return tag_ptr(ret_conv, true);
16822 int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) {
16823 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
16824 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
16828 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) {
16829 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
16830 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16831 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
16832 return tag_ptr(ret_conv, true);
16835 uint64_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint64_t o) {
16836 void* o_ptr = untag_ptr(o);
16837 CHECK_ACCESS(o_ptr);
16838 LDKType o_conv = *(LDKType*)(o_ptr);
16839 if (o_conv.free == LDKType_JCalls_free) {
16840 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
16841 LDKType_JCalls_cloned(&o_conv);
16843 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16844 *ret_copy = COption_TypeZ_some(o_conv);
16845 uint64_t ret_ref = tag_ptr(ret_copy, true);
16849 uint64_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() {
16850 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16851 *ret_copy = COption_TypeZ_none();
16852 uint64_t ret_ref = tag_ptr(ret_copy, true);
16856 void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint64_t _res) {
16857 if (!ptr_is_owned(_res)) return;
16858 void* _res_ptr = untag_ptr(_res);
16859 CHECK_ACCESS(_res_ptr);
16860 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
16861 FREE(untag_ptr(_res));
16862 COption_TypeZ_free(_res_conv);
16865 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
16866 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16867 *ret_copy = COption_TypeZ_clone(arg);
16868 uint64_t ret_ref = tag_ptr(ret_copy, true);
16871 int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint64_t arg) {
16872 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
16873 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
16877 uint64_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_TypeZ_clone(uint64_t orig) {
16878 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
16879 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16880 *ret_copy = COption_TypeZ_clone(orig_conv);
16881 uint64_t ret_ref = tag_ptr(ret_copy, true);
16885 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint64_t o) {
16886 void* o_ptr = untag_ptr(o);
16887 CHECK_ACCESS(o_ptr);
16888 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
16889 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
16890 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16891 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
16892 return tag_ptr(ret_conv, true);
16895 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
16896 void* e_ptr = untag_ptr(e);
16897 CHECK_ACCESS(e_ptr);
16898 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16899 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16900 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16901 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
16902 return tag_ptr(ret_conv, true);
16905 jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint64_t o) {
16906 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
16907 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
16911 void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint64_t _res) {
16912 if (!ptr_is_owned(_res)) return;
16913 void* _res_ptr = untag_ptr(_res);
16914 CHECK_ACCESS(_res_ptr);
16915 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
16916 FREE(untag_ptr(_res));
16917 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
16920 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
16921 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16922 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
16923 return tag_ptr(ret_conv, true);
16925 int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint64_t arg) {
16926 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
16927 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
16931 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint64_t orig) {
16932 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
16933 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16934 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
16935 return tag_ptr(ret_conv, true);
16938 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_ok"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
16939 LDKThirtyTwoBytes o_ref;
16940 CHECK(o->arr_len == 32);
16941 memcpy(o_ref.data, o->elems, 32); FREE(o);
16942 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16943 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
16944 return tag_ptr(ret_conv, true);
16947 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_err"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint64_t e) {
16948 void* e_ptr = untag_ptr(e);
16949 CHECK_ACCESS(e_ptr);
16950 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
16951 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
16952 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16953 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
16954 return tag_ptr(ret_conv, true);
16957 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_is_ok"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint64_t o) {
16958 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
16959 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
16963 void __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_free"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint64_t _res) {
16964 if (!ptr_is_owned(_res)) return;
16965 void* _res_ptr = untag_ptr(_res);
16966 CHECK_ACCESS(_res_ptr);
16967 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
16968 FREE(untag_ptr(_res));
16969 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
16972 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
16973 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16974 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
16975 return tag_ptr(ret_conv, true);
16977 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone_ptr"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint64_t arg) {
16978 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
16979 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
16983 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint64_t orig) {
16984 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
16985 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16986 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
16987 return tag_ptr(ret_conv, true);
16990 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_ok(uint64_t o) {
16991 LDKInFlightHtlcs o_conv;
16992 o_conv.inner = untag_ptr(o);
16993 o_conv.is_owned = ptr_is_owned(o);
16994 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16995 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
16997 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
16998 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
16999 return tag_ptr(ret_conv, true);
17002 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_err(uint64_t e) {
17003 void* e_ptr = untag_ptr(e);
17004 CHECK_ACCESS(e_ptr);
17005 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17006 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17007 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17008 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
17009 return tag_ptr(ret_conv, true);
17012 jboolean __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok(uint64_t o) {
17013 LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
17014 jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
17018 void __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_free"))) TS_CResult_InFlightHtlcsDecodeErrorZ_free(uint64_t _res) {
17019 if (!ptr_is_owned(_res)) return;
17020 void* _res_ptr = untag_ptr(_res);
17021 CHECK_ACCESS(_res_ptr);
17022 LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
17023 FREE(untag_ptr(_res));
17024 CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
17027 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
17028 LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
17029 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
17030 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
17031 return tag_ptr(ret_conv, true);
17034 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
17035 void* e_ptr = untag_ptr(e);
17036 CHECK_ACCESS(e_ptr);
17037 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
17038 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
17039 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
17040 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
17041 return tag_ptr(ret_conv, true);
17044 jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
17045 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
17046 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
17050 void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
17051 if (!ptr_is_owned(_res)) return;
17052 void* _res_ptr = untag_ptr(_res);
17053 CHECK_ACCESS(_res_ptr);
17054 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
17055 FREE(untag_ptr(_res));
17056 CResult_SiPrefixParseErrorZ_free(_res_conv);
17059 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
17060 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
17061 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
17062 return tag_ptr(ret_conv, true);
17064 int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
17065 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
17066 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
17070 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
17071 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
17072 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
17073 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
17074 return tag_ptr(ret_conv, true);
17077 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
17079 o_conv.inner = untag_ptr(o);
17080 o_conv.is_owned = ptr_is_owned(o);
17081 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17082 o_conv = Invoice_clone(&o_conv);
17083 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17084 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
17085 return tag_ptr(ret_conv, true);
17088 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
17089 void* e_ptr = untag_ptr(e);
17090 CHECK_ACCESS(e_ptr);
17091 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
17092 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
17093 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17094 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
17095 return tag_ptr(ret_conv, true);
17098 jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
17099 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
17100 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
17104 void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
17105 if (!ptr_is_owned(_res)) return;
17106 void* _res_ptr = untag_ptr(_res);
17107 CHECK_ACCESS(_res_ptr);
17108 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
17109 FREE(untag_ptr(_res));
17110 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
17113 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
17114 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17115 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
17116 return tag_ptr(ret_conv, true);
17118 int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
17119 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
17120 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
17124 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
17125 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
17126 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17127 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
17128 return tag_ptr(ret_conv, true);
17131 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
17132 LDKSignedRawInvoice o_conv;
17133 o_conv.inner = untag_ptr(o);
17134 o_conv.is_owned = ptr_is_owned(o);
17135 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17136 o_conv = SignedRawInvoice_clone(&o_conv);
17137 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17138 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
17139 return tag_ptr(ret_conv, true);
17142 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
17143 void* e_ptr = untag_ptr(e);
17144 CHECK_ACCESS(e_ptr);
17145 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
17146 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
17147 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17148 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
17149 return tag_ptr(ret_conv, true);
17152 jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
17153 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
17154 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
17158 void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
17159 if (!ptr_is_owned(_res)) return;
17160 void* _res_ptr = untag_ptr(_res);
17161 CHECK_ACCESS(_res_ptr);
17162 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
17163 FREE(untag_ptr(_res));
17164 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
17167 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
17168 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17169 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
17170 return tag_ptr(ret_conv, true);
17172 int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
17173 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
17174 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
17178 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
17179 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
17180 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17181 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
17182 return tag_ptr(ret_conv, true);
17185 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
17186 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17187 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
17188 return tag_ptr(ret_conv, true);
17190 int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
17191 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
17192 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
17196 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
17197 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
17198 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17199 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
17200 return tag_ptr(ret_conv, true);
17203 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
17204 LDKRawInvoice a_conv;
17205 a_conv.inner = untag_ptr(a);
17206 a_conv.is_owned = ptr_is_owned(a);
17207 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17208 a_conv = RawInvoice_clone(&a_conv);
17209 LDKThirtyTwoBytes b_ref;
17210 CHECK(b->arr_len == 32);
17211 memcpy(b_ref.data, b->elems, 32); FREE(b);
17212 LDKInvoiceSignature c_conv;
17213 c_conv.inner = untag_ptr(c);
17214 c_conv.is_owned = ptr_is_owned(c);
17215 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
17216 c_conv = InvoiceSignature_clone(&c_conv);
17217 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17218 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
17219 return tag_ptr(ret_conv, true);
17222 void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
17223 if (!ptr_is_owned(_res)) return;
17224 void* _res_ptr = untag_ptr(_res);
17225 CHECK_ACCESS(_res_ptr);
17226 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
17227 FREE(untag_ptr(_res));
17228 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
17231 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
17232 LDKPayeePubKey o_conv;
17233 o_conv.inner = untag_ptr(o);
17234 o_conv.is_owned = ptr_is_owned(o);
17235 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17236 o_conv = PayeePubKey_clone(&o_conv);
17237 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17238 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
17239 return tag_ptr(ret_conv, true);
17242 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
17243 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
17244 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17245 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
17246 return tag_ptr(ret_conv, true);
17249 jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
17250 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
17251 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
17255 void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
17256 if (!ptr_is_owned(_res)) return;
17257 void* _res_ptr = untag_ptr(_res);
17258 CHECK_ACCESS(_res_ptr);
17259 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
17260 FREE(untag_ptr(_res));
17261 CResult_PayeePubKeyErrorZ_free(_res_conv);
17264 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
17265 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17266 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
17267 return tag_ptr(ret_conv, true);
17269 int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
17270 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
17271 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
17275 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
17276 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
17277 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17278 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
17279 return tag_ptr(ret_conv, true);
17282 void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
17283 LDKCVec_PrivateRouteZ _res_constr;
17284 _res_constr.datalen = _res->arr_len;
17285 if (_res_constr.datalen > 0)
17286 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
17288 _res_constr.data = NULL;
17289 uint64_t* _res_vals = _res->elems;
17290 for (size_t o = 0; o < _res_constr.datalen; o++) {
17291 uint64_t _res_conv_14 = _res_vals[o];
17292 LDKPrivateRoute _res_conv_14_conv;
17293 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
17294 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
17295 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
17296 _res_constr.data[o] = _res_conv_14_conv;
17299 CVec_PrivateRouteZ_free(_res_constr);
17302 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
17303 LDKPositiveTimestamp o_conv;
17304 o_conv.inner = untag_ptr(o);
17305 o_conv.is_owned = ptr_is_owned(o);
17306 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17307 o_conv = PositiveTimestamp_clone(&o_conv);
17308 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17309 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
17310 return tag_ptr(ret_conv, true);
17313 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
17314 LDKCreationError e_conv = LDKCreationError_from_js(e);
17315 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17316 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
17317 return tag_ptr(ret_conv, true);
17320 jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
17321 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
17322 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
17326 void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
17327 if (!ptr_is_owned(_res)) return;
17328 void* _res_ptr = untag_ptr(_res);
17329 CHECK_ACCESS(_res_ptr);
17330 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
17331 FREE(untag_ptr(_res));
17332 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
17335 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
17336 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17337 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
17338 return tag_ptr(ret_conv, true);
17340 int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
17341 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
17342 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
17346 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
17347 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
17348 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17349 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
17350 return tag_ptr(ret_conv, true);
17353 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
17354 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17355 *ret_conv = CResult_NoneSemanticErrorZ_ok();
17356 return tag_ptr(ret_conv, true);
17359 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
17360 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
17361 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17362 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
17363 return tag_ptr(ret_conv, true);
17366 jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
17367 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
17368 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
17372 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
17373 if (!ptr_is_owned(_res)) return;
17374 void* _res_ptr = untag_ptr(_res);
17375 CHECK_ACCESS(_res_ptr);
17376 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
17377 FREE(untag_ptr(_res));
17378 CResult_NoneSemanticErrorZ_free(_res_conv);
17381 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
17382 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17383 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
17384 return tag_ptr(ret_conv, true);
17386 int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
17387 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
17388 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
17392 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
17393 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
17394 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17395 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
17396 return tag_ptr(ret_conv, true);
17399 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
17401 o_conv.inner = untag_ptr(o);
17402 o_conv.is_owned = ptr_is_owned(o);
17403 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17404 o_conv = Invoice_clone(&o_conv);
17405 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17406 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
17407 return tag_ptr(ret_conv, true);
17410 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
17411 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
17412 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17413 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
17414 return tag_ptr(ret_conv, true);
17417 jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
17418 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
17419 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
17423 void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
17424 if (!ptr_is_owned(_res)) return;
17425 void* _res_ptr = untag_ptr(_res);
17426 CHECK_ACCESS(_res_ptr);
17427 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
17428 FREE(untag_ptr(_res));
17429 CResult_InvoiceSemanticErrorZ_free(_res_conv);
17432 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
17433 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17434 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
17435 return tag_ptr(ret_conv, true);
17437 int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
17438 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
17439 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
17443 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
17444 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
17445 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17446 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
17447 return tag_ptr(ret_conv, true);
17450 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
17451 LDKDescription o_conv;
17452 o_conv.inner = untag_ptr(o);
17453 o_conv.is_owned = ptr_is_owned(o);
17454 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17455 o_conv = Description_clone(&o_conv);
17456 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17457 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
17458 return tag_ptr(ret_conv, true);
17461 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
17462 LDKCreationError e_conv = LDKCreationError_from_js(e);
17463 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17464 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
17465 return tag_ptr(ret_conv, true);
17468 jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
17469 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
17470 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
17474 void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
17475 if (!ptr_is_owned(_res)) return;
17476 void* _res_ptr = untag_ptr(_res);
17477 CHECK_ACCESS(_res_ptr);
17478 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
17479 FREE(untag_ptr(_res));
17480 CResult_DescriptionCreationErrorZ_free(_res_conv);
17483 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
17484 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17485 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
17486 return tag_ptr(ret_conv, true);
17488 int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
17489 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
17490 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
17494 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
17495 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
17496 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17497 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
17498 return tag_ptr(ret_conv, true);
17501 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
17502 LDKPrivateRoute o_conv;
17503 o_conv.inner = untag_ptr(o);
17504 o_conv.is_owned = ptr_is_owned(o);
17505 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17506 o_conv = PrivateRoute_clone(&o_conv);
17507 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17508 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
17509 return tag_ptr(ret_conv, true);
17512 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
17513 LDKCreationError e_conv = LDKCreationError_from_js(e);
17514 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17515 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
17516 return tag_ptr(ret_conv, true);
17519 jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
17520 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
17521 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
17525 void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
17526 if (!ptr_is_owned(_res)) return;
17527 void* _res_ptr = untag_ptr(_res);
17528 CHECK_ACCESS(_res_ptr);
17529 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
17530 FREE(untag_ptr(_res));
17531 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
17534 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
17535 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17536 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
17537 return tag_ptr(ret_conv, true);
17539 int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
17540 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
17541 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
17545 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
17546 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
17547 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17548 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
17549 return tag_ptr(ret_conv, true);
17552 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
17553 LDKStr o_conv = str_ref_to_owned_c(o);
17554 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17555 *ret_conv = CResult_StringErrorZ_ok(o_conv);
17556 return tag_ptr(ret_conv, true);
17559 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
17560 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
17561 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17562 *ret_conv = CResult_StringErrorZ_err(e_conv);
17563 return tag_ptr(ret_conv, true);
17566 jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
17567 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
17568 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
17572 void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
17573 if (!ptr_is_owned(_res)) return;
17574 void* _res_ptr = untag_ptr(_res);
17575 CHECK_ACCESS(_res_ptr);
17576 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
17577 FREE(untag_ptr(_res));
17578 CResult_StringErrorZ_free(_res_conv);
17581 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
17582 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17583 *ret_conv = CResult_StringErrorZ_clone(arg);
17584 return tag_ptr(ret_conv, true);
17586 int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
17587 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
17588 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
17592 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
17593 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
17594 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17595 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
17596 return tag_ptr(ret_conv, true);
17599 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
17600 LDKChannelMonitorUpdate o_conv;
17601 o_conv.inner = untag_ptr(o);
17602 o_conv.is_owned = ptr_is_owned(o);
17603 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17604 o_conv = ChannelMonitorUpdate_clone(&o_conv);
17605 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17606 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
17607 return tag_ptr(ret_conv, true);
17610 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
17611 void* e_ptr = untag_ptr(e);
17612 CHECK_ACCESS(e_ptr);
17613 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17614 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17615 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17616 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
17617 return tag_ptr(ret_conv, true);
17620 jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
17621 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
17622 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
17626 void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
17627 if (!ptr_is_owned(_res)) return;
17628 void* _res_ptr = untag_ptr(_res);
17629 CHECK_ACCESS(_res_ptr);
17630 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
17631 FREE(untag_ptr(_res));
17632 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
17635 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
17636 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17637 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
17638 return tag_ptr(ret_conv, true);
17640 int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
17641 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
17642 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
17646 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
17647 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
17648 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17649 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
17650 return tag_ptr(ret_conv, true);
17653 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
17654 void* o_ptr = untag_ptr(o);
17655 CHECK_ACCESS(o_ptr);
17656 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
17657 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
17658 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17659 *ret_copy = COption_MonitorEventZ_some(o_conv);
17660 uint64_t ret_ref = tag_ptr(ret_copy, true);
17664 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
17665 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17666 *ret_copy = COption_MonitorEventZ_none();
17667 uint64_t ret_ref = tag_ptr(ret_copy, true);
17671 void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
17672 if (!ptr_is_owned(_res)) return;
17673 void* _res_ptr = untag_ptr(_res);
17674 CHECK_ACCESS(_res_ptr);
17675 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
17676 FREE(untag_ptr(_res));
17677 COption_MonitorEventZ_free(_res_conv);
17680 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
17681 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17682 *ret_copy = COption_MonitorEventZ_clone(arg);
17683 uint64_t ret_ref = tag_ptr(ret_copy, true);
17686 int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
17687 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
17688 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
17692 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
17693 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
17694 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17695 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
17696 uint64_t ret_ref = tag_ptr(ret_copy, true);
17700 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
17701 void* o_ptr = untag_ptr(o);
17702 CHECK_ACCESS(o_ptr);
17703 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
17704 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
17705 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17706 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
17707 return tag_ptr(ret_conv, true);
17710 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
17711 void* e_ptr = untag_ptr(e);
17712 CHECK_ACCESS(e_ptr);
17713 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17714 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17715 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17716 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
17717 return tag_ptr(ret_conv, true);
17720 jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
17721 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
17722 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
17726 void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
17727 if (!ptr_is_owned(_res)) return;
17728 void* _res_ptr = untag_ptr(_res);
17729 CHECK_ACCESS(_res_ptr);
17730 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
17731 FREE(untag_ptr(_res));
17732 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
17735 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
17736 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17737 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
17738 return tag_ptr(ret_conv, true);
17740 int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
17741 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
17742 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
17746 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
17747 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
17748 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17749 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
17750 return tag_ptr(ret_conv, true);
17753 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
17754 LDKHTLCUpdate o_conv;
17755 o_conv.inner = untag_ptr(o);
17756 o_conv.is_owned = ptr_is_owned(o);
17757 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17758 o_conv = HTLCUpdate_clone(&o_conv);
17759 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17760 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
17761 return tag_ptr(ret_conv, true);
17764 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
17765 void* e_ptr = untag_ptr(e);
17766 CHECK_ACCESS(e_ptr);
17767 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17768 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17769 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17770 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
17771 return tag_ptr(ret_conv, true);
17774 jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint64_t o) {
17775 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
17776 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
17780 void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint64_t _res) {
17781 if (!ptr_is_owned(_res)) return;
17782 void* _res_ptr = untag_ptr(_res);
17783 CHECK_ACCESS(_res_ptr);
17784 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
17785 FREE(untag_ptr(_res));
17786 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
17789 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
17790 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17791 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
17792 return tag_ptr(ret_conv, true);
17794 int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
17795 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
17796 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
17800 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint64_t orig) {
17801 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
17802 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17803 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
17804 return tag_ptr(ret_conv, true);
17807 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
17808 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17809 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
17810 return tag_ptr(ret_conv, true);
17812 int64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone_ptr"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint64_t arg) {
17813 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
17814 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
17818 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone"))) TS_C2Tuple_OutPointScriptZ_clone(uint64_t orig) {
17819 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
17820 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17821 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
17822 return tag_ptr(ret_conv, true);
17825 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint64_t a, int8_tArray b) {
17826 LDKOutPoint a_conv;
17827 a_conv.inner = untag_ptr(a);
17828 a_conv.is_owned = ptr_is_owned(a);
17829 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17830 a_conv = OutPoint_clone(&a_conv);
17832 b_ref.datalen = b->arr_len;
17833 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
17834 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
17835 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17836 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
17837 return tag_ptr(ret_conv, true);
17840 void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint64_t _res) {
17841 if (!ptr_is_owned(_res)) return;
17842 void* _res_ptr = untag_ptr(_res);
17843 CHECK_ACCESS(_res_ptr);
17844 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
17845 FREE(untag_ptr(_res));
17846 C2Tuple_OutPointScriptZ_free(_res_conv);
17849 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
17850 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17851 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
17852 return tag_ptr(ret_conv, true);
17854 int64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone_ptr"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint64_t arg) {
17855 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
17856 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
17860 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone"))) TS_C2Tuple_u32ScriptZ_clone(uint64_t orig) {
17861 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
17862 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17863 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
17864 return tag_ptr(ret_conv, true);
17867 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
17869 b_ref.datalen = b->arr_len;
17870 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
17871 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
17872 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17873 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
17874 return tag_ptr(ret_conv, true);
17877 void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint64_t _res) {
17878 if (!ptr_is_owned(_res)) return;
17879 void* _res_ptr = untag_ptr(_res);
17880 CHECK_ACCESS(_res_ptr);
17881 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
17882 FREE(untag_ptr(_res));
17883 C2Tuple_u32ScriptZ_free(_res_conv);
17886 void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint64_tArray _res) {
17887 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
17888 _res_constr.datalen = _res->arr_len;
17889 if (_res_constr.datalen > 0)
17890 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
17892 _res_constr.data = NULL;
17893 uint64_t* _res_vals = _res->elems;
17894 for (size_t v = 0; v < _res_constr.datalen; v++) {
17895 uint64_t _res_conv_21 = _res_vals[v];
17896 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
17897 CHECK_ACCESS(_res_conv_21_ptr);
17898 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
17899 FREE(untag_ptr(_res_conv_21));
17900 _res_constr.data[v] = _res_conv_21_conv;
17903 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
17906 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
17907 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17908 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
17909 return tag_ptr(ret_conv, true);
17911 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint64_t arg) {
17912 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
17913 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
17917 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint64_t orig) {
17918 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
17919 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17920 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
17921 return tag_ptr(ret_conv, true);
17924 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint64_tArray b) {
17925 LDKThirtyTwoBytes a_ref;
17926 CHECK(a->arr_len == 32);
17927 memcpy(a_ref.data, a->elems, 32); FREE(a);
17928 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
17929 b_constr.datalen = b->arr_len;
17930 if (b_constr.datalen > 0)
17931 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
17933 b_constr.data = NULL;
17934 uint64_t* b_vals = b->elems;
17935 for (size_t v = 0; v < b_constr.datalen; v++) {
17936 uint64_t b_conv_21 = b_vals[v];
17937 void* b_conv_21_ptr = untag_ptr(b_conv_21);
17938 CHECK_ACCESS(b_conv_21_ptr);
17939 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
17940 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
17941 b_constr.data[v] = b_conv_21_conv;
17944 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17945 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
17946 return tag_ptr(ret_conv, true);
17949 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint64_t _res) {
17950 if (!ptr_is_owned(_res)) return;
17951 void* _res_ptr = untag_ptr(_res);
17952 CHECK_ACCESS(_res_ptr);
17953 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
17954 FREE(untag_ptr(_res));
17955 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
17958 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint64_tArray _res) {
17959 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
17960 _res_constr.datalen = _res->arr_len;
17961 if (_res_constr.datalen > 0)
17962 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
17964 _res_constr.data = NULL;
17965 uint64_t* _res_vals = _res->elems;
17966 for (size_t o = 0; o < _res_constr.datalen; o++) {
17967 uint64_t _res_conv_40 = _res_vals[o];
17968 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
17969 CHECK_ACCESS(_res_conv_40_ptr);
17970 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
17971 FREE(untag_ptr(_res_conv_40));
17972 _res_constr.data[o] = _res_conv_40_conv;
17975 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
17978 void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(uint64_tArray _res) {
17979 LDKCVec_EventZ _res_constr;
17980 _res_constr.datalen = _res->arr_len;
17981 if (_res_constr.datalen > 0)
17982 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
17984 _res_constr.data = NULL;
17985 uint64_t* _res_vals = _res->elems;
17986 for (size_t h = 0; h < _res_constr.datalen; h++) {
17987 uint64_t _res_conv_7 = _res_vals[h];
17988 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
17989 CHECK_ACCESS(_res_conv_7_ptr);
17990 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
17991 FREE(untag_ptr(_res_conv_7));
17992 _res_constr.data[h] = _res_conv_7_conv;
17995 CVec_EventZ_free(_res_constr);
17998 void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) {
17999 LDKCVec_TransactionZ _res_constr;
18000 _res_constr.datalen = _res->arr_len;
18001 if (_res_constr.datalen > 0)
18002 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
18004 _res_constr.data = NULL;
18005 int8_tArray* _res_vals = (void*) _res->elems;
18006 for (size_t m = 0; m < _res_constr.datalen; m++) {
18007 int8_tArray _res_conv_12 = _res_vals[m];
18008 LDKTransaction _res_conv_12_ref;
18009 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
18010 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
18011 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
18012 _res_conv_12_ref.data_is_owned = true;
18013 _res_constr.data[m] = _res_conv_12_ref;
18016 CVec_TransactionZ_free(_res_constr);
18019 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
18020 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
18021 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
18022 return tag_ptr(ret_conv, true);
18024 int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint64_t arg) {
18025 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
18026 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
18030 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_u32TxOutZ_clone(uint64_t orig) {
18031 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
18032 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
18033 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
18034 return tag_ptr(ret_conv, true);
18037 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint64_t b) {
18038 void* b_ptr = untag_ptr(b);
18039 CHECK_ACCESS(b_ptr);
18040 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
18041 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
18042 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
18043 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
18044 return tag_ptr(ret_conv, true);
18047 void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint64_t _res) {
18048 if (!ptr_is_owned(_res)) return;
18049 void* _res_ptr = untag_ptr(_res);
18050 CHECK_ACCESS(_res_ptr);
18051 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
18052 FREE(untag_ptr(_res));
18053 C2Tuple_u32TxOutZ_free(_res_conv);
18056 void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uint64_tArray _res) {
18057 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
18058 _res_constr.datalen = _res->arr_len;
18059 if (_res_constr.datalen > 0)
18060 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
18062 _res_constr.data = NULL;
18063 uint64_t* _res_vals = _res->elems;
18064 for (size_t u = 0; u < _res_constr.datalen; u++) {
18065 uint64_t _res_conv_20 = _res_vals[u];
18066 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
18067 CHECK_ACCESS(_res_conv_20_ptr);
18068 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
18069 FREE(untag_ptr(_res_conv_20));
18070 _res_constr.data[u] = _res_conv_20_conv;
18073 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
18076 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
18077 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18078 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
18079 return tag_ptr(ret_conv, true);
18081 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint64_t arg) {
18082 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
18083 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
18087 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint64_t orig) {
18088 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
18089 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18090 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
18091 return tag_ptr(ret_conv, true);
18094 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint64_tArray b) {
18095 LDKThirtyTwoBytes a_ref;
18096 CHECK(a->arr_len == 32);
18097 memcpy(a_ref.data, a->elems, 32); FREE(a);
18098 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
18099 b_constr.datalen = b->arr_len;
18100 if (b_constr.datalen > 0)
18101 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
18103 b_constr.data = NULL;
18104 uint64_t* b_vals = b->elems;
18105 for (size_t u = 0; u < b_constr.datalen; u++) {
18106 uint64_t b_conv_20 = b_vals[u];
18107 void* b_conv_20_ptr = untag_ptr(b_conv_20);
18108 CHECK_ACCESS(b_conv_20_ptr);
18109 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
18110 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
18111 b_constr.data[u] = b_conv_20_conv;
18114 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18115 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
18116 return tag_ptr(ret_conv, true);
18119 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint64_t _res) {
18120 if (!ptr_is_owned(_res)) return;
18121 void* _res_ptr = untag_ptr(_res);
18122 CHECK_ACCESS(_res_ptr);
18123 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
18124 FREE(untag_ptr(_res));
18125 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
18128 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint64_tArray _res) {
18129 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
18130 _res_constr.datalen = _res->arr_len;
18131 if (_res_constr.datalen > 0)
18132 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
18134 _res_constr.data = NULL;
18135 uint64_t* _res_vals = _res->elems;
18136 for (size_t n = 0; n < _res_constr.datalen; n++) {
18137 uint64_t _res_conv_39 = _res_vals[n];
18138 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
18139 CHECK_ACCESS(_res_conv_39_ptr);
18140 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
18141 FREE(untag_ptr(_res_conv_39));
18142 _res_constr.data[n] = _res_conv_39_conv;
18145 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
18148 void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_free(uint64_tArray _res) {
18149 LDKCVec_BalanceZ _res_constr;
18150 _res_constr.datalen = _res->arr_len;
18151 if (_res_constr.datalen > 0)
18152 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
18154 _res_constr.data = NULL;
18155 uint64_t* _res_vals = _res->elems;
18156 for (size_t j = 0; j < _res_constr.datalen; j++) {
18157 uint64_t _res_conv_9 = _res_vals[j];
18158 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
18159 CHECK_ACCESS(_res_conv_9_ptr);
18160 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
18161 FREE(untag_ptr(_res_conv_9));
18162 _res_constr.data[j] = _res_conv_9_conv;
18165 CVec_BalanceZ_free(_res_constr);
18168 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
18169 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18170 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
18171 return tag_ptr(ret_conv, true);
18173 int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint64_t arg) {
18174 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
18175 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
18179 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint64_t orig) {
18180 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
18181 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18182 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
18183 return tag_ptr(ret_conv, true);
18186 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint64_t b) {
18187 LDKThirtyTwoBytes a_ref;
18188 CHECK(a->arr_len == 32);
18189 memcpy(a_ref.data, a->elems, 32); FREE(a);
18190 LDKChannelMonitor b_conv;
18191 b_conv.inner = untag_ptr(b);
18192 b_conv.is_owned = ptr_is_owned(b);
18193 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
18194 b_conv = ChannelMonitor_clone(&b_conv);
18195 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18196 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
18197 return tag_ptr(ret_conv, true);
18200 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint64_t _res) {
18201 if (!ptr_is_owned(_res)) return;
18202 void* _res_ptr = untag_ptr(_res);
18203 CHECK_ACCESS(_res_ptr);
18204 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
18205 FREE(untag_ptr(_res));
18206 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
18209 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint64_t o) {
18210 void* o_ptr = untag_ptr(o);
18211 CHECK_ACCESS(o_ptr);
18212 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
18213 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
18214 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18215 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
18216 return tag_ptr(ret_conv, true);
18219 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
18220 void* e_ptr = untag_ptr(e);
18221 CHECK_ACCESS(e_ptr);
18222 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18223 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18224 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18225 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
18226 return tag_ptr(ret_conv, true);
18229 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint64_t o) {
18230 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
18231 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
18235 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint64_t _res) {
18236 if (!ptr_is_owned(_res)) return;
18237 void* _res_ptr = untag_ptr(_res);
18238 CHECK_ACCESS(_res_ptr);
18239 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
18240 FREE(untag_ptr(_res));
18241 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
18244 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
18245 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18246 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
18247 return tag_ptr(ret_conv, true);
18249 int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint64_t arg) {
18250 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
18251 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
18255 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint64_t orig) {
18256 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
18257 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18258 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
18259 return tag_ptr(ret_conv, true);
18262 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
18263 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18264 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
18265 return tag_ptr(ret_conv, true);
18267 int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint64_t arg) {
18268 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
18269 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
18273 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
18274 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
18275 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18276 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
18277 return tag_ptr(ret_conv, true);
18280 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
18281 LDKPublicKey a_ref;
18282 CHECK(a->arr_len == 33);
18283 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
18284 void* b_ptr = untag_ptr(b);
18285 CHECK_ACCESS(b_ptr);
18286 LDKType b_conv = *(LDKType*)(b_ptr);
18287 if (b_conv.free == LDKType_JCalls_free) {
18288 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
18289 LDKType_JCalls_cloned(&b_conv);
18291 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18292 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
18293 return tag_ptr(ret_conv, true);
18296 void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
18297 if (!ptr_is_owned(_res)) return;
18298 void* _res_ptr = untag_ptr(_res);
18299 CHECK_ACCESS(_res_ptr);
18300 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
18301 FREE(untag_ptr(_res));
18302 C2Tuple_PublicKeyTypeZ_free(_res_conv);
18305 void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
18306 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
18307 _res_constr.datalen = _res->arr_len;
18308 if (_res_constr.datalen > 0)
18309 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
18311 _res_constr.data = NULL;
18312 uint64_t* _res_vals = _res->elems;
18313 for (size_t z = 0; z < _res_constr.datalen; z++) {
18314 uint64_t _res_conv_25 = _res_vals[z];
18315 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
18316 CHECK_ACCESS(_res_conv_25_ptr);
18317 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
18318 FREE(untag_ptr(_res_conv_25));
18319 _res_constr.data[z] = _res_conv_25_conv;
18322 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
18325 uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_some"))) TS_COption_CustomOnionMessageContentsZ_some(uint64_t o) {
18326 void* o_ptr = untag_ptr(o);
18327 CHECK_ACCESS(o_ptr);
18328 LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
18329 if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
18330 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
18331 LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
18333 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
18334 *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
18335 uint64_t ret_ref = tag_ptr(ret_copy, true);
18339 uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_none"))) TS_COption_CustomOnionMessageContentsZ_none() {
18340 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
18341 *ret_copy = COption_CustomOnionMessageContentsZ_none();
18342 uint64_t ret_ref = tag_ptr(ret_copy, true);
18346 void __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_free"))) TS_COption_CustomOnionMessageContentsZ_free(uint64_t _res) {
18347 if (!ptr_is_owned(_res)) return;
18348 void* _res_ptr = untag_ptr(_res);
18349 CHECK_ACCESS(_res_ptr);
18350 LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
18351 FREE(untag_ptr(_res));
18352 COption_CustomOnionMessageContentsZ_free(_res_conv);
18355 static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
18356 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
18357 *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
18358 uint64_t ret_ref = tag_ptr(ret_copy, true);
18361 int64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone_ptr"))) TS_COption_CustomOnionMessageContentsZ_clone_ptr(uint64_t arg) {
18362 LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
18363 int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
18367 uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone"))) TS_COption_CustomOnionMessageContentsZ_clone(uint64_t orig) {
18368 LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
18369 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
18370 *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv);
18371 uint64_t ret_ref = tag_ptr(ret_copy, true);
18375 uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(uint64_t o) {
18376 void* o_ptr = untag_ptr(o);
18377 CHECK_ACCESS(o_ptr);
18378 LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
18379 o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
18380 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
18381 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
18382 return tag_ptr(ret_conv, true);
18385 uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(uint64_t e) {
18386 void* e_ptr = untag_ptr(e);
18387 CHECK_ACCESS(e_ptr);
18388 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18389 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18390 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
18391 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
18392 return tag_ptr(ret_conv, true);
18395 jboolean __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(uint64_t o) {
18396 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
18397 jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
18401 void __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(uint64_t _res) {
18402 if (!ptr_is_owned(_res)) return;
18403 void* _res_ptr = untag_ptr(_res);
18404 CHECK_ACCESS(_res_ptr);
18405 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
18406 FREE(untag_ptr(_res));
18407 CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
18410 static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
18411 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
18412 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
18413 return tag_ptr(ret_conv, true);
18415 int64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(uint64_t arg) {
18416 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
18417 int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
18421 uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(uint64_t orig) {
18422 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
18423 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
18424 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
18425 return tag_ptr(ret_conv, true);
18428 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
18429 void* o_ptr = untag_ptr(o);
18430 CHECK_ACCESS(o_ptr);
18431 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
18432 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
18433 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18434 *ret_copy = COption_NetAddressZ_some(o_conv);
18435 uint64_t ret_ref = tag_ptr(ret_copy, true);
18439 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
18440 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18441 *ret_copy = COption_NetAddressZ_none();
18442 uint64_t ret_ref = tag_ptr(ret_copy, true);
18446 void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
18447 if (!ptr_is_owned(_res)) return;
18448 void* _res_ptr = untag_ptr(_res);
18449 CHECK_ACCESS(_res_ptr);
18450 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
18451 FREE(untag_ptr(_res));
18452 COption_NetAddressZ_free(_res_conv);
18455 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
18456 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18457 *ret_copy = COption_NetAddressZ_clone(arg);
18458 uint64_t ret_ref = tag_ptr(ret_copy, true);
18461 int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
18462 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
18463 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
18467 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
18468 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
18469 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18470 *ret_copy = COption_NetAddressZ_clone(orig_conv);
18471 uint64_t ret_ref = tag_ptr(ret_copy, true);
18475 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
18477 o_ref.datalen = o->arr_len;
18478 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
18479 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
18480 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18481 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
18482 return tag_ptr(ret_conv, true);
18485 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
18486 LDKPeerHandleError e_conv;
18487 e_conv.inner = untag_ptr(e);
18488 e_conv.is_owned = ptr_is_owned(e);
18489 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18490 e_conv = PeerHandleError_clone(&e_conv);
18491 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18492 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
18493 return tag_ptr(ret_conv, true);
18496 jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
18497 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
18498 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
18502 void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
18503 if (!ptr_is_owned(_res)) return;
18504 void* _res_ptr = untag_ptr(_res);
18505 CHECK_ACCESS(_res_ptr);
18506 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
18507 FREE(untag_ptr(_res));
18508 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
18511 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
18512 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18513 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
18514 return tag_ptr(ret_conv, true);
18516 int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
18517 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
18518 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
18522 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
18523 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
18524 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18525 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
18526 return tag_ptr(ret_conv, true);
18529 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
18530 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18531 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
18532 return tag_ptr(ret_conv, true);
18535 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
18536 LDKPeerHandleError e_conv;
18537 e_conv.inner = untag_ptr(e);
18538 e_conv.is_owned = ptr_is_owned(e);
18539 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18540 e_conv = PeerHandleError_clone(&e_conv);
18541 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18542 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
18543 return tag_ptr(ret_conv, true);
18546 jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
18547 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
18548 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
18552 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
18553 if (!ptr_is_owned(_res)) return;
18554 void* _res_ptr = untag_ptr(_res);
18555 CHECK_ACCESS(_res_ptr);
18556 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
18557 FREE(untag_ptr(_res));
18558 CResult_NonePeerHandleErrorZ_free(_res_conv);
18561 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
18562 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18563 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
18564 return tag_ptr(ret_conv, true);
18566 int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
18567 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
18568 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
18572 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
18573 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
18574 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18575 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
18576 return tag_ptr(ret_conv, true);
18579 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
18580 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18581 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
18582 return tag_ptr(ret_conv, true);
18585 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
18586 LDKPeerHandleError e_conv;
18587 e_conv.inner = untag_ptr(e);
18588 e_conv.is_owned = ptr_is_owned(e);
18589 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18590 e_conv = PeerHandleError_clone(&e_conv);
18591 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18592 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
18593 return tag_ptr(ret_conv, true);
18596 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
18597 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
18598 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
18602 void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
18603 if (!ptr_is_owned(_res)) return;
18604 void* _res_ptr = untag_ptr(_res);
18605 CHECK_ACCESS(_res_ptr);
18606 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
18607 FREE(untag_ptr(_res));
18608 CResult_boolPeerHandleErrorZ_free(_res_conv);
18611 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
18612 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18613 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
18614 return tag_ptr(ret_conv, true);
18616 int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
18617 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
18618 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
18622 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
18623 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
18624 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18625 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
18626 return tag_ptr(ret_conv, true);
18629 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_ok"))) TS_CResult_NoneSendErrorZ_ok() {
18630 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
18631 *ret_conv = CResult_NoneSendErrorZ_ok();
18632 return tag_ptr(ret_conv, true);
18635 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_err"))) TS_CResult_NoneSendErrorZ_err(uint64_t e) {
18636 void* e_ptr = untag_ptr(e);
18637 CHECK_ACCESS(e_ptr);
18638 LDKSendError e_conv = *(LDKSendError*)(e_ptr);
18639 e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
18640 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
18641 *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
18642 return tag_ptr(ret_conv, true);
18645 jboolean __attribute__((export_name("TS_CResult_NoneSendErrorZ_is_ok"))) TS_CResult_NoneSendErrorZ_is_ok(uint64_t o) {
18646 LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
18647 jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
18651 void __attribute__((export_name("TS_CResult_NoneSendErrorZ_free"))) TS_CResult_NoneSendErrorZ_free(uint64_t _res) {
18652 if (!ptr_is_owned(_res)) return;
18653 void* _res_ptr = untag_ptr(_res);
18654 CHECK_ACCESS(_res_ptr);
18655 LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
18656 FREE(untag_ptr(_res));
18657 CResult_NoneSendErrorZ_free(_res_conv);
18660 uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_ok"))) TS_CResult_u32GraphSyncErrorZ_ok(int32_t o) {
18661 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
18662 *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
18663 return tag_ptr(ret_conv, true);
18666 uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_err"))) TS_CResult_u32GraphSyncErrorZ_err(uint64_t e) {
18667 void* e_ptr = untag_ptr(e);
18668 CHECK_ACCESS(e_ptr);
18669 LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
18670 e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
18671 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
18672 *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
18673 return tag_ptr(ret_conv, true);
18676 jboolean __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_is_ok"))) TS_CResult_u32GraphSyncErrorZ_is_ok(uint64_t o) {
18677 LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
18678 jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
18682 void __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_free"))) TS_CResult_u32GraphSyncErrorZ_free(uint64_t _res) {
18683 if (!ptr_is_owned(_res)) return;
18684 void* _res_ptr = untag_ptr(_res);
18685 CHECK_ACCESS(_res_ptr);
18686 LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
18687 FREE(untag_ptr(_res));
18688 CResult_u32GraphSyncErrorZ_free(_res_conv);
18691 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() {
18692 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18693 *ret_conv = CResult_NoneErrorZ_ok();
18694 return tag_ptr(ret_conv, true);
18697 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) {
18698 LDKIOError e_conv = LDKIOError_from_js(e);
18699 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18700 *ret_conv = CResult_NoneErrorZ_err(e_conv);
18701 return tag_ptr(ret_conv, true);
18704 jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) {
18705 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
18706 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
18710 void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) {
18711 if (!ptr_is_owned(_res)) return;
18712 void* _res_ptr = untag_ptr(_res);
18713 CHECK_ACCESS(_res_ptr);
18714 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
18715 FREE(untag_ptr(_res));
18716 CResult_NoneErrorZ_free(_res_conv);
18719 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
18720 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18721 *ret_conv = CResult_NoneErrorZ_clone(arg);
18722 return tag_ptr(ret_conv, true);
18724 int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) {
18725 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
18726 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
18730 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) {
18731 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
18732 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18733 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
18734 return tag_ptr(ret_conv, true);
18737 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint64_t o) {
18738 void* o_ptr = untag_ptr(o);
18739 CHECK_ACCESS(o_ptr);
18740 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
18741 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
18742 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18743 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
18744 return tag_ptr(ret_conv, true);
18747 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
18748 void* e_ptr = untag_ptr(e);
18749 CHECK_ACCESS(e_ptr);
18750 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18751 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18752 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18753 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
18754 return tag_ptr(ret_conv, true);
18757 jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) {
18758 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
18759 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
18763 void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) {
18764 if (!ptr_is_owned(_res)) return;
18765 void* _res_ptr = untag_ptr(_res);
18766 CHECK_ACCESS(_res_ptr);
18767 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
18768 FREE(untag_ptr(_res));
18769 CResult_NetAddressDecodeErrorZ_free(_res_conv);
18772 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
18773 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18774 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
18775 return tag_ptr(ret_conv, true);
18777 int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) {
18778 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
18779 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
18783 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) {
18784 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
18785 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18786 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
18787 return tag_ptr(ret_conv, true);
18790 void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) {
18791 LDKCVec_UpdateAddHTLCZ _res_constr;
18792 _res_constr.datalen = _res->arr_len;
18793 if (_res_constr.datalen > 0)
18794 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
18796 _res_constr.data = NULL;
18797 uint64_t* _res_vals = _res->elems;
18798 for (size_t p = 0; p < _res_constr.datalen; p++) {
18799 uint64_t _res_conv_15 = _res_vals[p];
18800 LDKUpdateAddHTLC _res_conv_15_conv;
18801 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
18802 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
18803 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
18804 _res_constr.data[p] = _res_conv_15_conv;
18807 CVec_UpdateAddHTLCZ_free(_res_constr);
18810 void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) {
18811 LDKCVec_UpdateFulfillHTLCZ _res_constr;
18812 _res_constr.datalen = _res->arr_len;
18813 if (_res_constr.datalen > 0)
18814 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
18816 _res_constr.data = NULL;
18817 uint64_t* _res_vals = _res->elems;
18818 for (size_t t = 0; t < _res_constr.datalen; t++) {
18819 uint64_t _res_conv_19 = _res_vals[t];
18820 LDKUpdateFulfillHTLC _res_conv_19_conv;
18821 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
18822 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
18823 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
18824 _res_constr.data[t] = _res_conv_19_conv;
18827 CVec_UpdateFulfillHTLCZ_free(_res_constr);
18830 void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) {
18831 LDKCVec_UpdateFailHTLCZ _res_constr;
18832 _res_constr.datalen = _res->arr_len;
18833 if (_res_constr.datalen > 0)
18834 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
18836 _res_constr.data = NULL;
18837 uint64_t* _res_vals = _res->elems;
18838 for (size_t q = 0; q < _res_constr.datalen; q++) {
18839 uint64_t _res_conv_16 = _res_vals[q];
18840 LDKUpdateFailHTLC _res_conv_16_conv;
18841 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
18842 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
18843 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
18844 _res_constr.data[q] = _res_conv_16_conv;
18847 CVec_UpdateFailHTLCZ_free(_res_constr);
18850 void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) {
18851 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
18852 _res_constr.datalen = _res->arr_len;
18853 if (_res_constr.datalen > 0)
18854 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
18856 _res_constr.data = NULL;
18857 uint64_t* _res_vals = _res->elems;
18858 for (size_t z = 0; z < _res_constr.datalen; z++) {
18859 uint64_t _res_conv_25 = _res_vals[z];
18860 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
18861 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
18862 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
18863 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
18864 _res_constr.data[z] = _res_conv_25_conv;
18867 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
18870 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) {
18871 LDKAcceptChannel o_conv;
18872 o_conv.inner = untag_ptr(o);
18873 o_conv.is_owned = ptr_is_owned(o);
18874 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18875 o_conv = AcceptChannel_clone(&o_conv);
18876 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18877 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
18878 return tag_ptr(ret_conv, true);
18881 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
18882 void* e_ptr = untag_ptr(e);
18883 CHECK_ACCESS(e_ptr);
18884 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18885 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18886 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18887 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
18888 return tag_ptr(ret_conv, true);
18891 jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) {
18892 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
18893 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
18897 void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) {
18898 if (!ptr_is_owned(_res)) return;
18899 void* _res_ptr = untag_ptr(_res);
18900 CHECK_ACCESS(_res_ptr);
18901 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
18902 FREE(untag_ptr(_res));
18903 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
18906 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
18907 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18908 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
18909 return tag_ptr(ret_conv, true);
18911 int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
18912 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
18913 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
18917 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) {
18918 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
18919 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18920 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
18921 return tag_ptr(ret_conv, true);
18924 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) {
18925 LDKAnnouncementSignatures o_conv;
18926 o_conv.inner = untag_ptr(o);
18927 o_conv.is_owned = ptr_is_owned(o);
18928 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18929 o_conv = AnnouncementSignatures_clone(&o_conv);
18930 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18931 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
18932 return tag_ptr(ret_conv, true);
18935 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
18936 void* e_ptr = untag_ptr(e);
18937 CHECK_ACCESS(e_ptr);
18938 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18939 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18940 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18941 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
18942 return tag_ptr(ret_conv, true);
18945 jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) {
18946 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
18947 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
18951 void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) {
18952 if (!ptr_is_owned(_res)) return;
18953 void* _res_ptr = untag_ptr(_res);
18954 CHECK_ACCESS(_res_ptr);
18955 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
18956 FREE(untag_ptr(_res));
18957 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
18960 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
18961 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18962 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
18963 return tag_ptr(ret_conv, true);
18965 int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
18966 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
18967 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
18971 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) {
18972 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
18973 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18974 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
18975 return tag_ptr(ret_conv, true);
18978 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) {
18979 LDKChannelReestablish o_conv;
18980 o_conv.inner = untag_ptr(o);
18981 o_conv.is_owned = ptr_is_owned(o);
18982 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18983 o_conv = ChannelReestablish_clone(&o_conv);
18984 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18985 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
18986 return tag_ptr(ret_conv, true);
18989 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
18990 void* e_ptr = untag_ptr(e);
18991 CHECK_ACCESS(e_ptr);
18992 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18993 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18994 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18995 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
18996 return tag_ptr(ret_conv, true);
18999 jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) {
19000 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
19001 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
19005 void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) {
19006 if (!ptr_is_owned(_res)) return;
19007 void* _res_ptr = untag_ptr(_res);
19008 CHECK_ACCESS(_res_ptr);
19009 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
19010 FREE(untag_ptr(_res));
19011 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
19014 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
19015 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
19016 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
19017 return tag_ptr(ret_conv, true);
19019 int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) {
19020 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
19021 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
19025 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) {
19026 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
19027 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
19028 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
19029 return tag_ptr(ret_conv, true);
19032 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) {
19033 LDKClosingSigned o_conv;
19034 o_conv.inner = untag_ptr(o);
19035 o_conv.is_owned = ptr_is_owned(o);
19036 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19037 o_conv = ClosingSigned_clone(&o_conv);
19038 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
19039 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
19040 return tag_ptr(ret_conv, true);
19043 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
19044 void* e_ptr = untag_ptr(e);
19045 CHECK_ACCESS(e_ptr);
19046 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19047 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19048 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
19049 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
19050 return tag_ptr(ret_conv, true);
19053 jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) {
19054 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
19055 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
19059 void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) {
19060 if (!ptr_is_owned(_res)) return;
19061 void* _res_ptr = untag_ptr(_res);
19062 CHECK_ACCESS(_res_ptr);
19063 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
19064 FREE(untag_ptr(_res));
19065 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
19068 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
19069 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
19070 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
19071 return tag_ptr(ret_conv, true);
19073 int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
19074 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
19075 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
19079 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) {
19080 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
19081 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
19082 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
19083 return tag_ptr(ret_conv, true);
19086 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) {
19087 LDKClosingSignedFeeRange o_conv;
19088 o_conv.inner = untag_ptr(o);
19089 o_conv.is_owned = ptr_is_owned(o);
19090 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19091 o_conv = ClosingSignedFeeRange_clone(&o_conv);
19092 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
19093 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
19094 return tag_ptr(ret_conv, true);
19097 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
19098 void* e_ptr = untag_ptr(e);
19099 CHECK_ACCESS(e_ptr);
19100 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19101 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19102 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
19103 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
19104 return tag_ptr(ret_conv, true);
19107 jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) {
19108 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
19109 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
19113 void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) {
19114 if (!ptr_is_owned(_res)) return;
19115 void* _res_ptr = untag_ptr(_res);
19116 CHECK_ACCESS(_res_ptr);
19117 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
19118 FREE(untag_ptr(_res));
19119 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
19122 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
19123 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
19124 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
19125 return tag_ptr(ret_conv, true);
19127 int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19128 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
19129 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
19133 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) {
19134 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
19135 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
19136 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
19137 return tag_ptr(ret_conv, true);
19140 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) {
19141 LDKCommitmentSigned o_conv;
19142 o_conv.inner = untag_ptr(o);
19143 o_conv.is_owned = ptr_is_owned(o);
19144 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19145 o_conv = CommitmentSigned_clone(&o_conv);
19146 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
19147 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
19148 return tag_ptr(ret_conv, true);
19151 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
19152 void* e_ptr = untag_ptr(e);
19153 CHECK_ACCESS(e_ptr);
19154 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19155 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19156 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
19157 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
19158 return tag_ptr(ret_conv, true);
19161 jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) {
19162 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
19163 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
19167 void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) {
19168 if (!ptr_is_owned(_res)) return;
19169 void* _res_ptr = untag_ptr(_res);
19170 CHECK_ACCESS(_res_ptr);
19171 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
19172 FREE(untag_ptr(_res));
19173 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
19176 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
19177 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
19178 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
19179 return tag_ptr(ret_conv, true);
19181 int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
19182 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
19183 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
19187 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) {
19188 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
19189 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
19190 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
19191 return tag_ptr(ret_conv, true);
19194 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) {
19195 LDKFundingCreated o_conv;
19196 o_conv.inner = untag_ptr(o);
19197 o_conv.is_owned = ptr_is_owned(o);
19198 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19199 o_conv = FundingCreated_clone(&o_conv);
19200 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19201 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
19202 return tag_ptr(ret_conv, true);
19205 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
19206 void* e_ptr = untag_ptr(e);
19207 CHECK_ACCESS(e_ptr);
19208 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19209 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19210 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19211 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
19212 return tag_ptr(ret_conv, true);
19215 jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) {
19216 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
19217 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
19221 void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) {
19222 if (!ptr_is_owned(_res)) return;
19223 void* _res_ptr = untag_ptr(_res);
19224 CHECK_ACCESS(_res_ptr);
19225 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
19226 FREE(untag_ptr(_res));
19227 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
19230 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
19231 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19232 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
19233 return tag_ptr(ret_conv, true);
19235 int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) {
19236 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
19237 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
19241 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) {
19242 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
19243 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19244 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
19245 return tag_ptr(ret_conv, true);
19248 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) {
19249 LDKFundingSigned o_conv;
19250 o_conv.inner = untag_ptr(o);
19251 o_conv.is_owned = ptr_is_owned(o);
19252 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19253 o_conv = FundingSigned_clone(&o_conv);
19254 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19255 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
19256 return tag_ptr(ret_conv, true);
19259 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
19260 void* e_ptr = untag_ptr(e);
19261 CHECK_ACCESS(e_ptr);
19262 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19263 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19264 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19265 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
19266 return tag_ptr(ret_conv, true);
19269 jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) {
19270 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
19271 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
19275 void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) {
19276 if (!ptr_is_owned(_res)) return;
19277 void* _res_ptr = untag_ptr(_res);
19278 CHECK_ACCESS(_res_ptr);
19279 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
19280 FREE(untag_ptr(_res));
19281 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
19284 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
19285 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19286 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
19287 return tag_ptr(ret_conv, true);
19289 int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
19290 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
19291 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
19295 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) {
19296 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
19297 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19298 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
19299 return tag_ptr(ret_conv, true);
19302 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) {
19303 LDKChannelReady o_conv;
19304 o_conv.inner = untag_ptr(o);
19305 o_conv.is_owned = ptr_is_owned(o);
19306 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19307 o_conv = ChannelReady_clone(&o_conv);
19308 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19309 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
19310 return tag_ptr(ret_conv, true);
19313 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
19314 void* e_ptr = untag_ptr(e);
19315 CHECK_ACCESS(e_ptr);
19316 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19317 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19318 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19319 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
19320 return tag_ptr(ret_conv, true);
19323 jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) {
19324 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
19325 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
19329 void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) {
19330 if (!ptr_is_owned(_res)) return;
19331 void* _res_ptr = untag_ptr(_res);
19332 CHECK_ACCESS(_res_ptr);
19333 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
19334 FREE(untag_ptr(_res));
19335 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
19338 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
19339 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19340 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
19341 return tag_ptr(ret_conv, true);
19343 int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) {
19344 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
19345 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
19349 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) {
19350 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
19351 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19352 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
19353 return tag_ptr(ret_conv, true);
19356 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) {
19358 o_conv.inner = untag_ptr(o);
19359 o_conv.is_owned = ptr_is_owned(o);
19360 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19361 o_conv = Init_clone(&o_conv);
19362 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19363 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
19364 return tag_ptr(ret_conv, true);
19367 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
19368 void* e_ptr = untag_ptr(e);
19369 CHECK_ACCESS(e_ptr);
19370 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19371 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19372 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19373 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
19374 return tag_ptr(ret_conv, true);
19377 jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) {
19378 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
19379 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
19383 void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) {
19384 if (!ptr_is_owned(_res)) return;
19385 void* _res_ptr = untag_ptr(_res);
19386 CHECK_ACCESS(_res_ptr);
19387 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
19388 FREE(untag_ptr(_res));
19389 CResult_InitDecodeErrorZ_free(_res_conv);
19392 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
19393 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19394 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
19395 return tag_ptr(ret_conv, true);
19397 int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) {
19398 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
19399 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
19403 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) {
19404 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
19405 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19406 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
19407 return tag_ptr(ret_conv, true);
19410 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) {
19411 LDKOpenChannel o_conv;
19412 o_conv.inner = untag_ptr(o);
19413 o_conv.is_owned = ptr_is_owned(o);
19414 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19415 o_conv = OpenChannel_clone(&o_conv);
19416 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19417 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
19418 return tag_ptr(ret_conv, true);
19421 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
19422 void* e_ptr = untag_ptr(e);
19423 CHECK_ACCESS(e_ptr);
19424 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19425 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19426 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19427 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
19428 return tag_ptr(ret_conv, true);
19431 jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) {
19432 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
19433 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
19437 void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) {
19438 if (!ptr_is_owned(_res)) return;
19439 void* _res_ptr = untag_ptr(_res);
19440 CHECK_ACCESS(_res_ptr);
19441 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
19442 FREE(untag_ptr(_res));
19443 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
19446 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
19447 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19448 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
19449 return tag_ptr(ret_conv, true);
19451 int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
19452 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
19453 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
19457 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) {
19458 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
19459 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19460 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
19461 return tag_ptr(ret_conv, true);
19464 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) {
19465 LDKRevokeAndACK o_conv;
19466 o_conv.inner = untag_ptr(o);
19467 o_conv.is_owned = ptr_is_owned(o);
19468 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19469 o_conv = RevokeAndACK_clone(&o_conv);
19470 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19471 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
19472 return tag_ptr(ret_conv, true);
19475 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
19476 void* e_ptr = untag_ptr(e);
19477 CHECK_ACCESS(e_ptr);
19478 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19479 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19480 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19481 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
19482 return tag_ptr(ret_conv, true);
19485 jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) {
19486 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
19487 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
19491 void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) {
19492 if (!ptr_is_owned(_res)) return;
19493 void* _res_ptr = untag_ptr(_res);
19494 CHECK_ACCESS(_res_ptr);
19495 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
19496 FREE(untag_ptr(_res));
19497 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
19500 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
19501 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19502 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
19503 return tag_ptr(ret_conv, true);
19505 int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) {
19506 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
19507 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
19511 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) {
19512 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
19513 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19514 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
19515 return tag_ptr(ret_conv, true);
19518 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) {
19519 LDKShutdown o_conv;
19520 o_conv.inner = untag_ptr(o);
19521 o_conv.is_owned = ptr_is_owned(o);
19522 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19523 o_conv = Shutdown_clone(&o_conv);
19524 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19525 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
19526 return tag_ptr(ret_conv, true);
19529 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
19530 void* e_ptr = untag_ptr(e);
19531 CHECK_ACCESS(e_ptr);
19532 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19533 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19534 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19535 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
19536 return tag_ptr(ret_conv, true);
19539 jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) {
19540 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
19541 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
19545 void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) {
19546 if (!ptr_is_owned(_res)) return;
19547 void* _res_ptr = untag_ptr(_res);
19548 CHECK_ACCESS(_res_ptr);
19549 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
19550 FREE(untag_ptr(_res));
19551 CResult_ShutdownDecodeErrorZ_free(_res_conv);
19554 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
19555 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19556 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
19557 return tag_ptr(ret_conv, true);
19559 int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) {
19560 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
19561 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
19565 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) {
19566 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
19567 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19568 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
19569 return tag_ptr(ret_conv, true);
19572 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) {
19573 LDKUpdateFailHTLC o_conv;
19574 o_conv.inner = untag_ptr(o);
19575 o_conv.is_owned = ptr_is_owned(o);
19576 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19577 o_conv = UpdateFailHTLC_clone(&o_conv);
19578 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19579 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
19580 return tag_ptr(ret_conv, true);
19583 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
19584 void* e_ptr = untag_ptr(e);
19585 CHECK_ACCESS(e_ptr);
19586 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19587 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19588 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19589 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
19590 return tag_ptr(ret_conv, true);
19593 jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint64_t o) {
19594 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
19595 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
19599 void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint64_t _res) {
19600 if (!ptr_is_owned(_res)) return;
19601 void* _res_ptr = untag_ptr(_res);
19602 CHECK_ACCESS(_res_ptr);
19603 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
19604 FREE(untag_ptr(_res));
19605 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
19608 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
19609 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19610 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
19611 return tag_ptr(ret_conv, true);
19613 int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19614 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
19615 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
19619 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint64_t orig) {
19620 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
19621 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19622 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
19623 return tag_ptr(ret_conv, true);
19626 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint64_t o) {
19627 LDKUpdateFailMalformedHTLC o_conv;
19628 o_conv.inner = untag_ptr(o);
19629 o_conv.is_owned = ptr_is_owned(o);
19630 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19631 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
19632 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19633 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
19634 return tag_ptr(ret_conv, true);
19637 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
19638 void* e_ptr = untag_ptr(e);
19639 CHECK_ACCESS(e_ptr);
19640 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19641 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19642 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19643 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
19644 return tag_ptr(ret_conv, true);
19647 jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint64_t o) {
19648 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
19649 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
19653 void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint64_t _res) {
19654 if (!ptr_is_owned(_res)) return;
19655 void* _res_ptr = untag_ptr(_res);
19656 CHECK_ACCESS(_res_ptr);
19657 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
19658 FREE(untag_ptr(_res));
19659 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
19662 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
19663 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19664 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
19665 return tag_ptr(ret_conv, true);
19667 int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19668 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
19669 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
19673 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint64_t orig) {
19674 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
19675 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19676 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
19677 return tag_ptr(ret_conv, true);
19680 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint64_t o) {
19681 LDKUpdateFee o_conv;
19682 o_conv.inner = untag_ptr(o);
19683 o_conv.is_owned = ptr_is_owned(o);
19684 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19685 o_conv = UpdateFee_clone(&o_conv);
19686 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19687 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
19688 return tag_ptr(ret_conv, true);
19691 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
19692 void* e_ptr = untag_ptr(e);
19693 CHECK_ACCESS(e_ptr);
19694 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19695 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19696 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19697 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
19698 return tag_ptr(ret_conv, true);
19701 jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint64_t o) {
19702 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
19703 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
19707 void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint64_t _res) {
19708 if (!ptr_is_owned(_res)) return;
19709 void* _res_ptr = untag_ptr(_res);
19710 CHECK_ACCESS(_res_ptr);
19711 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
19712 FREE(untag_ptr(_res));
19713 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
19716 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
19717 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19718 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
19719 return tag_ptr(ret_conv, true);
19721 int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint64_t arg) {
19722 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
19723 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
19727 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint64_t orig) {
19728 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
19729 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19730 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
19731 return tag_ptr(ret_conv, true);
19734 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint64_t o) {
19735 LDKUpdateFulfillHTLC o_conv;
19736 o_conv.inner = untag_ptr(o);
19737 o_conv.is_owned = ptr_is_owned(o);
19738 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19739 o_conv = UpdateFulfillHTLC_clone(&o_conv);
19740 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19741 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
19742 return tag_ptr(ret_conv, true);
19745 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
19746 void* e_ptr = untag_ptr(e);
19747 CHECK_ACCESS(e_ptr);
19748 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19749 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19750 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19751 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
19752 return tag_ptr(ret_conv, true);
19755 jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint64_t o) {
19756 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
19757 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
19761 void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint64_t _res) {
19762 if (!ptr_is_owned(_res)) return;
19763 void* _res_ptr = untag_ptr(_res);
19764 CHECK_ACCESS(_res_ptr);
19765 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
19766 FREE(untag_ptr(_res));
19767 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
19770 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
19771 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19772 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
19773 return tag_ptr(ret_conv, true);
19775 int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19776 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
19777 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
19781 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint64_t orig) {
19782 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
19783 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19784 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
19785 return tag_ptr(ret_conv, true);
19788 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint64_t o) {
19789 LDKUpdateAddHTLC o_conv;
19790 o_conv.inner = untag_ptr(o);
19791 o_conv.is_owned = ptr_is_owned(o);
19792 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19793 o_conv = UpdateAddHTLC_clone(&o_conv);
19794 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19795 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
19796 return tag_ptr(ret_conv, true);
19799 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
19800 void* e_ptr = untag_ptr(e);
19801 CHECK_ACCESS(e_ptr);
19802 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19803 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19804 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19805 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
19806 return tag_ptr(ret_conv, true);
19809 jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint64_t o) {
19810 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
19811 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
19815 void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint64_t _res) {
19816 if (!ptr_is_owned(_res)) return;
19817 void* _res_ptr = untag_ptr(_res);
19818 CHECK_ACCESS(_res_ptr);
19819 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
19820 FREE(untag_ptr(_res));
19821 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
19824 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
19825 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19826 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
19827 return tag_ptr(ret_conv, true);
19829 int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19830 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
19831 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
19835 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint64_t orig) {
19836 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
19837 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19838 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
19839 return tag_ptr(ret_conv, true);
19842 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_ok"))) TS_CResult_OnionMessageDecodeErrorZ_ok(uint64_t o) {
19843 LDKOnionMessage o_conv;
19844 o_conv.inner = untag_ptr(o);
19845 o_conv.is_owned = ptr_is_owned(o);
19846 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19847 o_conv = OnionMessage_clone(&o_conv);
19848 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19849 *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
19850 return tag_ptr(ret_conv, true);
19853 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_err"))) TS_CResult_OnionMessageDecodeErrorZ_err(uint64_t e) {
19854 void* e_ptr = untag_ptr(e);
19855 CHECK_ACCESS(e_ptr);
19856 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19857 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19858 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19859 *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
19860 return tag_ptr(ret_conv, true);
19863 jboolean __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_is_ok"))) TS_CResult_OnionMessageDecodeErrorZ_is_ok(uint64_t o) {
19864 LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
19865 jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
19869 void __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_free"))) TS_CResult_OnionMessageDecodeErrorZ_free(uint64_t _res) {
19870 if (!ptr_is_owned(_res)) return;
19871 void* _res_ptr = untag_ptr(_res);
19872 CHECK_ACCESS(_res_ptr);
19873 LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
19874 FREE(untag_ptr(_res));
19875 CResult_OnionMessageDecodeErrorZ_free(_res_conv);
19878 static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
19879 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19880 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
19881 return tag_ptr(ret_conv, true);
19883 int64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone_ptr"))) TS_CResult_OnionMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
19884 LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
19885 int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
19889 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone"))) TS_CResult_OnionMessageDecodeErrorZ_clone(uint64_t orig) {
19890 LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
19891 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19892 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
19893 return tag_ptr(ret_conv, true);
19896 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
19898 o_conv.inner = untag_ptr(o);
19899 o_conv.is_owned = ptr_is_owned(o);
19900 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19901 o_conv = Ping_clone(&o_conv);
19902 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19903 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
19904 return tag_ptr(ret_conv, true);
19907 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
19908 void* e_ptr = untag_ptr(e);
19909 CHECK_ACCESS(e_ptr);
19910 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19911 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19912 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19913 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
19914 return tag_ptr(ret_conv, true);
19917 jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint64_t o) {
19918 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
19919 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
19923 void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint64_t _res) {
19924 if (!ptr_is_owned(_res)) return;
19925 void* _res_ptr = untag_ptr(_res);
19926 CHECK_ACCESS(_res_ptr);
19927 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
19928 FREE(untag_ptr(_res));
19929 CResult_PingDecodeErrorZ_free(_res_conv);
19932 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
19933 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19934 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
19935 return tag_ptr(ret_conv, true);
19937 int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint64_t arg) {
19938 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
19939 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
19943 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_CResult_PingDecodeErrorZ_clone(uint64_t orig) {
19944 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
19945 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19946 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
19947 return tag_ptr(ret_conv, true);
19950 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint64_t o) {
19952 o_conv.inner = untag_ptr(o);
19953 o_conv.is_owned = ptr_is_owned(o);
19954 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19955 o_conv = Pong_clone(&o_conv);
19956 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19957 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
19958 return tag_ptr(ret_conv, true);
19961 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
19962 void* e_ptr = untag_ptr(e);
19963 CHECK_ACCESS(e_ptr);
19964 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19965 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19966 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19967 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
19968 return tag_ptr(ret_conv, true);
19971 jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint64_t o) {
19972 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
19973 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
19977 void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint64_t _res) {
19978 if (!ptr_is_owned(_res)) return;
19979 void* _res_ptr = untag_ptr(_res);
19980 CHECK_ACCESS(_res_ptr);
19981 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
19982 FREE(untag_ptr(_res));
19983 CResult_PongDecodeErrorZ_free(_res_conv);
19986 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
19987 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19988 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
19989 return tag_ptr(ret_conv, true);
19991 int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint64_t arg) {
19992 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
19993 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
19997 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_CResult_PongDecodeErrorZ_clone(uint64_t orig) {
19998 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
19999 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
20000 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
20001 return tag_ptr(ret_conv, true);
20004 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
20005 LDKUnsignedChannelAnnouncement o_conv;
20006 o_conv.inner = untag_ptr(o);
20007 o_conv.is_owned = ptr_is_owned(o);
20008 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20009 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
20010 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
20011 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
20012 return tag_ptr(ret_conv, true);
20015 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
20016 void* e_ptr = untag_ptr(e);
20017 CHECK_ACCESS(e_ptr);
20018 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20019 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20020 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
20021 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
20022 return tag_ptr(ret_conv, true);
20025 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20026 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
20027 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
20031 void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
20032 if (!ptr_is_owned(_res)) return;
20033 void* _res_ptr = untag_ptr(_res);
20034 CHECK_ACCESS(_res_ptr);
20035 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
20036 FREE(untag_ptr(_res));
20037 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
20040 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20041 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
20042 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
20043 return tag_ptr(ret_conv, true);
20045 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20046 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
20047 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20051 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20052 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
20053 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
20054 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
20055 return tag_ptr(ret_conv, true);
20058 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
20059 LDKChannelAnnouncement o_conv;
20060 o_conv.inner = untag_ptr(o);
20061 o_conv.is_owned = ptr_is_owned(o);
20062 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20063 o_conv = ChannelAnnouncement_clone(&o_conv);
20064 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
20065 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
20066 return tag_ptr(ret_conv, true);
20069 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
20070 void* e_ptr = untag_ptr(e);
20071 CHECK_ACCESS(e_ptr);
20072 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20073 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20074 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
20075 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
20076 return tag_ptr(ret_conv, true);
20079 jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20080 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
20081 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
20085 void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
20086 if (!ptr_is_owned(_res)) return;
20087 void* _res_ptr = untag_ptr(_res);
20088 CHECK_ACCESS(_res_ptr);
20089 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
20090 FREE(untag_ptr(_res));
20091 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
20094 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20095 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
20096 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
20097 return tag_ptr(ret_conv, true);
20099 int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20100 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
20101 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20105 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20106 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
20107 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
20108 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
20109 return tag_ptr(ret_conv, true);
20112 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint64_t o) {
20113 LDKUnsignedChannelUpdate o_conv;
20114 o_conv.inner = untag_ptr(o);
20115 o_conv.is_owned = ptr_is_owned(o);
20116 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20117 o_conv = UnsignedChannelUpdate_clone(&o_conv);
20118 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
20119 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
20120 return tag_ptr(ret_conv, true);
20123 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
20124 void* e_ptr = untag_ptr(e);
20125 CHECK_ACCESS(e_ptr);
20126 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20127 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20128 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
20129 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
20130 return tag_ptr(ret_conv, true);
20133 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
20134 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
20135 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
20139 void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint64_t _res) {
20140 if (!ptr_is_owned(_res)) return;
20141 void* _res_ptr = untag_ptr(_res);
20142 CHECK_ACCESS(_res_ptr);
20143 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
20144 FREE(untag_ptr(_res));
20145 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
20148 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
20149 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
20150 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
20151 return tag_ptr(ret_conv, true);
20153 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
20154 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
20155 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
20159 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
20160 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
20161 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
20162 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
20163 return tag_ptr(ret_conv, true);
20166 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint64_t o) {
20167 LDKChannelUpdate o_conv;
20168 o_conv.inner = untag_ptr(o);
20169 o_conv.is_owned = ptr_is_owned(o);
20170 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20171 o_conv = ChannelUpdate_clone(&o_conv);
20172 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20173 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
20174 return tag_ptr(ret_conv, true);
20177 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
20178 void* e_ptr = untag_ptr(e);
20179 CHECK_ACCESS(e_ptr);
20180 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20181 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20182 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20183 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
20184 return tag_ptr(ret_conv, true);
20187 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
20188 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
20189 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
20193 void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint64_t _res) {
20194 if (!ptr_is_owned(_res)) return;
20195 void* _res_ptr = untag_ptr(_res);
20196 CHECK_ACCESS(_res_ptr);
20197 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
20198 FREE(untag_ptr(_res));
20199 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
20202 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
20203 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20204 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
20205 return tag_ptr(ret_conv, true);
20207 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
20208 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
20209 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
20213 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
20214 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
20215 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20216 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
20217 return tag_ptr(ret_conv, true);
20220 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint64_t o) {
20221 LDKErrorMessage o_conv;
20222 o_conv.inner = untag_ptr(o);
20223 o_conv.is_owned = ptr_is_owned(o);
20224 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20225 o_conv = ErrorMessage_clone(&o_conv);
20226 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20227 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
20228 return tag_ptr(ret_conv, true);
20231 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
20232 void* e_ptr = untag_ptr(e);
20233 CHECK_ACCESS(e_ptr);
20234 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20235 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20236 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20237 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
20238 return tag_ptr(ret_conv, true);
20241 jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint64_t o) {
20242 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
20243 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
20247 void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint64_t _res) {
20248 if (!ptr_is_owned(_res)) return;
20249 void* _res_ptr = untag_ptr(_res);
20250 CHECK_ACCESS(_res_ptr);
20251 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
20252 FREE(untag_ptr(_res));
20253 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
20256 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
20257 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20258 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
20259 return tag_ptr(ret_conv, true);
20261 int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
20262 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
20263 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
20267 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint64_t orig) {
20268 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
20269 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20270 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
20271 return tag_ptr(ret_conv, true);
20274 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok"))) TS_CResult_WarningMessageDecodeErrorZ_ok(uint64_t o) {
20275 LDKWarningMessage o_conv;
20276 o_conv.inner = untag_ptr(o);
20277 o_conv.is_owned = ptr_is_owned(o);
20278 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20279 o_conv = WarningMessage_clone(&o_conv);
20280 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20281 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
20282 return tag_ptr(ret_conv, true);
20285 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
20286 void* e_ptr = untag_ptr(e);
20287 CHECK_ACCESS(e_ptr);
20288 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20289 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20290 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20291 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
20292 return tag_ptr(ret_conv, true);
20295 jboolean __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_is_ok"))) TS_CResult_WarningMessageDecodeErrorZ_is_ok(uint64_t o) {
20296 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
20297 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
20301 void __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_free"))) TS_CResult_WarningMessageDecodeErrorZ_free(uint64_t _res) {
20302 if (!ptr_is_owned(_res)) return;
20303 void* _res_ptr = untag_ptr(_res);
20304 CHECK_ACCESS(_res_ptr);
20305 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
20306 FREE(untag_ptr(_res));
20307 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
20310 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
20311 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20312 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
20313 return tag_ptr(ret_conv, true);
20315 int64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone_ptr"))) TS_CResult_WarningMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
20316 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
20317 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
20321 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone"))) TS_CResult_WarningMessageDecodeErrorZ_clone(uint64_t orig) {
20322 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
20323 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20324 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
20325 return tag_ptr(ret_conv, true);
20328 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
20329 LDKUnsignedNodeAnnouncement o_conv;
20330 o_conv.inner = untag_ptr(o);
20331 o_conv.is_owned = ptr_is_owned(o);
20332 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20333 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
20334 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20335 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
20336 return tag_ptr(ret_conv, true);
20339 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
20340 void* e_ptr = untag_ptr(e);
20341 CHECK_ACCESS(e_ptr);
20342 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20343 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20344 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20345 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
20346 return tag_ptr(ret_conv, true);
20349 jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20350 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
20351 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
20355 void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
20356 if (!ptr_is_owned(_res)) return;
20357 void* _res_ptr = untag_ptr(_res);
20358 CHECK_ACCESS(_res_ptr);
20359 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
20360 FREE(untag_ptr(_res));
20361 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
20364 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20365 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20366 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
20367 return tag_ptr(ret_conv, true);
20369 int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20370 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
20371 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20375 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20376 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
20377 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20378 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
20379 return tag_ptr(ret_conv, true);
20382 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
20383 LDKNodeAnnouncement o_conv;
20384 o_conv.inner = untag_ptr(o);
20385 o_conv.is_owned = ptr_is_owned(o);
20386 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20387 o_conv = NodeAnnouncement_clone(&o_conv);
20388 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20389 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
20390 return tag_ptr(ret_conv, true);
20393 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
20394 void* e_ptr = untag_ptr(e);
20395 CHECK_ACCESS(e_ptr);
20396 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20397 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20398 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20399 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
20400 return tag_ptr(ret_conv, true);
20403 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20404 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
20405 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
20409 void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
20410 if (!ptr_is_owned(_res)) return;
20411 void* _res_ptr = untag_ptr(_res);
20412 CHECK_ACCESS(_res_ptr);
20413 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
20414 FREE(untag_ptr(_res));
20415 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
20418 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20419 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20420 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
20421 return tag_ptr(ret_conv, true);
20423 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20424 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
20425 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20429 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20430 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
20431 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20432 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
20433 return tag_ptr(ret_conv, true);
20436 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint64_t o) {
20437 LDKQueryShortChannelIds o_conv;
20438 o_conv.inner = untag_ptr(o);
20439 o_conv.is_owned = ptr_is_owned(o);
20440 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20441 o_conv = QueryShortChannelIds_clone(&o_conv);
20442 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20443 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
20444 return tag_ptr(ret_conv, true);
20447 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
20448 void* e_ptr = untag_ptr(e);
20449 CHECK_ACCESS(e_ptr);
20450 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20451 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20452 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20453 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
20454 return tag_ptr(ret_conv, true);
20457 jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint64_t o) {
20458 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
20459 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
20463 void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint64_t _res) {
20464 if (!ptr_is_owned(_res)) return;
20465 void* _res_ptr = untag_ptr(_res);
20466 CHECK_ACCESS(_res_ptr);
20467 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
20468 FREE(untag_ptr(_res));
20469 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
20472 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
20473 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20474 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
20475 return tag_ptr(ret_conv, true);
20477 int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint64_t arg) {
20478 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
20479 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
20483 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint64_t orig) {
20484 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
20485 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20486 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
20487 return tag_ptr(ret_conv, true);
20490 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint64_t o) {
20491 LDKReplyShortChannelIdsEnd o_conv;
20492 o_conv.inner = untag_ptr(o);
20493 o_conv.is_owned = ptr_is_owned(o);
20494 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20495 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
20496 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20497 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
20498 return tag_ptr(ret_conv, true);
20501 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
20502 void* e_ptr = untag_ptr(e);
20503 CHECK_ACCESS(e_ptr);
20504 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20505 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20506 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20507 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
20508 return tag_ptr(ret_conv, true);
20511 jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint64_t o) {
20512 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
20513 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
20517 void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint64_t _res) {
20518 if (!ptr_is_owned(_res)) return;
20519 void* _res_ptr = untag_ptr(_res);
20520 CHECK_ACCESS(_res_ptr);
20521 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
20522 FREE(untag_ptr(_res));
20523 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
20526 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
20527 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20528 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
20529 return tag_ptr(ret_conv, true);
20531 int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint64_t arg) {
20532 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
20533 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
20537 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint64_t orig) {
20538 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
20539 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20540 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
20541 return tag_ptr(ret_conv, true);
20544 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint64_t o) {
20545 LDKQueryChannelRange o_conv;
20546 o_conv.inner = untag_ptr(o);
20547 o_conv.is_owned = ptr_is_owned(o);
20548 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20549 o_conv = QueryChannelRange_clone(&o_conv);
20550 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20551 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
20552 return tag_ptr(ret_conv, true);
20555 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
20556 void* e_ptr = untag_ptr(e);
20557 CHECK_ACCESS(e_ptr);
20558 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20559 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20560 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20561 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
20562 return tag_ptr(ret_conv, true);
20565 jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
20566 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
20567 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
20571 void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint64_t _res) {
20572 if (!ptr_is_owned(_res)) return;
20573 void* _res_ptr = untag_ptr(_res);
20574 CHECK_ACCESS(_res_ptr);
20575 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
20576 FREE(untag_ptr(_res));
20577 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
20580 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
20581 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20582 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
20583 return tag_ptr(ret_conv, true);
20585 int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
20586 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
20587 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
20591 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint64_t orig) {
20592 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
20593 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20594 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
20595 return tag_ptr(ret_conv, true);
20598 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint64_t o) {
20599 LDKReplyChannelRange o_conv;
20600 o_conv.inner = untag_ptr(o);
20601 o_conv.is_owned = ptr_is_owned(o);
20602 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20603 o_conv = ReplyChannelRange_clone(&o_conv);
20604 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20605 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
20606 return tag_ptr(ret_conv, true);
20609 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
20610 void* e_ptr = untag_ptr(e);
20611 CHECK_ACCESS(e_ptr);
20612 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20613 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20614 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20615 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
20616 return tag_ptr(ret_conv, true);
20619 jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
20620 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
20621 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
20625 void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint64_t _res) {
20626 if (!ptr_is_owned(_res)) return;
20627 void* _res_ptr = untag_ptr(_res);
20628 CHECK_ACCESS(_res_ptr);
20629 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
20630 FREE(untag_ptr(_res));
20631 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
20634 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
20635 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20636 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
20637 return tag_ptr(ret_conv, true);
20639 int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
20640 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
20641 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
20645 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint64_t orig) {
20646 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
20647 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20648 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
20649 return tag_ptr(ret_conv, true);
20652 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint64_t o) {
20653 LDKGossipTimestampFilter o_conv;
20654 o_conv.inner = untag_ptr(o);
20655 o_conv.is_owned = ptr_is_owned(o);
20656 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20657 o_conv = GossipTimestampFilter_clone(&o_conv);
20658 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20659 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
20660 return tag_ptr(ret_conv, true);
20663 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
20664 void* e_ptr = untag_ptr(e);
20665 CHECK_ACCESS(e_ptr);
20666 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20667 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20668 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20669 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
20670 return tag_ptr(ret_conv, true);
20673 jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint64_t o) {
20674 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
20675 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
20679 void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint64_t _res) {
20680 if (!ptr_is_owned(_res)) return;
20681 void* _res_ptr = untag_ptr(_res);
20682 CHECK_ACCESS(_res_ptr);
20683 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
20684 FREE(untag_ptr(_res));
20685 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
20688 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
20689 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20690 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
20691 return tag_ptr(ret_conv, true);
20693 int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint64_t arg) {
20694 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
20695 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
20699 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint64_t orig) {
20700 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
20701 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20702 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
20703 return tag_ptr(ret_conv, true);
20706 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
20708 o_conv.inner = untag_ptr(o);
20709 o_conv.is_owned = ptr_is_owned(o);
20710 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20711 o_conv = Invoice_clone(&o_conv);
20712 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20713 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
20714 return tag_ptr(ret_conv, true);
20717 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) {
20718 void* e_ptr = untag_ptr(e);
20719 CHECK_ACCESS(e_ptr);
20720 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
20721 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
20722 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20723 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
20724 return tag_ptr(ret_conv, true);
20727 jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) {
20728 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
20729 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
20733 void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) {
20734 if (!ptr_is_owned(_res)) return;
20735 void* _res_ptr = untag_ptr(_res);
20736 CHECK_ACCESS(_res_ptr);
20737 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
20738 FREE(untag_ptr(_res));
20739 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
20742 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
20743 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20744 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
20745 return tag_ptr(ret_conv, true);
20747 int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) {
20748 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
20749 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
20753 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) {
20754 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
20755 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20756 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
20757 return tag_ptr(ret_conv, true);
20760 uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) {
20761 void* o_ptr = untag_ptr(o);
20762 CHECK_ACCESS(o_ptr);
20763 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
20764 if (o_conv.free == LDKFilter_JCalls_free) {
20765 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
20766 LDKFilter_JCalls_cloned(&o_conv);
20768 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
20769 *ret_copy = COption_FilterZ_some(o_conv);
20770 uint64_t ret_ref = tag_ptr(ret_copy, true);
20774 uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() {
20775 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
20776 *ret_copy = COption_FilterZ_none();
20777 uint64_t ret_ref = tag_ptr(ret_copy, true);
20781 void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) {
20782 if (!ptr_is_owned(_res)) return;
20783 void* _res_ptr = untag_ptr(_res);
20784 CHECK_ACCESS(_res_ptr);
20785 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
20786 FREE(untag_ptr(_res));
20787 COption_FilterZ_free(_res_conv);
20790 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) {
20791 LDKLockedChannelMonitor o_conv;
20792 o_conv.inner = untag_ptr(o);
20793 o_conv.is_owned = ptr_is_owned(o);
20794 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20795 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
20797 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
20798 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
20799 return tag_ptr(ret_conv, true);
20802 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() {
20803 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
20804 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
20805 return tag_ptr(ret_conv, true);
20808 jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) {
20809 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
20810 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
20814 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) {
20815 if (!ptr_is_owned(_res)) return;
20816 void* _res_ptr = untag_ptr(_res);
20817 CHECK_ACCESS(_res_ptr);
20818 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
20819 FREE(untag_ptr(_res));
20820 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
20823 void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) {
20824 LDKCVec_OutPointZ _res_constr;
20825 _res_constr.datalen = _res->arr_len;
20826 if (_res_constr.datalen > 0)
20827 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
20829 _res_constr.data = NULL;
20830 uint64_t* _res_vals = _res->elems;
20831 for (size_t k = 0; k < _res_constr.datalen; k++) {
20832 uint64_t _res_conv_10 = _res_vals[k];
20833 LDKOutPoint _res_conv_10_conv;
20834 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
20835 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
20836 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
20837 _res_constr.data[k] = _res_conv_10_conv;
20840 CVec_OutPointZ_free(_res_constr);
20843 void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
20844 if (!ptr_is_owned(this_ptr)) return;
20845 void* this_ptr_ptr = untag_ptr(this_ptr);
20846 CHECK_ACCESS(this_ptr_ptr);
20847 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
20848 FREE(untag_ptr(this_ptr));
20849 PaymentPurpose_free(this_ptr_conv);
20852 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
20853 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20854 *ret_copy = PaymentPurpose_clone(arg);
20855 uint64_t ret_ref = tag_ptr(ret_copy, true);
20858 int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) {
20859 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
20860 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
20864 uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) {
20865 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
20866 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20867 *ret_copy = PaymentPurpose_clone(orig_conv);
20868 uint64_t ret_ref = tag_ptr(ret_copy, true);
20872 uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
20873 LDKThirtyTwoBytes payment_preimage_ref;
20874 CHECK(payment_preimage->arr_len == 32);
20875 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
20876 LDKThirtyTwoBytes payment_secret_ref;
20877 CHECK(payment_secret->arr_len == 32);
20878 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
20879 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20880 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
20881 uint64_t ret_ref = tag_ptr(ret_copy, true);
20885 uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
20886 LDKThirtyTwoBytes a_ref;
20887 CHECK(a->arr_len == 32);
20888 memcpy(a_ref.data, a->elems, 32); FREE(a);
20889 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20890 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
20891 uint64_t ret_ref = tag_ptr(ret_copy, true);
20895 int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
20896 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
20897 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
20898 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20899 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20900 CVec_u8Z_free(ret_var);
20904 uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
20905 LDKu8slice ser_ref;
20906 ser_ref.datalen = ser->arr_len;
20907 ser_ref.data = ser->elems;
20908 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
20909 *ret_conv = PaymentPurpose_read(ser_ref);
20911 return tag_ptr(ret_conv, true);
20914 void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
20915 if (!ptr_is_owned(this_ptr)) return;
20916 void* this_ptr_ptr = untag_ptr(this_ptr);
20917 CHECK_ACCESS(this_ptr_ptr);
20918 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
20919 FREE(untag_ptr(this_ptr));
20920 ClosureReason_free(this_ptr_conv);
20923 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
20924 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20925 *ret_copy = ClosureReason_clone(arg);
20926 uint64_t ret_ref = tag_ptr(ret_copy, true);
20929 int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) {
20930 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
20931 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
20935 uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) {
20936 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
20937 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20938 *ret_copy = ClosureReason_clone(orig_conv);
20939 uint64_t ret_ref = tag_ptr(ret_copy, true);
20943 uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) {
20944 LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg);
20945 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20946 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
20947 uint64_t ret_ref = tag_ptr(ret_copy, true);
20951 uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() {
20952 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20953 *ret_copy = ClosureReason_holder_force_closed();
20954 uint64_t ret_ref = tag_ptr(ret_copy, true);
20958 uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() {
20959 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20960 *ret_copy = ClosureReason_cooperative_closure();
20961 uint64_t ret_ref = tag_ptr(ret_copy, true);
20965 uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() {
20966 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20967 *ret_copy = ClosureReason_commitment_tx_confirmed();
20968 uint64_t ret_ref = tag_ptr(ret_copy, true);
20972 uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() {
20973 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20974 *ret_copy = ClosureReason_funding_timed_out();
20975 uint64_t ret_ref = tag_ptr(ret_copy, true);
20979 uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) {
20980 LDKStr err_conv = str_ref_to_owned_c(err);
20981 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20982 *ret_copy = ClosureReason_processing_error(err_conv);
20983 uint64_t ret_ref = tag_ptr(ret_copy, true);
20987 uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() {
20988 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20989 *ret_copy = ClosureReason_disconnected_peer();
20990 uint64_t ret_ref = tag_ptr(ret_copy, true);
20994 uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() {
20995 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20996 *ret_copy = ClosureReason_outdated_channel_manager();
20997 uint64_t ret_ref = tag_ptr(ret_copy, true);
21001 jboolean __attribute__((export_name("TS_ClosureReason_eq"))) TS_ClosureReason_eq(uint64_t a, uint64_t b) {
21002 LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
21003 LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
21004 jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
21008 int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
21009 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
21010 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
21011 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21012 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21013 CVec_u8Z_free(ret_var);
21017 uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
21018 LDKu8slice ser_ref;
21019 ser_ref.datalen = ser->arr_len;
21020 ser_ref.data = ser->elems;
21021 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
21022 *ret_conv = ClosureReason_read(ser_ref);
21024 return tag_ptr(ret_conv, true);
21027 void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_free(uint64_t this_ptr) {
21028 if (!ptr_is_owned(this_ptr)) return;
21029 void* this_ptr_ptr = untag_ptr(this_ptr);
21030 CHECK_ACCESS(this_ptr_ptr);
21031 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
21032 FREE(untag_ptr(this_ptr));
21033 HTLCDestination_free(this_ptr_conv);
21036 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
21037 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
21038 *ret_copy = HTLCDestination_clone(arg);
21039 uint64_t ret_ref = tag_ptr(ret_copy, true);
21042 int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) {
21043 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
21044 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
21048 uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) {
21049 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
21050 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
21051 *ret_copy = HTLCDestination_clone(orig_conv);
21052 uint64_t ret_ref = tag_ptr(ret_copy, true);
21056 uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) {
21057 LDKPublicKey node_id_ref;
21058 CHECK(node_id->arr_len == 33);
21059 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21060 LDKThirtyTwoBytes channel_id_ref;
21061 CHECK(channel_id->arr_len == 32);
21062 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
21063 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
21064 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
21065 uint64_t ret_ref = tag_ptr(ret_copy, true);
21069 uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) {
21070 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
21071 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
21072 uint64_t ret_ref = tag_ptr(ret_copy, true);
21076 uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
21077 LDKThirtyTwoBytes payment_hash_ref;
21078 CHECK(payment_hash->arr_len == 32);
21079 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21080 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
21081 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
21082 uint64_t ret_ref = tag_ptr(ret_copy, true);
21086 jboolean __attribute__((export_name("TS_HTLCDestination_eq"))) TS_HTLCDestination_eq(uint64_t a, uint64_t b) {
21087 LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
21088 LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
21089 jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
21093 int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
21094 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
21095 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
21096 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21097 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21098 CVec_u8Z_free(ret_var);
21102 uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) {
21103 LDKu8slice ser_ref;
21104 ser_ref.datalen = ser->arr_len;
21105 ser_ref.data = ser->elems;
21106 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
21107 *ret_conv = HTLCDestination_read(ser_ref);
21109 return tag_ptr(ret_conv, true);
21112 void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint64_t this_ptr) {
21113 if (!ptr_is_owned(this_ptr)) return;
21114 void* this_ptr_ptr = untag_ptr(this_ptr);
21115 CHECK_ACCESS(this_ptr_ptr);
21116 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
21117 FREE(untag_ptr(this_ptr));
21118 Event_free(this_ptr_conv);
21121 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
21122 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21123 *ret_copy = Event_clone(arg);
21124 uint64_t ret_ref = tag_ptr(ret_copy, true);
21127 int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) {
21128 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
21129 int64_t ret_conv = Event_clone_ptr(arg_conv);
21133 uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) {
21134 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
21135 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21136 *ret_copy = Event_clone(orig_conv);
21137 uint64_t ret_ref = tag_ptr(ret_copy, true);
21141 uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
21142 LDKThirtyTwoBytes temporary_channel_id_ref;
21143 CHECK(temporary_channel_id->arr_len == 32);
21144 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
21145 LDKPublicKey counterparty_node_id_ref;
21146 CHECK(counterparty_node_id->arr_len == 33);
21147 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
21148 LDKCVec_u8Z output_script_ref;
21149 output_script_ref.datalen = output_script->arr_len;
21150 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
21151 memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
21152 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21153 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
21154 uint64_t ret_ref = tag_ptr(ret_copy, true);
21158 uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
21159 LDKThirtyTwoBytes payment_hash_ref;
21160 CHECK(payment_hash->arr_len == 32);
21161 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21162 void* purpose_ptr = untag_ptr(purpose);
21163 CHECK_ACCESS(purpose_ptr);
21164 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
21165 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
21166 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21167 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
21168 uint64_t ret_ref = tag_ptr(ret_copy, true);
21172 uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
21173 LDKThirtyTwoBytes payment_hash_ref;
21174 CHECK(payment_hash->arr_len == 32);
21175 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21176 void* purpose_ptr = untag_ptr(purpose);
21177 CHECK_ACCESS(purpose_ptr);
21178 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
21179 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
21180 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21181 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
21182 uint64_t ret_ref = tag_ptr(ret_copy, true);
21186 uint64_t __attribute__((export_name("TS_Event_payment_sent"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint64_t fee_paid_msat) {
21187 LDKThirtyTwoBytes payment_id_ref;
21188 CHECK(payment_id->arr_len == 32);
21189 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21190 LDKThirtyTwoBytes payment_preimage_ref;
21191 CHECK(payment_preimage->arr_len == 32);
21192 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
21193 LDKThirtyTwoBytes payment_hash_ref;
21194 CHECK(payment_hash->arr_len == 32);
21195 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21196 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
21197 CHECK_ACCESS(fee_paid_msat_ptr);
21198 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
21199 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
21200 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21201 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
21202 uint64_t ret_ref = tag_ptr(ret_copy, true);
21206 uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
21207 LDKThirtyTwoBytes payment_id_ref;
21208 CHECK(payment_id->arr_len == 32);
21209 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21210 LDKThirtyTwoBytes payment_hash_ref;
21211 CHECK(payment_hash->arr_len == 32);
21212 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21213 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21214 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
21215 uint64_t ret_ref = tag_ptr(ret_copy, true);
21219 uint64_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
21220 LDKThirtyTwoBytes payment_id_ref;
21221 CHECK(payment_id->arr_len == 32);
21222 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21223 LDKThirtyTwoBytes payment_hash_ref;
21224 CHECK(payment_hash->arr_len == 32);
21225 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21226 LDKCVec_RouteHopZ path_constr;
21227 path_constr.datalen = path->arr_len;
21228 if (path_constr.datalen > 0)
21229 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21231 path_constr.data = NULL;
21232 uint64_t* path_vals = path->elems;
21233 for (size_t k = 0; k < path_constr.datalen; k++) {
21234 uint64_t path_conv_10 = path_vals[k];
21235 LDKRouteHop path_conv_10_conv;
21236 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21237 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21238 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21239 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21240 path_constr.data[k] = path_conv_10_conv;
21243 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21244 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
21245 uint64_t ret_ref = tag_ptr(ret_copy, true);
21249 uint64_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, uint64_t network_update, jboolean all_paths_failed, uint64_tArray path, uint64_t short_channel_id, uint64_t retry) {
21250 LDKThirtyTwoBytes payment_id_ref;
21251 CHECK(payment_id->arr_len == 32);
21252 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21253 LDKThirtyTwoBytes payment_hash_ref;
21254 CHECK(payment_hash->arr_len == 32);
21255 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21256 void* network_update_ptr = untag_ptr(network_update);
21257 CHECK_ACCESS(network_update_ptr);
21258 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
21259 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
21260 LDKCVec_RouteHopZ path_constr;
21261 path_constr.datalen = path->arr_len;
21262 if (path_constr.datalen > 0)
21263 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21265 path_constr.data = NULL;
21266 uint64_t* path_vals = path->elems;
21267 for (size_t k = 0; k < path_constr.datalen; k++) {
21268 uint64_t path_conv_10 = path_vals[k];
21269 LDKRouteHop path_conv_10_conv;
21270 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21271 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21272 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21273 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21274 path_constr.data[k] = path_conv_10_conv;
21277 void* short_channel_id_ptr = untag_ptr(short_channel_id);
21278 CHECK_ACCESS(short_channel_id_ptr);
21279 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
21280 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
21281 LDKRouteParameters retry_conv;
21282 retry_conv.inner = untag_ptr(retry);
21283 retry_conv.is_owned = ptr_is_owned(retry);
21284 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
21285 retry_conv = RouteParameters_clone(&retry_conv);
21286 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21287 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
21288 uint64_t ret_ref = tag_ptr(ret_copy, true);
21292 uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
21293 LDKThirtyTwoBytes payment_id_ref;
21294 CHECK(payment_id->arr_len == 32);
21295 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21296 LDKThirtyTwoBytes payment_hash_ref;
21297 CHECK(payment_hash->arr_len == 32);
21298 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21299 LDKCVec_RouteHopZ path_constr;
21300 path_constr.datalen = path->arr_len;
21301 if (path_constr.datalen > 0)
21302 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21304 path_constr.data = NULL;
21305 uint64_t* path_vals = path->elems;
21306 for (size_t k = 0; k < path_constr.datalen; k++) {
21307 uint64_t path_conv_10 = path_vals[k];
21308 LDKRouteHop path_conv_10_conv;
21309 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21310 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21311 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21312 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21313 path_constr.data[k] = path_conv_10_conv;
21316 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21317 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
21318 uint64_t ret_ref = tag_ptr(ret_copy, true);
21322 uint64_t __attribute__((export_name("TS_Event_probe_failed"))) TS_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path, uint64_t short_channel_id) {
21323 LDKThirtyTwoBytes payment_id_ref;
21324 CHECK(payment_id->arr_len == 32);
21325 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21326 LDKThirtyTwoBytes payment_hash_ref;
21327 CHECK(payment_hash->arr_len == 32);
21328 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21329 LDKCVec_RouteHopZ path_constr;
21330 path_constr.datalen = path->arr_len;
21331 if (path_constr.datalen > 0)
21332 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21334 path_constr.data = NULL;
21335 uint64_t* path_vals = path->elems;
21336 for (size_t k = 0; k < path_constr.datalen; k++) {
21337 uint64_t path_conv_10 = path_vals[k];
21338 LDKRouteHop path_conv_10_conv;
21339 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21340 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21341 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21342 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21343 path_constr.data[k] = path_conv_10_conv;
21346 void* short_channel_id_ptr = untag_ptr(short_channel_id);
21347 CHECK_ACCESS(short_channel_id_ptr);
21348 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
21349 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
21350 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21351 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
21352 uint64_t ret_ref = tag_ptr(ret_copy, true);
21356 uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
21357 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21358 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
21359 uint64_t ret_ref = tag_ptr(ret_copy, true);
21363 uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
21364 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
21365 outputs_constr.datalen = outputs->arr_len;
21366 if (outputs_constr.datalen > 0)
21367 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
21369 outputs_constr.data = NULL;
21370 uint64_t* outputs_vals = outputs->elems;
21371 for (size_t b = 0; b < outputs_constr.datalen; b++) {
21372 uint64_t outputs_conv_27 = outputs_vals[b];
21373 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
21374 CHECK_ACCESS(outputs_conv_27_ptr);
21375 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
21376 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
21377 outputs_constr.data[b] = outputs_conv_27_conv;
21380 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21381 *ret_copy = Event_spendable_outputs(outputs_constr);
21382 uint64_t ret_ref = tag_ptr(ret_copy, true);
21386 uint64_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(int8_tArray prev_channel_id, int8_tArray next_channel_id, uint64_t fee_earned_msat, jboolean claim_from_onchain_tx) {
21387 LDKThirtyTwoBytes prev_channel_id_ref;
21388 CHECK(prev_channel_id->arr_len == 32);
21389 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
21390 LDKThirtyTwoBytes next_channel_id_ref;
21391 CHECK(next_channel_id->arr_len == 32);
21392 memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id);
21393 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
21394 CHECK_ACCESS(fee_earned_msat_ptr);
21395 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
21396 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
21397 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21398 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
21399 uint64_t ret_ref = tag_ptr(ret_copy, true);
21403 uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int64_t user_channel_id, uint64_t reason) {
21404 LDKThirtyTwoBytes channel_id_ref;
21405 CHECK(channel_id->arr_len == 32);
21406 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
21407 void* reason_ptr = untag_ptr(reason);
21408 CHECK_ACCESS(reason_ptr);
21409 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
21410 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
21411 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21412 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
21413 uint64_t ret_ref = tag_ptr(ret_copy, true);
21417 uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) {
21418 LDKThirtyTwoBytes channel_id_ref;
21419 CHECK(channel_id->arr_len == 32);
21420 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
21421 LDKTransaction transaction_ref;
21422 transaction_ref.datalen = transaction->arr_len;
21423 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
21424 memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction);
21425 transaction_ref.data_is_owned = true;
21426 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21427 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
21428 uint64_t ret_ref = tag_ptr(ret_copy, true);
21432 uint64_t __attribute__((export_name("TS_Event_open_channel_request"))) TS_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, uint64_t channel_type) {
21433 LDKThirtyTwoBytes temporary_channel_id_ref;
21434 CHECK(temporary_channel_id->arr_len == 32);
21435 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
21436 LDKPublicKey counterparty_node_id_ref;
21437 CHECK(counterparty_node_id->arr_len == 33);
21438 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
21439 LDKChannelTypeFeatures channel_type_conv;
21440 channel_type_conv.inner = untag_ptr(channel_type);
21441 channel_type_conv.is_owned = ptr_is_owned(channel_type);
21442 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
21443 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
21444 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21445 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
21446 uint64_t ret_ref = tag_ptr(ret_copy, true);
21450 uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) {
21451 LDKThirtyTwoBytes prev_channel_id_ref;
21452 CHECK(prev_channel_id->arr_len == 32);
21453 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
21454 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
21455 CHECK_ACCESS(failed_next_destination_ptr);
21456 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
21457 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
21458 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21459 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
21460 uint64_t ret_ref = tag_ptr(ret_copy, true);
21464 int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
21465 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
21466 LDKCVec_u8Z ret_var = Event_write(obj_conv);
21467 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21468 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21469 CVec_u8Z_free(ret_var);
21473 uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
21474 LDKu8slice ser_ref;
21475 ser_ref.datalen = ser->arr_len;
21476 ser_ref.data = ser->elems;
21477 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
21478 *ret_conv = Event_read(ser_ref);
21480 return tag_ptr(ret_conv, true);
21483 void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint64_t this_ptr) {
21484 if (!ptr_is_owned(this_ptr)) return;
21485 void* this_ptr_ptr = untag_ptr(this_ptr);
21486 CHECK_ACCESS(this_ptr_ptr);
21487 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
21488 FREE(untag_ptr(this_ptr));
21489 MessageSendEvent_free(this_ptr_conv);
21492 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
21493 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21494 *ret_copy = MessageSendEvent_clone(arg);
21495 uint64_t ret_ref = tag_ptr(ret_copy, true);
21498 int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) {
21499 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
21500 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
21504 uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) {
21505 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
21506 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21507 *ret_copy = MessageSendEvent_clone(orig_conv);
21508 uint64_t ret_ref = tag_ptr(ret_copy, true);
21512 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) {
21513 LDKPublicKey node_id_ref;
21514 CHECK(node_id->arr_len == 33);
21515 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21516 LDKAcceptChannel msg_conv;
21517 msg_conv.inner = untag_ptr(msg);
21518 msg_conv.is_owned = ptr_is_owned(msg);
21519 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21520 msg_conv = AcceptChannel_clone(&msg_conv);
21521 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21522 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
21523 uint64_t ret_ref = tag_ptr(ret_copy, true);
21527 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) {
21528 LDKPublicKey node_id_ref;
21529 CHECK(node_id->arr_len == 33);
21530 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21531 LDKOpenChannel msg_conv;
21532 msg_conv.inner = untag_ptr(msg);
21533 msg_conv.is_owned = ptr_is_owned(msg);
21534 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21535 msg_conv = OpenChannel_clone(&msg_conv);
21536 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21537 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
21538 uint64_t ret_ref = tag_ptr(ret_copy, true);
21542 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) {
21543 LDKPublicKey node_id_ref;
21544 CHECK(node_id->arr_len == 33);
21545 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21546 LDKFundingCreated msg_conv;
21547 msg_conv.inner = untag_ptr(msg);
21548 msg_conv.is_owned = ptr_is_owned(msg);
21549 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21550 msg_conv = FundingCreated_clone(&msg_conv);
21551 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21552 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
21553 uint64_t ret_ref = tag_ptr(ret_copy, true);
21557 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) {
21558 LDKPublicKey node_id_ref;
21559 CHECK(node_id->arr_len == 33);
21560 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21561 LDKFundingSigned msg_conv;
21562 msg_conv.inner = untag_ptr(msg);
21563 msg_conv.is_owned = ptr_is_owned(msg);
21564 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21565 msg_conv = FundingSigned_clone(&msg_conv);
21566 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21567 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
21568 uint64_t ret_ref = tag_ptr(ret_copy, true);
21572 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) {
21573 LDKPublicKey node_id_ref;
21574 CHECK(node_id->arr_len == 33);
21575 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21576 LDKChannelReady msg_conv;
21577 msg_conv.inner = untag_ptr(msg);
21578 msg_conv.is_owned = ptr_is_owned(msg);
21579 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21580 msg_conv = ChannelReady_clone(&msg_conv);
21581 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21582 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
21583 uint64_t ret_ref = tag_ptr(ret_copy, true);
21587 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) {
21588 LDKPublicKey node_id_ref;
21589 CHECK(node_id->arr_len == 33);
21590 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21591 LDKAnnouncementSignatures msg_conv;
21592 msg_conv.inner = untag_ptr(msg);
21593 msg_conv.is_owned = ptr_is_owned(msg);
21594 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21595 msg_conv = AnnouncementSignatures_clone(&msg_conv);
21596 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21597 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
21598 uint64_t ret_ref = tag_ptr(ret_copy, true);
21602 uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) {
21603 LDKPublicKey node_id_ref;
21604 CHECK(node_id->arr_len == 33);
21605 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21606 LDKCommitmentUpdate updates_conv;
21607 updates_conv.inner = untag_ptr(updates);
21608 updates_conv.is_owned = ptr_is_owned(updates);
21609 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
21610 updates_conv = CommitmentUpdate_clone(&updates_conv);
21611 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21612 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
21613 uint64_t ret_ref = tag_ptr(ret_copy, true);
21617 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) {
21618 LDKPublicKey node_id_ref;
21619 CHECK(node_id->arr_len == 33);
21620 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21621 LDKRevokeAndACK msg_conv;
21622 msg_conv.inner = untag_ptr(msg);
21623 msg_conv.is_owned = ptr_is_owned(msg);
21624 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21625 msg_conv = RevokeAndACK_clone(&msg_conv);
21626 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21627 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
21628 uint64_t ret_ref = tag_ptr(ret_copy, true);
21632 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) {
21633 LDKPublicKey node_id_ref;
21634 CHECK(node_id->arr_len == 33);
21635 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21636 LDKClosingSigned msg_conv;
21637 msg_conv.inner = untag_ptr(msg);
21638 msg_conv.is_owned = ptr_is_owned(msg);
21639 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21640 msg_conv = ClosingSigned_clone(&msg_conv);
21641 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21642 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
21643 uint64_t ret_ref = tag_ptr(ret_copy, true);
21647 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) {
21648 LDKPublicKey node_id_ref;
21649 CHECK(node_id->arr_len == 33);
21650 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21651 LDKShutdown msg_conv;
21652 msg_conv.inner = untag_ptr(msg);
21653 msg_conv.is_owned = ptr_is_owned(msg);
21654 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21655 msg_conv = Shutdown_clone(&msg_conv);
21656 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21657 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
21658 uint64_t ret_ref = tag_ptr(ret_copy, true);
21662 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) {
21663 LDKPublicKey node_id_ref;
21664 CHECK(node_id->arr_len == 33);
21665 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21666 LDKChannelReestablish msg_conv;
21667 msg_conv.inner = untag_ptr(msg);
21668 msg_conv.is_owned = ptr_is_owned(msg);
21669 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21670 msg_conv = ChannelReestablish_clone(&msg_conv);
21671 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21672 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
21673 uint64_t ret_ref = tag_ptr(ret_copy, true);
21677 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_announcement"))) TS_MessageSendEvent_send_channel_announcement(int8_tArray node_id, uint64_t msg, uint64_t update_msg) {
21678 LDKPublicKey node_id_ref;
21679 CHECK(node_id->arr_len == 33);
21680 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21681 LDKChannelAnnouncement msg_conv;
21682 msg_conv.inner = untag_ptr(msg);
21683 msg_conv.is_owned = ptr_is_owned(msg);
21684 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21685 msg_conv = ChannelAnnouncement_clone(&msg_conv);
21686 LDKChannelUpdate update_msg_conv;
21687 update_msg_conv.inner = untag_ptr(update_msg);
21688 update_msg_conv.is_owned = ptr_is_owned(update_msg);
21689 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
21690 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
21691 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21692 *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
21693 uint64_t ret_ref = tag_ptr(ret_copy, true);
21697 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
21698 LDKChannelAnnouncement msg_conv;
21699 msg_conv.inner = untag_ptr(msg);
21700 msg_conv.is_owned = ptr_is_owned(msg);
21701 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21702 msg_conv = ChannelAnnouncement_clone(&msg_conv);
21703 LDKChannelUpdate update_msg_conv;
21704 update_msg_conv.inner = untag_ptr(update_msg);
21705 update_msg_conv.is_owned = ptr_is_owned(update_msg);
21706 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
21707 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
21708 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21709 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
21710 uint64_t ret_ref = tag_ptr(ret_copy, true);
21714 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) {
21715 LDKChannelUpdate msg_conv;
21716 msg_conv.inner = untag_ptr(msg);
21717 msg_conv.is_owned = ptr_is_owned(msg);
21718 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21719 msg_conv = ChannelUpdate_clone(&msg_conv);
21720 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21721 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
21722 uint64_t ret_ref = tag_ptr(ret_copy, true);
21726 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
21727 LDKPublicKey node_id_ref;
21728 CHECK(node_id->arr_len == 33);
21729 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21730 LDKChannelUpdate msg_conv;
21731 msg_conv.inner = untag_ptr(msg);
21732 msg_conv.is_owned = ptr_is_owned(msg);
21733 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21734 msg_conv = ChannelUpdate_clone(&msg_conv);
21735 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21736 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
21737 uint64_t ret_ref = tag_ptr(ret_copy, true);
21741 uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) {
21742 LDKPublicKey node_id_ref;
21743 CHECK(node_id->arr_len == 33);
21744 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21745 void* action_ptr = untag_ptr(action);
21746 CHECK_ACCESS(action_ptr);
21747 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
21748 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
21749 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21750 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
21751 uint64_t ret_ref = tag_ptr(ret_copy, true);
21755 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) {
21756 LDKPublicKey node_id_ref;
21757 CHECK(node_id->arr_len == 33);
21758 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21759 LDKQueryChannelRange msg_conv;
21760 msg_conv.inner = untag_ptr(msg);
21761 msg_conv.is_owned = ptr_is_owned(msg);
21762 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21763 msg_conv = QueryChannelRange_clone(&msg_conv);
21764 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21765 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
21766 uint64_t ret_ref = tag_ptr(ret_copy, true);
21770 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) {
21771 LDKPublicKey node_id_ref;
21772 CHECK(node_id->arr_len == 33);
21773 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21774 LDKQueryShortChannelIds msg_conv;
21775 msg_conv.inner = untag_ptr(msg);
21776 msg_conv.is_owned = ptr_is_owned(msg);
21777 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21778 msg_conv = QueryShortChannelIds_clone(&msg_conv);
21779 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21780 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
21781 uint64_t ret_ref = tag_ptr(ret_copy, true);
21785 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) {
21786 LDKPublicKey node_id_ref;
21787 CHECK(node_id->arr_len == 33);
21788 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21789 LDKReplyChannelRange msg_conv;
21790 msg_conv.inner = untag_ptr(msg);
21791 msg_conv.is_owned = ptr_is_owned(msg);
21792 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21793 msg_conv = ReplyChannelRange_clone(&msg_conv);
21794 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21795 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
21796 uint64_t ret_ref = tag_ptr(ret_copy, true);
21800 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) {
21801 LDKPublicKey node_id_ref;
21802 CHECK(node_id->arr_len == 33);
21803 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21804 LDKGossipTimestampFilter msg_conv;
21805 msg_conv.inner = untag_ptr(msg);
21806 msg_conv.is_owned = ptr_is_owned(msg);
21807 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21808 msg_conv = GossipTimestampFilter_clone(&msg_conv);
21809 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21810 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
21811 uint64_t ret_ref = tag_ptr(ret_copy, true);
21815 void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint64_t this_ptr) {
21816 if (!ptr_is_owned(this_ptr)) return;
21817 void* this_ptr_ptr = untag_ptr(this_ptr);
21818 CHECK_ACCESS(this_ptr_ptr);
21819 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
21820 FREE(untag_ptr(this_ptr));
21821 MessageSendEventsProvider_free(this_ptr_conv);
21824 void __attribute__((export_name("TS_OnionMessageProvider_free"))) TS_OnionMessageProvider_free(uint64_t this_ptr) {
21825 if (!ptr_is_owned(this_ptr)) return;
21826 void* this_ptr_ptr = untag_ptr(this_ptr);
21827 CHECK_ACCESS(this_ptr_ptr);
21828 LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
21829 FREE(untag_ptr(this_ptr));
21830 OnionMessageProvider_free(this_ptr_conv);
21833 void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
21834 if (!ptr_is_owned(this_ptr)) return;
21835 void* this_ptr_ptr = untag_ptr(this_ptr);
21836 CHECK_ACCESS(this_ptr_ptr);
21837 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
21838 FREE(untag_ptr(this_ptr));
21839 EventsProvider_free(this_ptr_conv);
21842 void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint64_t this_ptr) {
21843 if (!ptr_is_owned(this_ptr)) return;
21844 void* this_ptr_ptr = untag_ptr(this_ptr);
21845 CHECK_ACCESS(this_ptr_ptr);
21846 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
21847 FREE(untag_ptr(this_ptr));
21848 EventHandler_free(this_ptr_conv);
21851 void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) {
21852 if (!ptr_is_owned(this_ptr)) return;
21853 void* this_ptr_ptr = untag_ptr(this_ptr);
21854 CHECK_ACCESS(this_ptr_ptr);
21855 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
21856 FREE(untag_ptr(this_ptr));
21857 APIError_free(this_ptr_conv);
21860 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
21861 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21862 *ret_copy = APIError_clone(arg);
21863 uint64_t ret_ref = tag_ptr(ret_copy, true);
21866 int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) {
21867 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
21868 int64_t ret_conv = APIError_clone_ptr(arg_conv);
21872 uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) {
21873 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
21874 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21875 *ret_copy = APIError_clone(orig_conv);
21876 uint64_t ret_ref = tag_ptr(ret_copy, true);
21880 uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) {
21881 LDKStr err_conv = str_ref_to_owned_c(err);
21882 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21883 *ret_copy = APIError_apimisuse_error(err_conv);
21884 uint64_t ret_ref = tag_ptr(ret_copy, true);
21888 uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
21889 LDKStr err_conv = str_ref_to_owned_c(err);
21890 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21891 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
21892 uint64_t ret_ref = tag_ptr(ret_copy, true);
21896 uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
21897 LDKStr err_conv = str_ref_to_owned_c(err);
21898 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21899 *ret_copy = APIError_route_error(err_conv);
21900 uint64_t ret_ref = tag_ptr(ret_copy, true);
21904 uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) {
21905 LDKStr err_conv = str_ref_to_owned_c(err);
21906 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21907 *ret_copy = APIError_channel_unavailable(err_conv);
21908 uint64_t ret_ref = tag_ptr(ret_copy, true);
21912 uint64_t __attribute__((export_name("TS_APIError_monitor_update_in_progress"))) TS_APIError_monitor_update_in_progress() {
21913 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21914 *ret_copy = APIError_monitor_update_in_progress();
21915 uint64_t ret_ref = tag_ptr(ret_copy, true);
21919 uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) {
21920 LDKShutdownScript script_conv;
21921 script_conv.inner = untag_ptr(script);
21922 script_conv.is_owned = ptr_is_owned(script);
21923 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
21924 script_conv = ShutdownScript_clone(&script_conv);
21925 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21926 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
21927 uint64_t ret_ref = tag_ptr(ret_copy, true);
21931 jboolean __attribute__((export_name("TS_APIError_eq"))) TS_APIError_eq(uint64_t a, uint64_t b) {
21932 LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
21933 LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
21934 jboolean ret_conv = APIError_eq(a_conv, b_conv);
21938 void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
21939 LDKBigSize this_obj_conv;
21940 this_obj_conv.inner = untag_ptr(this_obj);
21941 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21943 BigSize_free(this_obj_conv);
21946 int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) {
21947 LDKBigSize this_ptr_conv;
21948 this_ptr_conv.inner = untag_ptr(this_ptr);
21949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21951 this_ptr_conv.is_owned = false;
21952 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
21956 void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) {
21957 LDKBigSize this_ptr_conv;
21958 this_ptr_conv.inner = untag_ptr(this_ptr);
21959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21961 this_ptr_conv.is_owned = false;
21962 BigSize_set_a(&this_ptr_conv, val);
21965 uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) {
21966 LDKBigSize ret_var = BigSize_new(a_arg);
21967 uint64_t ret_ref = 0;
21968 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21969 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21973 void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) {
21974 LDKHostname this_obj_conv;
21975 this_obj_conv.inner = untag_ptr(this_obj);
21976 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21978 Hostname_free(this_obj_conv);
21981 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
21982 LDKHostname ret_var = Hostname_clone(arg);
21983 uint64_t ret_ref = 0;
21984 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21985 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21988 int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) {
21989 LDKHostname arg_conv;
21990 arg_conv.inner = untag_ptr(arg);
21991 arg_conv.is_owned = ptr_is_owned(arg);
21992 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21993 arg_conv.is_owned = false;
21994 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
21998 uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) {
21999 LDKHostname orig_conv;
22000 orig_conv.inner = untag_ptr(orig);
22001 orig_conv.is_owned = ptr_is_owned(orig);
22002 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22003 orig_conv.is_owned = false;
22004 LDKHostname ret_var = Hostname_clone(&orig_conv);
22005 uint64_t ret_ref = 0;
22006 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22007 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22011 jboolean __attribute__((export_name("TS_Hostname_eq"))) TS_Hostname_eq(uint64_t a, uint64_t b) {
22012 LDKHostname a_conv;
22013 a_conv.inner = untag_ptr(a);
22014 a_conv.is_owned = ptr_is_owned(a);
22015 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22016 a_conv.is_owned = false;
22017 LDKHostname b_conv;
22018 b_conv.inner = untag_ptr(b);
22019 b_conv.is_owned = ptr_is_owned(b);
22020 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22021 b_conv.is_owned = false;
22022 jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
22026 int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
22027 LDKHostname this_arg_conv;
22028 this_arg_conv.inner = untag_ptr(this_arg);
22029 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22031 this_arg_conv.is_owned = false;
22032 int8_t ret_conv = Hostname_len(&this_arg_conv);
22036 uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
22037 LDKu8slice msg_ref;
22038 msg_ref.datalen = msg->arr_len;
22039 msg_ref.data = msg->elems;
22040 unsigned char sk_arr[32];
22041 CHECK(sk->arr_len == 32);
22042 memcpy(sk_arr, sk->elems, 32); FREE(sk);
22043 unsigned char (*sk_ref)[32] = &sk_arr;
22044 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22045 *ret_conv = sign(msg_ref, sk_ref);
22047 return tag_ptr(ret_conv, true);
22050 uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
22051 LDKu8slice msg_ref;
22052 msg_ref.datalen = msg->arr_len;
22053 msg_ref.data = msg->elems;
22054 LDKStr sig_conv = str_ref_to_owned_c(sig);
22055 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
22056 *ret_conv = recover_pk(msg_ref, sig_conv);
22058 return tag_ptr(ret_conv, true);
22061 jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
22062 LDKu8slice msg_ref;
22063 msg_ref.datalen = msg->arr_len;
22064 msg_ref.data = msg->elems;
22065 LDKStr sig_conv = str_ref_to_owned_c(sig);
22066 LDKPublicKey pk_ref;
22067 CHECK(pk->arr_len == 33);
22068 memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
22069 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
22074 int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
22075 LDKu8slice hrp_bytes_ref;
22076 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
22077 hrp_bytes_ref.data = hrp_bytes->elems;
22078 LDKCVec_u5Z data_without_signature_constr;
22079 data_without_signature_constr.datalen = data_without_signature->arr_len;
22080 if (data_without_signature_constr.datalen > 0)
22081 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
22083 data_without_signature_constr.data = NULL;
22084 int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
22085 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
22086 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
22088 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
22090 FREE(data_without_signature);
22091 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
22092 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22093 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22094 CVec_u8Z_free(ret_var);
22099 void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64_t this_ptr) {
22100 if (!ptr_is_owned(this_ptr)) return;
22101 void* this_ptr_ptr = untag_ptr(this_ptr);
22102 CHECK_ACCESS(this_ptr_ptr);
22103 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
22104 FREE(untag_ptr(this_ptr));
22105 Persister_free(this_ptr_conv);
22108 void __attribute__((export_name("TS_FutureCallback_free"))) TS_FutureCallback_free(uint64_t this_ptr) {
22109 if (!ptr_is_owned(this_ptr)) return;
22110 void* this_ptr_ptr = untag_ptr(this_ptr);
22111 CHECK_ACCESS(this_ptr_ptr);
22112 LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
22113 FREE(untag_ptr(this_ptr));
22114 FutureCallback_free(this_ptr_conv);
22117 void __attribute__((export_name("TS_Future_free"))) TS_Future_free(uint64_t this_obj) {
22118 LDKFuture this_obj_conv;
22119 this_obj_conv.inner = untag_ptr(this_obj);
22120 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22122 Future_free(this_obj_conv);
22125 void __attribute__((export_name("TS_Future_register_callback_fn"))) TS_Future_register_callback_fn(uint64_t this_arg, uint64_t callback) {
22126 LDKFuture this_arg_conv;
22127 this_arg_conv.inner = untag_ptr(this_arg);
22128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22130 this_arg_conv.is_owned = false;
22131 void* callback_ptr = untag_ptr(callback);
22132 CHECK_ACCESS(callback_ptr);
22133 LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
22134 if (callback_conv.free == LDKFutureCallback_JCalls_free) {
22135 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22136 LDKFutureCallback_JCalls_cloned(&callback_conv);
22138 Future_register_callback_fn(&this_arg_conv, callback_conv);
22141 uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
22142 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
22143 uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
22147 uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() {
22148 uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
22152 uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() {
22153 uint32_t ret_conv = LDKLevel_to_js(Level_trace());
22157 uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() {
22158 uint32_t ret_conv = LDKLevel_to_js(Level_debug());
22162 uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() {
22163 uint32_t ret_conv = LDKLevel_to_js(Level_info());
22167 uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() {
22168 uint32_t ret_conv = LDKLevel_to_js(Level_warn());
22172 uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() {
22173 uint32_t ret_conv = LDKLevel_to_js(Level_error());
22177 jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) {
22178 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
22179 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
22180 jboolean ret_conv = Level_eq(a_conv, b_conv);
22184 int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) {
22185 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
22186 int64_t ret_conv = Level_hash(o_conv);
22190 uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() {
22191 uint32_t ret_conv = LDKLevel_to_js(Level_max());
22195 void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) {
22196 LDKRecord this_obj_conv;
22197 this_obj_conv.inner = untag_ptr(this_obj);
22198 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22200 Record_free(this_obj_conv);
22203 uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) {
22204 LDKRecord this_ptr_conv;
22205 this_ptr_conv.inner = untag_ptr(this_ptr);
22206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22208 this_ptr_conv.is_owned = false;
22209 uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv));
22213 void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) {
22214 LDKRecord this_ptr_conv;
22215 this_ptr_conv.inner = untag_ptr(this_ptr);
22216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22218 this_ptr_conv.is_owned = false;
22219 LDKLevel val_conv = LDKLevel_from_js(val);
22220 Record_set_level(&this_ptr_conv, val_conv);
22223 jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) {
22224 LDKRecord this_ptr_conv;
22225 this_ptr_conv.inner = untag_ptr(this_ptr);
22226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22228 this_ptr_conv.is_owned = false;
22229 LDKStr ret_str = Record_get_args(&this_ptr_conv);
22230 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22235 void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) {
22236 LDKRecord this_ptr_conv;
22237 this_ptr_conv.inner = untag_ptr(this_ptr);
22238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22240 this_ptr_conv.is_owned = false;
22241 LDKStr val_conv = str_ref_to_owned_c(val);
22242 Record_set_args(&this_ptr_conv, val_conv);
22245 jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) {
22246 LDKRecord this_ptr_conv;
22247 this_ptr_conv.inner = untag_ptr(this_ptr);
22248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22250 this_ptr_conv.is_owned = false;
22251 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
22252 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22257 void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) {
22258 LDKRecord this_ptr_conv;
22259 this_ptr_conv.inner = untag_ptr(this_ptr);
22260 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22262 this_ptr_conv.is_owned = false;
22263 LDKStr val_conv = str_ref_to_owned_c(val);
22264 Record_set_module_path(&this_ptr_conv, val_conv);
22267 jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) {
22268 LDKRecord this_ptr_conv;
22269 this_ptr_conv.inner = untag_ptr(this_ptr);
22270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22272 this_ptr_conv.is_owned = false;
22273 LDKStr ret_str = Record_get_file(&this_ptr_conv);
22274 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22279 void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) {
22280 LDKRecord this_ptr_conv;
22281 this_ptr_conv.inner = untag_ptr(this_ptr);
22282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22284 this_ptr_conv.is_owned = false;
22285 LDKStr val_conv = str_ref_to_owned_c(val);
22286 Record_set_file(&this_ptr_conv, val_conv);
22289 int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) {
22290 LDKRecord this_ptr_conv;
22291 this_ptr_conv.inner = untag_ptr(this_ptr);
22292 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22294 this_ptr_conv.is_owned = false;
22295 int32_t ret_conv = Record_get_line(&this_ptr_conv);
22299 void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) {
22300 LDKRecord this_ptr_conv;
22301 this_ptr_conv.inner = untag_ptr(this_ptr);
22302 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22304 this_ptr_conv.is_owned = false;
22305 Record_set_line(&this_ptr_conv, val);
22308 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
22309 LDKRecord ret_var = Record_clone(arg);
22310 uint64_t ret_ref = 0;
22311 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22312 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22315 int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) {
22316 LDKRecord arg_conv;
22317 arg_conv.inner = untag_ptr(arg);
22318 arg_conv.is_owned = ptr_is_owned(arg);
22319 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22320 arg_conv.is_owned = false;
22321 int64_t ret_conv = Record_clone_ptr(&arg_conv);
22325 uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) {
22326 LDKRecord orig_conv;
22327 orig_conv.inner = untag_ptr(orig);
22328 orig_conv.is_owned = ptr_is_owned(orig);
22329 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22330 orig_conv.is_owned = false;
22331 LDKRecord ret_var = Record_clone(&orig_conv);
22332 uint64_t ret_ref = 0;
22333 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22334 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22338 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint64_t this_ptr) {
22339 if (!ptr_is_owned(this_ptr)) return;
22340 void* this_ptr_ptr = untag_ptr(this_ptr);
22341 CHECK_ACCESS(this_ptr_ptr);
22342 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
22343 FREE(untag_ptr(this_ptr));
22344 Logger_free(this_ptr_conv);
22347 void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) {
22348 LDKChannelHandshakeConfig this_obj_conv;
22349 this_obj_conv.inner = untag_ptr(this_obj);
22350 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22352 ChannelHandshakeConfig_free(this_obj_conv);
22355 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) {
22356 LDKChannelHandshakeConfig this_ptr_conv;
22357 this_ptr_conv.inner = untag_ptr(this_ptr);
22358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22360 this_ptr_conv.is_owned = false;
22361 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
22365 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) {
22366 LDKChannelHandshakeConfig this_ptr_conv;
22367 this_ptr_conv.inner = untag_ptr(this_ptr);
22368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22370 this_ptr_conv.is_owned = false;
22371 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
22374 int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(uint64_t this_ptr) {
22375 LDKChannelHandshakeConfig this_ptr_conv;
22376 this_ptr_conv.inner = untag_ptr(this_ptr);
22377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22379 this_ptr_conv.is_owned = false;
22380 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
22384 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_to_self_delay"))) TS_ChannelHandshakeConfig_set_our_to_self_delay(uint64_t this_ptr, int16_t val) {
22385 LDKChannelHandshakeConfig this_ptr_conv;
22386 this_ptr_conv.inner = untag_ptr(this_ptr);
22387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22389 this_ptr_conv.is_owned = false;
22390 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
22393 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint64_t this_ptr) {
22394 LDKChannelHandshakeConfig this_ptr_conv;
22395 this_ptr_conv.inner = untag_ptr(this_ptr);
22396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22398 this_ptr_conv.is_owned = false;
22399 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
22403 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
22404 LDKChannelHandshakeConfig this_ptr_conv;
22405 this_ptr_conv.inner = untag_ptr(this_ptr);
22406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22408 this_ptr_conv.is_owned = false;
22409 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
22412 int8_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(uint64_t this_ptr) {
22413 LDKChannelHandshakeConfig this_ptr_conv;
22414 this_ptr_conv.inner = untag_ptr(this_ptr);
22415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22417 this_ptr_conv.is_owned = false;
22418 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
22422 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(uint64_t this_ptr, int8_t val) {
22423 LDKChannelHandshakeConfig this_ptr_conv;
22424 this_ptr_conv.inner = untag_ptr(this_ptr);
22425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22427 this_ptr_conv.is_owned = false;
22428 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
22431 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(uint64_t this_ptr) {
22432 LDKChannelHandshakeConfig this_ptr_conv;
22433 this_ptr_conv.inner = untag_ptr(this_ptr);
22434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22436 this_ptr_conv.is_owned = false;
22437 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
22441 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean val) {
22442 LDKChannelHandshakeConfig this_ptr_conv;
22443 this_ptr_conv.inner = untag_ptr(this_ptr);
22444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22446 this_ptr_conv.is_owned = false;
22447 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
22450 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(uint64_t this_ptr) {
22451 LDKChannelHandshakeConfig this_ptr_conv;
22452 this_ptr_conv.inner = untag_ptr(this_ptr);
22453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22455 this_ptr_conv.is_owned = false;
22456 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
22460 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean val) {
22461 LDKChannelHandshakeConfig this_ptr_conv;
22462 this_ptr_conv.inner = untag_ptr(this_ptr);
22463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22465 this_ptr_conv.is_owned = false;
22466 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
22469 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(uint64_t this_ptr) {
22470 LDKChannelHandshakeConfig this_ptr_conv;
22471 this_ptr_conv.inner = untag_ptr(this_ptr);
22472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22474 this_ptr_conv.is_owned = false;
22475 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
22479 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean val) {
22480 LDKChannelHandshakeConfig this_ptr_conv;
22481 this_ptr_conv.inner = untag_ptr(this_ptr);
22482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22484 this_ptr_conv.is_owned = false;
22485 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
22488 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(uint64_t this_ptr) {
22489 LDKChannelHandshakeConfig this_ptr_conv;
22490 this_ptr_conv.inner = untag_ptr(this_ptr);
22491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22493 this_ptr_conv.is_owned = false;
22494 int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
22498 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(uint64_t this_ptr, int32_t val) {
22499 LDKChannelHandshakeConfig this_ptr_conv;
22500 this_ptr_conv.inner = untag_ptr(this_ptr);
22501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22503 this_ptr_conv.is_owned = false;
22504 ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
22507 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_new"))) TS_ChannelHandshakeConfig_new(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) {
22508 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);
22509 uint64_t ret_ref = 0;
22510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22511 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22515 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
22516 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
22517 uint64_t ret_ref = 0;
22518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22522 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) {
22523 LDKChannelHandshakeConfig arg_conv;
22524 arg_conv.inner = untag_ptr(arg);
22525 arg_conv.is_owned = ptr_is_owned(arg);
22526 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22527 arg_conv.is_owned = false;
22528 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
22532 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) {
22533 LDKChannelHandshakeConfig orig_conv;
22534 orig_conv.inner = untag_ptr(orig);
22535 orig_conv.is_owned = ptr_is_owned(orig);
22536 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22537 orig_conv.is_owned = false;
22538 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
22539 uint64_t ret_ref = 0;
22540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22545 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() {
22546 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
22547 uint64_t ret_ref = 0;
22548 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22549 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22553 void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) {
22554 LDKChannelHandshakeLimits this_obj_conv;
22555 this_obj_conv.inner = untag_ptr(this_obj);
22556 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22558 ChannelHandshakeLimits_free(this_obj_conv);
22561 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) {
22562 LDKChannelHandshakeLimits this_ptr_conv;
22563 this_ptr_conv.inner = untag_ptr(this_ptr);
22564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22566 this_ptr_conv.is_owned = false;
22567 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
22571 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) {
22572 LDKChannelHandshakeLimits this_ptr_conv;
22573 this_ptr_conv.inner = untag_ptr(this_ptr);
22574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22576 this_ptr_conv.is_owned = false;
22577 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
22580 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) {
22581 LDKChannelHandshakeLimits this_ptr_conv;
22582 this_ptr_conv.inner = untag_ptr(this_ptr);
22583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22585 this_ptr_conv.is_owned = false;
22586 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
22590 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) {
22591 LDKChannelHandshakeLimits this_ptr_conv;
22592 this_ptr_conv.inner = untag_ptr(this_ptr);
22593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22595 this_ptr_conv.is_owned = false;
22596 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
22599 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) {
22600 LDKChannelHandshakeLimits this_ptr_conv;
22601 this_ptr_conv.inner = untag_ptr(this_ptr);
22602 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22604 this_ptr_conv.is_owned = false;
22605 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
22609 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_set_max_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
22610 LDKChannelHandshakeLimits this_ptr_conv;
22611 this_ptr_conv.inner = untag_ptr(this_ptr);
22612 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22614 this_ptr_conv.is_owned = false;
22615 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
22618 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(uint64_t this_ptr) {
22619 LDKChannelHandshakeLimits this_ptr_conv;
22620 this_ptr_conv.inner = untag_ptr(this_ptr);
22621 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22623 this_ptr_conv.is_owned = false;
22624 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
22628 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) {
22629 LDKChannelHandshakeLimits this_ptr_conv;
22630 this_ptr_conv.inner = untag_ptr(this_ptr);
22631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22633 this_ptr_conv.is_owned = false;
22634 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
22637 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) {
22638 LDKChannelHandshakeLimits this_ptr_conv;
22639 this_ptr_conv.inner = untag_ptr(this_ptr);
22640 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22642 this_ptr_conv.is_owned = false;
22643 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
22647 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
22648 LDKChannelHandshakeLimits this_ptr_conv;
22649 this_ptr_conv.inner = untag_ptr(this_ptr);
22650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22652 this_ptr_conv.is_owned = false;
22653 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
22656 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) {
22657 LDKChannelHandshakeLimits this_ptr_conv;
22658 this_ptr_conv.inner = untag_ptr(this_ptr);
22659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22661 this_ptr_conv.is_owned = false;
22662 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
22666 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
22667 LDKChannelHandshakeLimits this_ptr_conv;
22668 this_ptr_conv.inner = untag_ptr(this_ptr);
22669 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22671 this_ptr_conv.is_owned = false;
22672 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
22675 int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) {
22676 LDKChannelHandshakeLimits this_ptr_conv;
22677 this_ptr_conv.inner = untag_ptr(this_ptr);
22678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22680 this_ptr_conv.is_owned = false;
22681 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
22685 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) {
22686 LDKChannelHandshakeLimits this_ptr_conv;
22687 this_ptr_conv.inner = untag_ptr(this_ptr);
22688 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22690 this_ptr_conv.is_owned = false;
22691 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
22694 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) {
22695 LDKChannelHandshakeLimits this_ptr_conv;
22696 this_ptr_conv.inner = untag_ptr(this_ptr);
22697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22699 this_ptr_conv.is_owned = false;
22700 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
22704 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) {
22705 LDKChannelHandshakeLimits this_ptr_conv;
22706 this_ptr_conv.inner = untag_ptr(this_ptr);
22707 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22709 this_ptr_conv.is_owned = false;
22710 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
22713 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) {
22714 LDKChannelHandshakeLimits this_ptr_conv;
22715 this_ptr_conv.inner = untag_ptr(this_ptr);
22716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22718 this_ptr_conv.is_owned = false;
22719 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
22723 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) {
22724 LDKChannelHandshakeLimits this_ptr_conv;
22725 this_ptr_conv.inner = untag_ptr(this_ptr);
22726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22728 this_ptr_conv.is_owned = false;
22729 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
22732 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) {
22733 LDKChannelHandshakeLimits this_ptr_conv;
22734 this_ptr_conv.inner = untag_ptr(this_ptr);
22735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22737 this_ptr_conv.is_owned = false;
22738 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
22742 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_their_to_self_delay"))) TS_ChannelHandshakeLimits_set_their_to_self_delay(uint64_t this_ptr, int16_t val) {
22743 LDKChannelHandshakeLimits this_ptr_conv;
22744 this_ptr_conv.inner = untag_ptr(this_ptr);
22745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22747 this_ptr_conv.is_owned = false;
22748 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
22751 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_ChannelHandshakeLimits_new(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) {
22752 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);
22753 uint64_t ret_ref = 0;
22754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22759 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
22760 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
22761 uint64_t ret_ref = 0;
22762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22766 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) {
22767 LDKChannelHandshakeLimits arg_conv;
22768 arg_conv.inner = untag_ptr(arg);
22769 arg_conv.is_owned = ptr_is_owned(arg);
22770 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22771 arg_conv.is_owned = false;
22772 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
22776 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) {
22777 LDKChannelHandshakeLimits orig_conv;
22778 orig_conv.inner = untag_ptr(orig);
22779 orig_conv.is_owned = ptr_is_owned(orig);
22780 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22781 orig_conv.is_owned = false;
22782 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
22783 uint64_t ret_ref = 0;
22784 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22785 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22789 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() {
22790 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
22791 uint64_t ret_ref = 0;
22792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22797 void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) {
22798 LDKChannelConfig this_obj_conv;
22799 this_obj_conv.inner = untag_ptr(this_obj);
22800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22802 ChannelConfig_free(this_obj_conv);
22805 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) {
22806 LDKChannelConfig this_ptr_conv;
22807 this_ptr_conv.inner = untag_ptr(this_ptr);
22808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22810 this_ptr_conv.is_owned = false;
22811 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
22815 void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_set_forwarding_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
22816 LDKChannelConfig this_ptr_conv;
22817 this_ptr_conv.inner = untag_ptr(this_ptr);
22818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22820 this_ptr_conv.is_owned = false;
22821 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
22824 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) {
22825 LDKChannelConfig this_ptr_conv;
22826 this_ptr_conv.inner = untag_ptr(this_ptr);
22827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22829 this_ptr_conv.is_owned = false;
22830 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
22834 void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_base_msat"))) TS_ChannelConfig_set_forwarding_fee_base_msat(uint64_t this_ptr, int32_t val) {
22835 LDKChannelConfig this_ptr_conv;
22836 this_ptr_conv.inner = untag_ptr(this_ptr);
22837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22839 this_ptr_conv.is_owned = false;
22840 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
22843 int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) {
22844 LDKChannelConfig this_ptr_conv;
22845 this_ptr_conv.inner = untag_ptr(this_ptr);
22846 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22848 this_ptr_conv.is_owned = false;
22849 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
22853 void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
22854 LDKChannelConfig this_ptr_conv;
22855 this_ptr_conv.inner = untag_ptr(this_ptr);
22856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22858 this_ptr_conv.is_owned = false;
22859 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
22862 int64_t __attribute__((export_name("TS_ChannelConfig_get_max_dust_htlc_exposure_msat"))) TS_ChannelConfig_get_max_dust_htlc_exposure_msat(uint64_t this_ptr) {
22863 LDKChannelConfig this_ptr_conv;
22864 this_ptr_conv.inner = untag_ptr(this_ptr);
22865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22867 this_ptr_conv.is_owned = false;
22868 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
22872 void __attribute__((export_name("TS_ChannelConfig_set_max_dust_htlc_exposure_msat"))) TS_ChannelConfig_set_max_dust_htlc_exposure_msat(uint64_t this_ptr, int64_t val) {
22873 LDKChannelConfig this_ptr_conv;
22874 this_ptr_conv.inner = untag_ptr(this_ptr);
22875 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22877 this_ptr_conv.is_owned = false;
22878 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
22881 int64_t __attribute__((export_name("TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr) {
22882 LDKChannelConfig this_ptr_conv;
22883 this_ptr_conv.inner = untag_ptr(this_ptr);
22884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22886 this_ptr_conv.is_owned = false;
22887 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
22891 void __attribute__((export_name("TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
22892 LDKChannelConfig this_ptr_conv;
22893 this_ptr_conv.inner = untag_ptr(this_ptr);
22894 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22896 this_ptr_conv.is_owned = false;
22897 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
22900 uint64_t __attribute__((export_name("TS_ChannelConfig_new"))) TS_ChannelConfig_new(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) {
22901 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);
22902 uint64_t ret_ref = 0;
22903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22908 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
22909 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
22910 uint64_t ret_ref = 0;
22911 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22912 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22915 int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) {
22916 LDKChannelConfig arg_conv;
22917 arg_conv.inner = untag_ptr(arg);
22918 arg_conv.is_owned = ptr_is_owned(arg);
22919 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22920 arg_conv.is_owned = false;
22921 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
22925 uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) {
22926 LDKChannelConfig orig_conv;
22927 orig_conv.inner = untag_ptr(orig);
22928 orig_conv.is_owned = ptr_is_owned(orig);
22929 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22930 orig_conv.is_owned = false;
22931 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
22932 uint64_t ret_ref = 0;
22933 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22934 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22938 jboolean __attribute__((export_name("TS_ChannelConfig_eq"))) TS_ChannelConfig_eq(uint64_t a, uint64_t b) {
22939 LDKChannelConfig a_conv;
22940 a_conv.inner = untag_ptr(a);
22941 a_conv.is_owned = ptr_is_owned(a);
22942 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22943 a_conv.is_owned = false;
22944 LDKChannelConfig b_conv;
22945 b_conv.inner = untag_ptr(b);
22946 b_conv.is_owned = ptr_is_owned(b);
22947 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22948 b_conv.is_owned = false;
22949 jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
22953 uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
22954 LDKChannelConfig ret_var = ChannelConfig_default();
22955 uint64_t ret_ref = 0;
22956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22961 int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) {
22962 LDKChannelConfig obj_conv;
22963 obj_conv.inner = untag_ptr(obj);
22964 obj_conv.is_owned = ptr_is_owned(obj);
22965 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22966 obj_conv.is_owned = false;
22967 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
22968 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22969 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22970 CVec_u8Z_free(ret_var);
22974 uint64_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
22975 LDKu8slice ser_ref;
22976 ser_ref.datalen = ser->arr_len;
22977 ser_ref.data = ser->elems;
22978 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22979 *ret_conv = ChannelConfig_read(ser_ref);
22981 return tag_ptr(ret_conv, true);
22984 void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) {
22985 LDKUserConfig this_obj_conv;
22986 this_obj_conv.inner = untag_ptr(this_obj);
22987 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22989 UserConfig_free(this_obj_conv);
22992 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) {
22993 LDKUserConfig this_ptr_conv;
22994 this_ptr_conv.inner = untag_ptr(this_ptr);
22995 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22997 this_ptr_conv.is_owned = false;
22998 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
22999 uint64_t ret_ref = 0;
23000 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23001 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23005 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) {
23006 LDKUserConfig this_ptr_conv;
23007 this_ptr_conv.inner = untag_ptr(this_ptr);
23008 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23010 this_ptr_conv.is_owned = false;
23011 LDKChannelHandshakeConfig val_conv;
23012 val_conv.inner = untag_ptr(val);
23013 val_conv.is_owned = ptr_is_owned(val);
23014 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23015 val_conv = ChannelHandshakeConfig_clone(&val_conv);
23016 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
23019 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) {
23020 LDKUserConfig this_ptr_conv;
23021 this_ptr_conv.inner = untag_ptr(this_ptr);
23022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23024 this_ptr_conv.is_owned = false;
23025 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
23026 uint64_t ret_ref = 0;
23027 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23028 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23032 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) {
23033 LDKUserConfig this_ptr_conv;
23034 this_ptr_conv.inner = untag_ptr(this_ptr);
23035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23037 this_ptr_conv.is_owned = false;
23038 LDKChannelHandshakeLimits val_conv;
23039 val_conv.inner = untag_ptr(val);
23040 val_conv.is_owned = ptr_is_owned(val);
23041 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23042 val_conv = ChannelHandshakeLimits_clone(&val_conv);
23043 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
23046 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) {
23047 LDKUserConfig this_ptr_conv;
23048 this_ptr_conv.inner = untag_ptr(this_ptr);
23049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23051 this_ptr_conv.is_owned = false;
23052 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
23053 uint64_t ret_ref = 0;
23054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23059 void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) {
23060 LDKUserConfig this_ptr_conv;
23061 this_ptr_conv.inner = untag_ptr(this_ptr);
23062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23064 this_ptr_conv.is_owned = false;
23065 LDKChannelConfig val_conv;
23066 val_conv.inner = untag_ptr(val);
23067 val_conv.is_owned = ptr_is_owned(val);
23068 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23069 val_conv = ChannelConfig_clone(&val_conv);
23070 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
23073 jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) {
23074 LDKUserConfig this_ptr_conv;
23075 this_ptr_conv.inner = untag_ptr(this_ptr);
23076 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23078 this_ptr_conv.is_owned = false;
23079 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
23083 void __attribute__((export_name("TS_UserConfig_set_accept_forwards_to_priv_channels"))) TS_UserConfig_set_accept_forwards_to_priv_channels(uint64_t this_ptr, jboolean val) {
23084 LDKUserConfig this_ptr_conv;
23085 this_ptr_conv.inner = untag_ptr(this_ptr);
23086 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23088 this_ptr_conv.is_owned = false;
23089 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
23092 jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) {
23093 LDKUserConfig this_ptr_conv;
23094 this_ptr_conv.inner = untag_ptr(this_ptr);
23095 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23097 this_ptr_conv.is_owned = false;
23098 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
23102 void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
23103 LDKUserConfig this_ptr_conv;
23104 this_ptr_conv.inner = untag_ptr(this_ptr);
23105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23107 this_ptr_conv.is_owned = false;
23108 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
23111 jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) {
23112 LDKUserConfig this_ptr_conv;
23113 this_ptr_conv.inner = untag_ptr(this_ptr);
23114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23116 this_ptr_conv.is_owned = false;
23117 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
23121 void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
23122 LDKUserConfig this_ptr_conv;
23123 this_ptr_conv.inner = untag_ptr(this_ptr);
23124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23126 this_ptr_conv.is_owned = false;
23127 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
23130 uint64_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(uint64_t channel_handshake_config_arg, uint64_t channel_handshake_limits_arg, uint64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) {
23131 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
23132 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
23133 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
23134 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
23135 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
23136 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
23137 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
23138 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
23139 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
23140 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
23141 LDKChannelConfig channel_config_arg_conv;
23142 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
23143 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
23144 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
23145 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
23146 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);
23147 uint64_t ret_ref = 0;
23148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23153 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
23154 LDKUserConfig ret_var = UserConfig_clone(arg);
23155 uint64_t ret_ref = 0;
23156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23160 int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) {
23161 LDKUserConfig arg_conv;
23162 arg_conv.inner = untag_ptr(arg);
23163 arg_conv.is_owned = ptr_is_owned(arg);
23164 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23165 arg_conv.is_owned = false;
23166 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
23170 uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) {
23171 LDKUserConfig orig_conv;
23172 orig_conv.inner = untag_ptr(orig);
23173 orig_conv.is_owned = ptr_is_owned(orig);
23174 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23175 orig_conv.is_owned = false;
23176 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
23177 uint64_t ret_ref = 0;
23178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23183 uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() {
23184 LDKUserConfig ret_var = UserConfig_default();
23185 uint64_t ret_ref = 0;
23186 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23187 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23191 void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) {
23192 LDKBestBlock this_obj_conv;
23193 this_obj_conv.inner = untag_ptr(this_obj);
23194 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23196 BestBlock_free(this_obj_conv);
23199 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
23200 LDKBestBlock ret_var = BestBlock_clone(arg);
23201 uint64_t ret_ref = 0;
23202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23206 int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) {
23207 LDKBestBlock arg_conv;
23208 arg_conv.inner = untag_ptr(arg);
23209 arg_conv.is_owned = ptr_is_owned(arg);
23210 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23211 arg_conv.is_owned = false;
23212 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
23216 uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) {
23217 LDKBestBlock orig_conv;
23218 orig_conv.inner = untag_ptr(orig);
23219 orig_conv.is_owned = ptr_is_owned(orig);
23220 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23221 orig_conv.is_owned = false;
23222 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
23223 uint64_t ret_ref = 0;
23224 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23225 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23229 jboolean __attribute__((export_name("TS_BestBlock_eq"))) TS_BestBlock_eq(uint64_t a, uint64_t b) {
23230 LDKBestBlock a_conv;
23231 a_conv.inner = untag_ptr(a);
23232 a_conv.is_owned = ptr_is_owned(a);
23233 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23234 a_conv.is_owned = false;
23235 LDKBestBlock b_conv;
23236 b_conv.inner = untag_ptr(b);
23237 b_conv.is_owned = ptr_is_owned(b);
23238 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23239 b_conv.is_owned = false;
23240 jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
23244 uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
23245 LDKNetwork network_conv = LDKNetwork_from_js(network);
23246 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
23247 uint64_t ret_ref = 0;
23248 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23249 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23253 uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
23254 LDKThirtyTwoBytes block_hash_ref;
23255 CHECK(block_hash->arr_len == 32);
23256 memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash);
23257 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
23258 uint64_t ret_ref = 0;
23259 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23260 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23264 int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) {
23265 LDKBestBlock this_arg_conv;
23266 this_arg_conv.inner = untag_ptr(this_arg);
23267 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23269 this_arg_conv.is_owned = false;
23270 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23271 memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32);
23275 int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) {
23276 LDKBestBlock this_arg_conv;
23277 this_arg_conv.inner = untag_ptr(this_arg);
23278 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23280 this_arg_conv.is_owned = false;
23281 int32_t ret_conv = BestBlock_height(&this_arg_conv);
23285 uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
23286 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
23287 uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
23291 uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
23292 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
23296 uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
23297 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
23301 void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint64_t this_ptr) {
23302 if (!ptr_is_owned(this_ptr)) return;
23303 void* this_ptr_ptr = untag_ptr(this_ptr);
23304 CHECK_ACCESS(this_ptr_ptr);
23305 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
23306 FREE(untag_ptr(this_ptr));
23307 Access_free(this_ptr_conv);
23310 void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) {
23311 if (!ptr_is_owned(this_ptr)) return;
23312 void* this_ptr_ptr = untag_ptr(this_ptr);
23313 CHECK_ACCESS(this_ptr_ptr);
23314 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
23315 FREE(untag_ptr(this_ptr));
23316 Listen_free(this_ptr_conv);
23319 void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t this_ptr) {
23320 if (!ptr_is_owned(this_ptr)) return;
23321 void* this_ptr_ptr = untag_ptr(this_ptr);
23322 CHECK_ACCESS(this_ptr_ptr);
23323 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
23324 FREE(untag_ptr(this_ptr));
23325 Confirm_free(this_ptr_conv);
23328 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_clone"))) TS_ChannelMonitorUpdateStatus_clone(uint64_t orig) {
23329 LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
23330 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_clone(orig_conv));
23334 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_completed"))) TS_ChannelMonitorUpdateStatus_completed() {
23335 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_completed());
23339 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_in_progress"))) TS_ChannelMonitorUpdateStatus_in_progress() {
23340 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_in_progress());
23344 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_permanent_failure"))) TS_ChannelMonitorUpdateStatus_permanent_failure() {
23345 uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_permanent_failure());
23349 jboolean __attribute__((export_name("TS_ChannelMonitorUpdateStatus_eq"))) TS_ChannelMonitorUpdateStatus_eq(uint64_t a, uint64_t b) {
23350 LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
23351 LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
23352 jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
23356 void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint64_t this_ptr) {
23357 if (!ptr_is_owned(this_ptr)) return;
23358 void* this_ptr_ptr = untag_ptr(this_ptr);
23359 CHECK_ACCESS(this_ptr_ptr);
23360 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
23361 FREE(untag_ptr(this_ptr));
23362 Watch_free(this_ptr_conv);
23365 void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint64_t this_ptr) {
23366 if (!ptr_is_owned(this_ptr)) return;
23367 void* this_ptr_ptr = untag_ptr(this_ptr);
23368 CHECK_ACCESS(this_ptr_ptr);
23369 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
23370 FREE(untag_ptr(this_ptr));
23371 Filter_free(this_ptr_conv);
23374 void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) {
23375 LDKWatchedOutput this_obj_conv;
23376 this_obj_conv.inner = untag_ptr(this_obj);
23377 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23379 WatchedOutput_free(this_obj_conv);
23382 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) {
23383 LDKWatchedOutput this_ptr_conv;
23384 this_ptr_conv.inner = untag_ptr(this_ptr);
23385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23387 this_ptr_conv.is_owned = false;
23388 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23389 memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32);
23393 void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, int8_tArray val) {
23394 LDKWatchedOutput this_ptr_conv;
23395 this_ptr_conv.inner = untag_ptr(this_ptr);
23396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23398 this_ptr_conv.is_owned = false;
23399 LDKThirtyTwoBytes val_ref;
23400 CHECK(val->arr_len == 32);
23401 memcpy(val_ref.data, val->elems, 32); FREE(val);
23402 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
23405 uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) {
23406 LDKWatchedOutput this_ptr_conv;
23407 this_ptr_conv.inner = untag_ptr(this_ptr);
23408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23410 this_ptr_conv.is_owned = false;
23411 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
23412 uint64_t ret_ref = 0;
23413 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23414 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23418 void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) {
23419 LDKWatchedOutput this_ptr_conv;
23420 this_ptr_conv.inner = untag_ptr(this_ptr);
23421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23423 this_ptr_conv.is_owned = false;
23424 LDKOutPoint val_conv;
23425 val_conv.inner = untag_ptr(val);
23426 val_conv.is_owned = ptr_is_owned(val);
23427 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23428 val_conv = OutPoint_clone(&val_conv);
23429 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
23432 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) {
23433 LDKWatchedOutput this_ptr_conv;
23434 this_ptr_conv.inner = untag_ptr(this_ptr);
23435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23437 this_ptr_conv.is_owned = false;
23438 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
23439 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23440 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23444 void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) {
23445 LDKWatchedOutput this_ptr_conv;
23446 this_ptr_conv.inner = untag_ptr(this_ptr);
23447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23449 this_ptr_conv.is_owned = false;
23450 LDKCVec_u8Z val_ref;
23451 val_ref.datalen = val->arr_len;
23452 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
23453 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
23454 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
23457 uint64_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_new(int8_tArray block_hash_arg, uint64_t outpoint_arg, int8_tArray script_pubkey_arg) {
23458 LDKThirtyTwoBytes block_hash_arg_ref;
23459 CHECK(block_hash_arg->arr_len == 32);
23460 memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg);
23461 LDKOutPoint outpoint_arg_conv;
23462 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23463 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23464 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23465 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23466 LDKCVec_u8Z script_pubkey_arg_ref;
23467 script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len;
23468 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
23469 memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg);
23470 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
23471 uint64_t ret_ref = 0;
23472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23473 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23477 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
23478 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
23479 uint64_t ret_ref = 0;
23480 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23481 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23484 int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) {
23485 LDKWatchedOutput arg_conv;
23486 arg_conv.inner = untag_ptr(arg);
23487 arg_conv.is_owned = ptr_is_owned(arg);
23488 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23489 arg_conv.is_owned = false;
23490 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
23494 uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) {
23495 LDKWatchedOutput orig_conv;
23496 orig_conv.inner = untag_ptr(orig);
23497 orig_conv.is_owned = ptr_is_owned(orig);
23498 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23499 orig_conv.is_owned = false;
23500 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
23501 uint64_t ret_ref = 0;
23502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23507 jboolean __attribute__((export_name("TS_WatchedOutput_eq"))) TS_WatchedOutput_eq(uint64_t a, uint64_t b) {
23508 LDKWatchedOutput a_conv;
23509 a_conv.inner = untag_ptr(a);
23510 a_conv.is_owned = ptr_is_owned(a);
23511 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23512 a_conv.is_owned = false;
23513 LDKWatchedOutput b_conv;
23514 b_conv.inner = untag_ptr(b);
23515 b_conv.is_owned = ptr_is_owned(b);
23516 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23517 b_conv.is_owned = false;
23518 jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
23522 int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
23523 LDKWatchedOutput o_conv;
23524 o_conv.inner = untag_ptr(o);
23525 o_conv.is_owned = ptr_is_owned(o);
23526 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23527 o_conv.is_owned = false;
23528 int64_t ret_conv = WatchedOutput_hash(&o_conv);
23532 void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint64_t this_ptr) {
23533 if (!ptr_is_owned(this_ptr)) return;
23534 void* this_ptr_ptr = untag_ptr(this_ptr);
23535 CHECK_ACCESS(this_ptr_ptr);
23536 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
23537 FREE(untag_ptr(this_ptr));
23538 BroadcasterInterface_free(this_ptr_conv);
23541 uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) {
23542 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
23543 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv));
23547 uint32_t __attribute__((export_name("TS_ConfirmationTarget_background"))) TS_ConfirmationTarget_background() {
23548 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
23552 uint32_t __attribute__((export_name("TS_ConfirmationTarget_normal"))) TS_ConfirmationTarget_normal() {
23553 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
23557 uint32_t __attribute__((export_name("TS_ConfirmationTarget_high_priority"))) TS_ConfirmationTarget_high_priority() {
23558 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
23562 jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
23563 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
23564 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
23565 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
23569 void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) {
23570 if (!ptr_is_owned(this_ptr)) return;
23571 void* this_ptr_ptr = untag_ptr(this_ptr);
23572 CHECK_ACCESS(this_ptr_ptr);
23573 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
23574 FREE(untag_ptr(this_ptr));
23575 FeeEstimator_free(this_ptr_conv);
23578 void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) {
23579 LDKMonitorUpdateId this_obj_conv;
23580 this_obj_conv.inner = untag_ptr(this_obj);
23581 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23583 MonitorUpdateId_free(this_obj_conv);
23586 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
23587 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
23588 uint64_t ret_ref = 0;
23589 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23590 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23593 int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) {
23594 LDKMonitorUpdateId arg_conv;
23595 arg_conv.inner = untag_ptr(arg);
23596 arg_conv.is_owned = ptr_is_owned(arg);
23597 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23598 arg_conv.is_owned = false;
23599 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
23603 uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) {
23604 LDKMonitorUpdateId orig_conv;
23605 orig_conv.inner = untag_ptr(orig);
23606 orig_conv.is_owned = ptr_is_owned(orig);
23607 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23608 orig_conv.is_owned = false;
23609 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
23610 uint64_t ret_ref = 0;
23611 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23612 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23616 int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) {
23617 LDKMonitorUpdateId o_conv;
23618 o_conv.inner = untag_ptr(o);
23619 o_conv.is_owned = ptr_is_owned(o);
23620 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23621 o_conv.is_owned = false;
23622 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
23626 jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) {
23627 LDKMonitorUpdateId a_conv;
23628 a_conv.inner = untag_ptr(a);
23629 a_conv.is_owned = ptr_is_owned(a);
23630 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23631 a_conv.is_owned = false;
23632 LDKMonitorUpdateId b_conv;
23633 b_conv.inner = untag_ptr(b);
23634 b_conv.is_owned = ptr_is_owned(b);
23635 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23636 b_conv.is_owned = false;
23637 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
23641 void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint64_t this_ptr) {
23642 if (!ptr_is_owned(this_ptr)) return;
23643 void* this_ptr_ptr = untag_ptr(this_ptr);
23644 CHECK_ACCESS(this_ptr_ptr);
23645 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
23646 FREE(untag_ptr(this_ptr));
23647 Persist_free(this_ptr_conv);
23650 void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) {
23651 LDKLockedChannelMonitor this_obj_conv;
23652 this_obj_conv.inner = untag_ptr(this_obj);
23653 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23655 LockedChannelMonitor_free(this_obj_conv);
23658 void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) {
23659 LDKChainMonitor this_obj_conv;
23660 this_obj_conv.inner = untag_ptr(this_obj);
23661 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23663 ChainMonitor_free(this_obj_conv);
23666 uint64_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_new(uint64_t chain_source, uint64_t broadcaster, uint64_t logger, uint64_t feeest, uint64_t persister) {
23667 void* chain_source_ptr = untag_ptr(chain_source);
23668 CHECK_ACCESS(chain_source_ptr);
23669 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
23670 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
23671 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
23672 // Manually implement clone for Java trait instances
23673 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
23674 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23675 LDKFilter_JCalls_cloned(&chain_source_conv.some);
23678 void* broadcaster_ptr = untag_ptr(broadcaster);
23679 CHECK_ACCESS(broadcaster_ptr);
23680 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23681 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23682 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23683 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23685 void* logger_ptr = untag_ptr(logger);
23686 CHECK_ACCESS(logger_ptr);
23687 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23688 if (logger_conv.free == LDKLogger_JCalls_free) {
23689 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23690 LDKLogger_JCalls_cloned(&logger_conv);
23692 void* feeest_ptr = untag_ptr(feeest);
23693 CHECK_ACCESS(feeest_ptr);
23694 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
23695 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
23696 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23697 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
23699 void* persister_ptr = untag_ptr(persister);
23700 CHECK_ACCESS(persister_ptr);
23701 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
23702 if (persister_conv.free == LDKPersist_JCalls_free) {
23703 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23704 LDKPersist_JCalls_cloned(&persister_conv);
23706 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
23707 uint64_t ret_ref = 0;
23708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23713 uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) {
23714 LDKChainMonitor this_arg_conv;
23715 this_arg_conv.inner = untag_ptr(this_arg);
23716 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23718 this_arg_conv.is_owned = false;
23719 LDKCVec_ChannelDetailsZ ignored_channels_constr;
23720 ignored_channels_constr.datalen = ignored_channels->arr_len;
23721 if (ignored_channels_constr.datalen > 0)
23722 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
23724 ignored_channels_constr.data = NULL;
23725 uint64_t* ignored_channels_vals = ignored_channels->elems;
23726 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
23727 uint64_t ignored_channels_conv_16 = ignored_channels_vals[q];
23728 LDKChannelDetails ignored_channels_conv_16_conv;
23729 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
23730 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
23731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
23732 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
23733 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
23735 FREE(ignored_channels);
23736 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
23737 uint64_tArray ret_arr = NULL;
23738 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23739 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23740 for (size_t j = 0; j < ret_var.datalen; j++) {
23741 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23742 *ret_conv_9_copy = ret_var.data[j];
23743 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
23744 ret_arr_ptr[j] = ret_conv_9_ref;
23747 FREE(ret_var.data);
23751 uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) {
23752 LDKChainMonitor this_arg_conv;
23753 this_arg_conv.inner = untag_ptr(this_arg);
23754 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23756 this_arg_conv.is_owned = false;
23757 LDKOutPoint funding_txo_conv;
23758 funding_txo_conv.inner = untag_ptr(funding_txo);
23759 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23760 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23761 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23762 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
23763 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
23764 return tag_ptr(ret_conv, true);
23767 uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) {
23768 LDKChainMonitor this_arg_conv;
23769 this_arg_conv.inner = untag_ptr(this_arg);
23770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23772 this_arg_conv.is_owned = false;
23773 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
23774 uint64_tArray ret_arr = NULL;
23775 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23776 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23777 for (size_t k = 0; k < ret_var.datalen; k++) {
23778 LDKOutPoint ret_conv_10_var = ret_var.data[k];
23779 uint64_t ret_conv_10_ref = 0;
23780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
23781 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
23782 ret_arr_ptr[k] = ret_conv_10_ref;
23785 FREE(ret_var.data);
23789 uint64_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated"))) TS_ChainMonitor_channel_monitor_updated(uint64_t this_arg, uint64_t funding_txo, uint64_t completed_update_id) {
23790 LDKChainMonitor this_arg_conv;
23791 this_arg_conv.inner = untag_ptr(this_arg);
23792 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23794 this_arg_conv.is_owned = false;
23795 LDKOutPoint funding_txo_conv;
23796 funding_txo_conv.inner = untag_ptr(funding_txo);
23797 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23798 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23799 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23800 LDKMonitorUpdateId completed_update_id_conv;
23801 completed_update_id_conv.inner = untag_ptr(completed_update_id);
23802 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
23803 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
23804 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
23805 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
23806 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
23807 return tag_ptr(ret_conv, true);
23810 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) {
23811 LDKChainMonitor this_arg_conv;
23812 this_arg_conv.inner = untag_ptr(this_arg);
23813 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23815 this_arg_conv.is_owned = false;
23816 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
23817 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
23818 return tag_ptr(ret_ret, true);
23821 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint64_t this_arg) {
23822 LDKChainMonitor this_arg_conv;
23823 this_arg_conv.inner = untag_ptr(this_arg);
23824 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23826 this_arg_conv.is_owned = false;
23827 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
23828 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
23829 return tag_ptr(ret_ret, true);
23832 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint64_t this_arg) {
23833 LDKChainMonitor this_arg_conv;
23834 this_arg_conv.inner = untag_ptr(this_arg);
23835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23837 this_arg_conv.is_owned = false;
23838 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
23839 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
23840 return tag_ptr(ret_ret, true);
23843 uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) {
23844 LDKChainMonitor this_arg_conv;
23845 this_arg_conv.inner = untag_ptr(this_arg);
23846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23848 this_arg_conv.is_owned = false;
23849 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
23850 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
23851 return tag_ptr(ret_ret, true);
23854 void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) {
23855 LDKChannelMonitorUpdate this_obj_conv;
23856 this_obj_conv.inner = untag_ptr(this_obj);
23857 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23859 ChannelMonitorUpdate_free(this_obj_conv);
23862 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) {
23863 LDKChannelMonitorUpdate this_ptr_conv;
23864 this_ptr_conv.inner = untag_ptr(this_ptr);
23865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23867 this_ptr_conv.is_owned = false;
23868 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
23872 void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) {
23873 LDKChannelMonitorUpdate this_ptr_conv;
23874 this_ptr_conv.inner = untag_ptr(this_ptr);
23875 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23877 this_ptr_conv.is_owned = false;
23878 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
23881 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
23882 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
23883 uint64_t ret_ref = 0;
23884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23888 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) {
23889 LDKChannelMonitorUpdate arg_conv;
23890 arg_conv.inner = untag_ptr(arg);
23891 arg_conv.is_owned = ptr_is_owned(arg);
23892 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23893 arg_conv.is_owned = false;
23894 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
23898 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) {
23899 LDKChannelMonitorUpdate orig_conv;
23900 orig_conv.inner = untag_ptr(orig);
23901 orig_conv.is_owned = ptr_is_owned(orig);
23902 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23903 orig_conv.is_owned = false;
23904 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
23905 uint64_t ret_ref = 0;
23906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23911 int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) {
23912 LDKChannelMonitorUpdate obj_conv;
23913 obj_conv.inner = untag_ptr(obj);
23914 obj_conv.is_owned = ptr_is_owned(obj);
23915 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23916 obj_conv.is_owned = false;
23917 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
23918 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23919 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23920 CVec_u8Z_free(ret_var);
23924 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
23925 LDKu8slice ser_ref;
23926 ser_ref.datalen = ser->arr_len;
23927 ser_ref.data = ser->elems;
23928 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
23929 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
23931 return tag_ptr(ret_conv, true);
23934 void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint64_t this_ptr) {
23935 if (!ptr_is_owned(this_ptr)) return;
23936 void* this_ptr_ptr = untag_ptr(this_ptr);
23937 CHECK_ACCESS(this_ptr_ptr);
23938 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
23939 FREE(untag_ptr(this_ptr));
23940 MonitorEvent_free(this_ptr_conv);
23943 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
23944 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23945 *ret_copy = MonitorEvent_clone(arg);
23946 uint64_t ret_ref = tag_ptr(ret_copy, true);
23949 int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) {
23950 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
23951 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
23955 uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) {
23956 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
23957 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23958 *ret_copy = MonitorEvent_clone(orig_conv);
23959 uint64_t ret_ref = tag_ptr(ret_copy, true);
23963 uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) {
23964 LDKHTLCUpdate a_conv;
23965 a_conv.inner = untag_ptr(a);
23966 a_conv.is_owned = ptr_is_owned(a);
23967 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23968 a_conv = HTLCUpdate_clone(&a_conv);
23969 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23970 *ret_copy = MonitorEvent_htlcevent(a_conv);
23971 uint64_t ret_ref = tag_ptr(ret_copy, true);
23975 uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed"))) TS_MonitorEvent_commitment_tx_confirmed(uint64_t a) {
23976 LDKOutPoint a_conv;
23977 a_conv.inner = untag_ptr(a);
23978 a_conv.is_owned = ptr_is_owned(a);
23979 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23980 a_conv = OutPoint_clone(&a_conv);
23981 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23982 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
23983 uint64_t ret_ref = tag_ptr(ret_copy, true);
23987 uint64_t __attribute__((export_name("TS_MonitorEvent_completed"))) TS_MonitorEvent_completed(uint64_t funding_txo, int64_t monitor_update_id) {
23988 LDKOutPoint funding_txo_conv;
23989 funding_txo_conv.inner = untag_ptr(funding_txo);
23990 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23991 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23992 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23993 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23994 *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
23995 uint64_t ret_ref = tag_ptr(ret_copy, true);
23999 uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_MonitorEvent_update_failed(uint64_t a) {
24000 LDKOutPoint a_conv;
24001 a_conv.inner = untag_ptr(a);
24002 a_conv.is_owned = ptr_is_owned(a);
24003 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
24004 a_conv = OutPoint_clone(&a_conv);
24005 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
24006 *ret_copy = MonitorEvent_update_failed(a_conv);
24007 uint64_t ret_ref = tag_ptr(ret_copy, true);
24011 jboolean __attribute__((export_name("TS_MonitorEvent_eq"))) TS_MonitorEvent_eq(uint64_t a, uint64_t b) {
24012 LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
24013 LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
24014 jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
24018 int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
24019 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
24020 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
24021 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24022 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24023 CVec_u8Z_free(ret_var);
24027 uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
24028 LDKu8slice ser_ref;
24029 ser_ref.datalen = ser->arr_len;
24030 ser_ref.data = ser->elems;
24031 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
24032 *ret_conv = MonitorEvent_read(ser_ref);
24034 return tag_ptr(ret_conv, true);
24037 void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) {
24038 LDKHTLCUpdate this_obj_conv;
24039 this_obj_conv.inner = untag_ptr(this_obj);
24040 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24042 HTLCUpdate_free(this_obj_conv);
24045 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
24046 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
24047 uint64_t ret_ref = 0;
24048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24052 int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) {
24053 LDKHTLCUpdate arg_conv;
24054 arg_conv.inner = untag_ptr(arg);
24055 arg_conv.is_owned = ptr_is_owned(arg);
24056 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24057 arg_conv.is_owned = false;
24058 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
24062 uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) {
24063 LDKHTLCUpdate orig_conv;
24064 orig_conv.inner = untag_ptr(orig);
24065 orig_conv.is_owned = ptr_is_owned(orig);
24066 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24067 orig_conv.is_owned = false;
24068 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
24069 uint64_t ret_ref = 0;
24070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24075 jboolean __attribute__((export_name("TS_HTLCUpdate_eq"))) TS_HTLCUpdate_eq(uint64_t a, uint64_t b) {
24076 LDKHTLCUpdate a_conv;
24077 a_conv.inner = untag_ptr(a);
24078 a_conv.is_owned = ptr_is_owned(a);
24079 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
24080 a_conv.is_owned = false;
24081 LDKHTLCUpdate b_conv;
24082 b_conv.inner = untag_ptr(b);
24083 b_conv.is_owned = ptr_is_owned(b);
24084 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
24085 b_conv.is_owned = false;
24086 jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
24090 int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
24091 LDKHTLCUpdate obj_conv;
24092 obj_conv.inner = untag_ptr(obj);
24093 obj_conv.is_owned = ptr_is_owned(obj);
24094 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24095 obj_conv.is_owned = false;
24096 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
24097 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24098 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24099 CVec_u8Z_free(ret_var);
24103 uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
24104 LDKu8slice ser_ref;
24105 ser_ref.datalen = ser->arr_len;
24106 ser_ref.data = ser->elems;
24107 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
24108 *ret_conv = HTLCUpdate_read(ser_ref);
24110 return tag_ptr(ret_conv, true);
24113 void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint64_t this_ptr) {
24114 if (!ptr_is_owned(this_ptr)) return;
24115 void* this_ptr_ptr = untag_ptr(this_ptr);
24116 CHECK_ACCESS(this_ptr_ptr);
24117 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
24118 FREE(untag_ptr(this_ptr));
24119 Balance_free(this_ptr_conv);
24122 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
24123 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24124 *ret_copy = Balance_clone(arg);
24125 uint64_t ret_ref = tag_ptr(ret_copy, true);
24128 int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) {
24129 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
24130 int64_t ret_conv = Balance_clone_ptr(arg_conv);
24134 uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) {
24135 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
24136 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24137 *ret_copy = Balance_clone(orig_conv);
24138 uint64_t ret_ref = tag_ptr(ret_copy, true);
24142 uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) {
24143 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24144 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
24145 uint64_t ret_ref = tag_ptr(ret_copy, true);
24149 uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) {
24150 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24151 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
24152 uint64_t ret_ref = tag_ptr(ret_copy, true);
24156 uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) {
24157 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24158 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
24159 uint64_t ret_ref = tag_ptr(ret_copy, true);
24163 uint64_t __attribute__((export_name("TS_Balance_maybe_timeout_claimable_htlc"))) TS_Balance_maybe_timeout_claimable_htlc(int64_t claimable_amount_satoshis, int32_t claimable_height) {
24164 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24165 *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
24166 uint64_t ret_ref = tag_ptr(ret_copy, true);
24170 uint64_t __attribute__((export_name("TS_Balance_maybe_preimage_claimable_htlc"))) TS_Balance_maybe_preimage_claimable_htlc(int64_t claimable_amount_satoshis, int32_t expiry_height) {
24171 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24172 *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
24173 uint64_t ret_ref = tag_ptr(ret_copy, true);
24177 uint64_t __attribute__((export_name("TS_Balance_counterparty_revoked_output_claimable"))) TS_Balance_counterparty_revoked_output_claimable(int64_t claimable_amount_satoshis) {
24178 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24179 *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
24180 uint64_t ret_ref = tag_ptr(ret_copy, true);
24184 jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) {
24185 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
24186 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
24187 jboolean ret_conv = Balance_eq(a_conv, b_conv);
24191 void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) {
24192 LDKChannelMonitor this_obj_conv;
24193 this_obj_conv.inner = untag_ptr(this_obj);
24194 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24196 ChannelMonitor_free(this_obj_conv);
24199 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
24200 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
24201 uint64_t ret_ref = 0;
24202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24206 int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) {
24207 LDKChannelMonitor arg_conv;
24208 arg_conv.inner = untag_ptr(arg);
24209 arg_conv.is_owned = ptr_is_owned(arg);
24210 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24211 arg_conv.is_owned = false;
24212 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
24216 uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) {
24217 LDKChannelMonitor orig_conv;
24218 orig_conv.inner = untag_ptr(orig);
24219 orig_conv.is_owned = ptr_is_owned(orig);
24220 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24221 orig_conv.is_owned = false;
24222 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
24223 uint64_t ret_ref = 0;
24224 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24225 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24229 int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) {
24230 LDKChannelMonitor obj_conv;
24231 obj_conv.inner = untag_ptr(obj);
24232 obj_conv.is_owned = ptr_is_owned(obj);
24233 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24234 obj_conv.is_owned = false;
24235 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
24236 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24237 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24238 CVec_u8Z_free(ret_var);
24242 uint64_t __attribute__((export_name("TS_ChannelMonitor_update_monitor"))) TS_ChannelMonitor_update_monitor(uint64_t this_arg, uint64_t updates, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24243 LDKChannelMonitor this_arg_conv;
24244 this_arg_conv.inner = untag_ptr(this_arg);
24245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24247 this_arg_conv.is_owned = false;
24248 LDKChannelMonitorUpdate updates_conv;
24249 updates_conv.inner = untag_ptr(updates);
24250 updates_conv.is_owned = ptr_is_owned(updates);
24251 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
24252 updates_conv.is_owned = false;
24253 void* broadcaster_ptr = untag_ptr(broadcaster);
24254 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
24255 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
24256 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24257 CHECK_ACCESS(fee_estimator_ptr);
24258 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24259 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24260 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24261 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24263 void* logger_ptr = untag_ptr(logger);
24264 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
24265 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
24266 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
24267 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
24268 return tag_ptr(ret_conv, true);
24271 int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) {
24272 LDKChannelMonitor this_arg_conv;
24273 this_arg_conv.inner = untag_ptr(this_arg);
24274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24276 this_arg_conv.is_owned = false;
24277 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
24281 uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) {
24282 LDKChannelMonitor this_arg_conv;
24283 this_arg_conv.inner = untag_ptr(this_arg);
24284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24286 this_arg_conv.is_owned = false;
24287 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
24288 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
24289 return tag_ptr(ret_conv, true);
24292 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) {
24293 LDKChannelMonitor this_arg_conv;
24294 this_arg_conv.inner = untag_ptr(this_arg);
24295 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24297 this_arg_conv.is_owned = false;
24298 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
24299 uint64_tArray ret_arr = NULL;
24300 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24301 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24302 for (size_t o = 0; o < ret_var.datalen; o++) {
24303 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
24304 *ret_conv_40_conv = ret_var.data[o];
24305 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
24308 FREE(ret_var.data);
24312 void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter) {
24313 LDKChannelMonitor this_arg_conv;
24314 this_arg_conv.inner = untag_ptr(this_arg);
24315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24317 this_arg_conv.is_owned = false;
24318 void* filter_ptr = untag_ptr(filter);
24319 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
24320 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
24321 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
24324 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_monitor_events"))) TS_ChannelMonitor_get_and_clear_pending_monitor_events(uint64_t this_arg) {
24325 LDKChannelMonitor this_arg_conv;
24326 this_arg_conv.inner = untag_ptr(this_arg);
24327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24329 this_arg_conv.is_owned = false;
24330 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
24331 uint64_tArray ret_arr = NULL;
24332 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24333 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24334 for (size_t o = 0; o < ret_var.datalen; o++) {
24335 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
24336 *ret_conv_14_copy = ret_var.data[o];
24337 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
24338 ret_arr_ptr[o] = ret_conv_14_ref;
24341 FREE(ret_var.data);
24345 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_events"))) TS_ChannelMonitor_get_and_clear_pending_events(uint64_t this_arg) {
24346 LDKChannelMonitor this_arg_conv;
24347 this_arg_conv.inner = untag_ptr(this_arg);
24348 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24350 this_arg_conv.is_owned = false;
24351 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
24352 uint64_tArray ret_arr = NULL;
24353 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24354 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24355 for (size_t h = 0; h < ret_var.datalen; h++) {
24356 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
24357 *ret_conv_7_copy = ret_var.data[h];
24358 uint64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
24359 ret_arr_ptr[h] = ret_conv_7_ref;
24362 FREE(ret_var.data);
24366 int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) {
24367 LDKChannelMonitor this_arg_conv;
24368 this_arg_conv.inner = untag_ptr(this_arg);
24369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24371 this_arg_conv.is_owned = false;
24372 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24373 memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33);
24377 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_latest_holder_commitment_txn"))) TS_ChannelMonitor_get_latest_holder_commitment_txn(uint64_t this_arg, uint64_t logger) {
24378 LDKChannelMonitor this_arg_conv;
24379 this_arg_conv.inner = untag_ptr(this_arg);
24380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24382 this_arg_conv.is_owned = false;
24383 void* logger_ptr = untag_ptr(logger);
24384 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
24385 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
24386 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
24387 ptrArray ret_arr = NULL;
24388 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
24389 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
24390 for (size_t m = 0; m < ret_var.datalen; m++) {
24391 LDKTransaction ret_conv_12_var = ret_var.data[m];
24392 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
24393 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
24394 Transaction_free(ret_conv_12_var);
24395 ret_arr_ptr[m] = ret_conv_12_arr;
24398 FREE(ret_var.data);
24402 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) TS_ChannelMonitor_block_connected(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24403 LDKChannelMonitor this_arg_conv;
24404 this_arg_conv.inner = untag_ptr(this_arg);
24405 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24407 this_arg_conv.is_owned = false;
24408 unsigned char header_arr[80];
24409 CHECK(header->arr_len == 80);
24410 memcpy(header_arr, header->elems, 80); FREE(header);
24411 unsigned char (*header_ref)[80] = &header_arr;
24412 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
24413 txdata_constr.datalen = txdata->arr_len;
24414 if (txdata_constr.datalen > 0)
24415 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
24417 txdata_constr.data = NULL;
24418 uint64_t* txdata_vals = txdata->elems;
24419 for (size_t c = 0; c < txdata_constr.datalen; c++) {
24420 uint64_t txdata_conv_28 = txdata_vals[c];
24421 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
24422 CHECK_ACCESS(txdata_conv_28_ptr);
24423 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
24424 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
24425 txdata_constr.data[c] = txdata_conv_28_conv;
24428 void* broadcaster_ptr = untag_ptr(broadcaster);
24429 CHECK_ACCESS(broadcaster_ptr);
24430 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24431 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24432 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24433 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24435 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24436 CHECK_ACCESS(fee_estimator_ptr);
24437 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24438 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24439 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24440 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24442 void* logger_ptr = untag_ptr(logger);
24443 CHECK_ACCESS(logger_ptr);
24444 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24445 if (logger_conv.free == LDKLogger_JCalls_free) {
24446 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24447 LDKLogger_JCalls_cloned(&logger_conv);
24449 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);
24450 uint64_tArray ret_arr = NULL;
24451 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24452 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24453 for (size_t n = 0; n < ret_var.datalen; n++) {
24454 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24455 *ret_conv_39_conv = ret_var.data[n];
24456 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24459 FREE(ret_var.data);
24463 void __attribute__((export_name("TS_ChannelMonitor_block_disconnected"))) TS_ChannelMonitor_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24464 LDKChannelMonitor this_arg_conv;
24465 this_arg_conv.inner = untag_ptr(this_arg);
24466 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24468 this_arg_conv.is_owned = false;
24469 unsigned char header_arr[80];
24470 CHECK(header->arr_len == 80);
24471 memcpy(header_arr, header->elems, 80); FREE(header);
24472 unsigned char (*header_ref)[80] = &header_arr;
24473 void* broadcaster_ptr = untag_ptr(broadcaster);
24474 CHECK_ACCESS(broadcaster_ptr);
24475 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24476 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24477 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24478 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24480 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24481 CHECK_ACCESS(fee_estimator_ptr);
24482 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24483 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24484 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24485 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24487 void* logger_ptr = untag_ptr(logger);
24488 CHECK_ACCESS(logger_ptr);
24489 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24490 if (logger_conv.free == LDKLogger_JCalls_free) {
24491 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24492 LDKLogger_JCalls_cloned(&logger_conv);
24494 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
24497 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confirmed"))) TS_ChannelMonitor_transactions_confirmed(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24498 LDKChannelMonitor this_arg_conv;
24499 this_arg_conv.inner = untag_ptr(this_arg);
24500 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24502 this_arg_conv.is_owned = false;
24503 unsigned char header_arr[80];
24504 CHECK(header->arr_len == 80);
24505 memcpy(header_arr, header->elems, 80); FREE(header);
24506 unsigned char (*header_ref)[80] = &header_arr;
24507 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
24508 txdata_constr.datalen = txdata->arr_len;
24509 if (txdata_constr.datalen > 0)
24510 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
24512 txdata_constr.data = NULL;
24513 uint64_t* txdata_vals = txdata->elems;
24514 for (size_t c = 0; c < txdata_constr.datalen; c++) {
24515 uint64_t txdata_conv_28 = txdata_vals[c];
24516 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
24517 CHECK_ACCESS(txdata_conv_28_ptr);
24518 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
24519 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
24520 txdata_constr.data[c] = txdata_conv_28_conv;
24523 void* broadcaster_ptr = untag_ptr(broadcaster);
24524 CHECK_ACCESS(broadcaster_ptr);
24525 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24526 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24527 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24528 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24530 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24531 CHECK_ACCESS(fee_estimator_ptr);
24532 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24533 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24534 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24535 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24537 void* logger_ptr = untag_ptr(logger);
24538 CHECK_ACCESS(logger_ptr);
24539 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24540 if (logger_conv.free == LDKLogger_JCalls_free) {
24541 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24542 LDKLogger_JCalls_cloned(&logger_conv);
24544 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);
24545 uint64_tArray ret_arr = NULL;
24546 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24547 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24548 for (size_t n = 0; n < ret_var.datalen; n++) {
24549 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24550 *ret_conv_39_conv = ret_var.data[n];
24551 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24554 FREE(ret_var.data);
24558 void __attribute__((export_name("TS_ChannelMonitor_transaction_unconfirmed"))) TS_ChannelMonitor_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24559 LDKChannelMonitor this_arg_conv;
24560 this_arg_conv.inner = untag_ptr(this_arg);
24561 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24563 this_arg_conv.is_owned = false;
24564 unsigned char txid_arr[32];
24565 CHECK(txid->arr_len == 32);
24566 memcpy(txid_arr, txid->elems, 32); FREE(txid);
24567 unsigned char (*txid_ref)[32] = &txid_arr;
24568 void* broadcaster_ptr = untag_ptr(broadcaster);
24569 CHECK_ACCESS(broadcaster_ptr);
24570 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24571 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24572 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24573 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24575 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24576 CHECK_ACCESS(fee_estimator_ptr);
24577 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24578 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24579 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24580 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24582 void* logger_ptr = untag_ptr(logger);
24583 CHECK_ACCESS(logger_ptr);
24584 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24585 if (logger_conv.free == LDKLogger_JCalls_free) {
24586 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24587 LDKLogger_JCalls_cloned(&logger_conv);
24589 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
24592 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_best_block_updated"))) TS_ChannelMonitor_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) {
24593 LDKChannelMonitor this_arg_conv;
24594 this_arg_conv.inner = untag_ptr(this_arg);
24595 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24597 this_arg_conv.is_owned = false;
24598 unsigned char header_arr[80];
24599 CHECK(header->arr_len == 80);
24600 memcpy(header_arr, header->elems, 80); FREE(header);
24601 unsigned char (*header_ref)[80] = &header_arr;
24602 void* broadcaster_ptr = untag_ptr(broadcaster);
24603 CHECK_ACCESS(broadcaster_ptr);
24604 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24605 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24606 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24607 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24609 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24610 CHECK_ACCESS(fee_estimator_ptr);
24611 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24612 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24613 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24614 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24616 void* logger_ptr = untag_ptr(logger);
24617 CHECK_ACCESS(logger_ptr);
24618 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24619 if (logger_conv.free == LDKLogger_JCalls_free) {
24620 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24621 LDKLogger_JCalls_cloned(&logger_conv);
24623 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
24624 uint64_tArray ret_arr = NULL;
24625 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24626 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24627 for (size_t n = 0; n < ret_var.datalen; n++) {
24628 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24629 *ret_conv_39_conv = ret_var.data[n];
24630 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24633 FREE(ret_var.data);
24637 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
24638 LDKChannelMonitor this_arg_conv;
24639 this_arg_conv.inner = untag_ptr(this_arg);
24640 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24642 this_arg_conv.is_owned = false;
24643 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
24644 ptrArray ret_arr = NULL;
24645 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
24646 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
24647 for (size_t m = 0; m < ret_var.datalen; m++) {
24648 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
24649 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
24650 ret_arr_ptr[m] = ret_conv_12_arr;
24653 FREE(ret_var.data);
24657 uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) {
24658 LDKChannelMonitor this_arg_conv;
24659 this_arg_conv.inner = untag_ptr(this_arg);
24660 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24662 this_arg_conv.is_owned = false;
24663 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
24664 uint64_t ret_ref = 0;
24665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24670 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) {
24671 LDKChannelMonitor this_arg_conv;
24672 this_arg_conv.inner = untag_ptr(this_arg);
24673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24675 this_arg_conv.is_owned = false;
24676 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
24677 uint64_tArray ret_arr = NULL;
24678 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24679 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24680 for (size_t j = 0; j < ret_var.datalen; j++) {
24681 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24682 *ret_conv_9_copy = ret_var.data[j];
24683 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
24684 ret_arr_ptr[j] = ret_conv_9_ref;
24687 FREE(ret_var.data);
24691 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
24692 LDKu8slice ser_ref;
24693 ser_ref.datalen = ser->arr_len;
24694 ser_ref.data = ser->elems;
24695 void* arg_ptr = untag_ptr(arg);
24696 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
24697 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
24698 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
24699 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
24701 return tag_ptr(ret_conv, true);
24704 void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) {
24705 LDKOutPoint this_obj_conv;
24706 this_obj_conv.inner = untag_ptr(this_obj);
24707 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24709 OutPoint_free(this_obj_conv);
24712 int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) {
24713 LDKOutPoint this_ptr_conv;
24714 this_ptr_conv.inner = untag_ptr(this_ptr);
24715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24717 this_ptr_conv.is_owned = false;
24718 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24719 memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32);
24723 void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) {
24724 LDKOutPoint this_ptr_conv;
24725 this_ptr_conv.inner = untag_ptr(this_ptr);
24726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24728 this_ptr_conv.is_owned = false;
24729 LDKThirtyTwoBytes val_ref;
24730 CHECK(val->arr_len == 32);
24731 memcpy(val_ref.data, val->elems, 32); FREE(val);
24732 OutPoint_set_txid(&this_ptr_conv, val_ref);
24735 int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) {
24736 LDKOutPoint this_ptr_conv;
24737 this_ptr_conv.inner = untag_ptr(this_ptr);
24738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24740 this_ptr_conv.is_owned = false;
24741 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
24745 void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) {
24746 LDKOutPoint this_ptr_conv;
24747 this_ptr_conv.inner = untag_ptr(this_ptr);
24748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24750 this_ptr_conv.is_owned = false;
24751 OutPoint_set_index(&this_ptr_conv, val);
24754 uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
24755 LDKThirtyTwoBytes txid_arg_ref;
24756 CHECK(txid_arg->arr_len == 32);
24757 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
24758 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
24759 uint64_t ret_ref = 0;
24760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24765 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
24766 LDKOutPoint ret_var = OutPoint_clone(arg);
24767 uint64_t ret_ref = 0;
24768 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24769 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24772 int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) {
24773 LDKOutPoint arg_conv;
24774 arg_conv.inner = untag_ptr(arg);
24775 arg_conv.is_owned = ptr_is_owned(arg);
24776 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24777 arg_conv.is_owned = false;
24778 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
24782 uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) {
24783 LDKOutPoint orig_conv;
24784 orig_conv.inner = untag_ptr(orig);
24785 orig_conv.is_owned = ptr_is_owned(orig);
24786 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24787 orig_conv.is_owned = false;
24788 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
24789 uint64_t ret_ref = 0;
24790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24795 jboolean __attribute__((export_name("TS_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) {
24796 LDKOutPoint a_conv;
24797 a_conv.inner = untag_ptr(a);
24798 a_conv.is_owned = ptr_is_owned(a);
24799 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
24800 a_conv.is_owned = false;
24801 LDKOutPoint b_conv;
24802 b_conv.inner = untag_ptr(b);
24803 b_conv.is_owned = ptr_is_owned(b);
24804 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
24805 b_conv.is_owned = false;
24806 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
24810 int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) {
24811 LDKOutPoint o_conv;
24812 o_conv.inner = untag_ptr(o);
24813 o_conv.is_owned = ptr_is_owned(o);
24814 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24815 o_conv.is_owned = false;
24816 int64_t ret_conv = OutPoint_hash(&o_conv);
24820 int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) {
24821 LDKOutPoint this_arg_conv;
24822 this_arg_conv.inner = untag_ptr(this_arg);
24823 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24825 this_arg_conv.is_owned = false;
24826 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24827 memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32);
24831 int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) {
24832 LDKOutPoint obj_conv;
24833 obj_conv.inner = untag_ptr(obj);
24834 obj_conv.is_owned = ptr_is_owned(obj);
24835 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24836 obj_conv.is_owned = false;
24837 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
24838 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24839 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24840 CVec_u8Z_free(ret_var);
24844 uint64_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
24845 LDKu8slice ser_ref;
24846 ser_ref.datalen = ser->arr_len;
24847 ser_ref.data = ser->elems;
24848 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
24849 *ret_conv = OutPoint_read(ser_ref);
24851 return tag_ptr(ret_conv, true);
24854 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint64_t this_obj) {
24855 LDKDelayedPaymentOutputDescriptor this_obj_conv;
24856 this_obj_conv.inner = untag_ptr(this_obj);
24857 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24859 DelayedPaymentOutputDescriptor_free(this_obj_conv);
24862 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outpoint"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
24863 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24864 this_ptr_conv.inner = untag_ptr(this_ptr);
24865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24867 this_ptr_conv.is_owned = false;
24868 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
24869 uint64_t ret_ref = 0;
24870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24875 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_outpoint"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
24876 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24877 this_ptr_conv.inner = untag_ptr(this_ptr);
24878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24880 this_ptr_conv.is_owned = false;
24881 LDKOutPoint val_conv;
24882 val_conv.inner = untag_ptr(val);
24883 val_conv.is_owned = ptr_is_owned(val);
24884 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24885 val_conv = OutPoint_clone(&val_conv);
24886 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
24889 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint64_t this_ptr) {
24890 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24891 this_ptr_conv.inner = untag_ptr(this_ptr);
24892 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24894 this_ptr_conv.is_owned = false;
24895 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24896 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
24900 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
24901 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24902 this_ptr_conv.inner = untag_ptr(this_ptr);
24903 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24905 this_ptr_conv.is_owned = false;
24906 LDKPublicKey val_ref;
24907 CHECK(val->arr_len == 33);
24908 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24909 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
24912 int16_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint64_t this_ptr) {
24913 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24914 this_ptr_conv.inner = untag_ptr(this_ptr);
24915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24917 this_ptr_conv.is_owned = false;
24918 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
24922 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint64_t this_ptr, int16_t val) {
24923 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24924 this_ptr_conv.inner = untag_ptr(this_ptr);
24925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24927 this_ptr_conv.is_owned = false;
24928 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
24931 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_output"))) TS_DelayedPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
24932 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24933 this_ptr_conv.inner = untag_ptr(this_ptr);
24934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24936 this_ptr_conv.is_owned = false;
24937 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
24938 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
24939 return tag_ptr(ret_ref, true);
24942 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output"))) TS_DelayedPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
24943 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24944 this_ptr_conv.inner = untag_ptr(this_ptr);
24945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24947 this_ptr_conv.is_owned = false;
24948 void* val_ptr = untag_ptr(val);
24949 CHECK_ACCESS(val_ptr);
24950 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
24951 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
24952 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
24955 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint64_t this_ptr) {
24956 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24957 this_ptr_conv.inner = untag_ptr(this_ptr);
24958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24960 this_ptr_conv.is_owned = false;
24961 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24962 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
24966 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint64_t this_ptr, int8_tArray val) {
24967 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24968 this_ptr_conv.inner = untag_ptr(this_ptr);
24969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24971 this_ptr_conv.is_owned = false;
24972 LDKPublicKey val_ref;
24973 CHECK(val->arr_len == 33);
24974 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24975 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
24978 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
24979 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24980 this_ptr_conv.inner = untag_ptr(this_ptr);
24981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24983 this_ptr_conv.is_owned = false;
24984 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24985 memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
24989 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
24990 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24991 this_ptr_conv.inner = untag_ptr(this_ptr);
24992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24994 this_ptr_conv.is_owned = false;
24995 LDKThirtyTwoBytes val_ref;
24996 CHECK(val->arr_len == 32);
24997 memcpy(val_ref.data, val->elems, 32); FREE(val);
24998 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
25001 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
25002 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
25003 this_ptr_conv.inner = untag_ptr(this_ptr);
25004 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25006 this_ptr_conv.is_owned = false;
25007 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
25011 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
25012 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
25013 this_ptr_conv.inner = untag_ptr(this_ptr);
25014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25016 this_ptr_conv.is_owned = false;
25017 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
25020 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) TS_DelayedPaymentOutputDescriptor_new(uint64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, uint64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
25021 LDKOutPoint outpoint_arg_conv;
25022 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
25023 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
25024 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
25025 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
25026 LDKPublicKey per_commitment_point_arg_ref;
25027 CHECK(per_commitment_point_arg->arr_len == 33);
25028 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
25029 void* output_arg_ptr = untag_ptr(output_arg);
25030 CHECK_ACCESS(output_arg_ptr);
25031 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
25032 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
25033 LDKPublicKey revocation_pubkey_arg_ref;
25034 CHECK(revocation_pubkey_arg->arr_len == 33);
25035 memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg);
25036 LDKThirtyTwoBytes channel_keys_id_arg_ref;
25037 CHECK(channel_keys_id_arg->arr_len == 32);
25038 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
25039 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);
25040 uint64_t ret_ref = 0;
25041 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25042 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25046 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
25047 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
25048 uint64_t ret_ref = 0;
25049 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25050 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25053 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
25054 LDKDelayedPaymentOutputDescriptor arg_conv;
25055 arg_conv.inner = untag_ptr(arg);
25056 arg_conv.is_owned = ptr_is_owned(arg);
25057 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25058 arg_conv.is_owned = false;
25059 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
25063 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone"))) TS_DelayedPaymentOutputDescriptor_clone(uint64_t orig) {
25064 LDKDelayedPaymentOutputDescriptor orig_conv;
25065 orig_conv.inner = untag_ptr(orig);
25066 orig_conv.is_owned = ptr_is_owned(orig);
25067 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25068 orig_conv.is_owned = false;
25069 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
25070 uint64_t ret_ref = 0;
25071 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25072 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25076 jboolean __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_eq"))) TS_DelayedPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) {
25077 LDKDelayedPaymentOutputDescriptor a_conv;
25078 a_conv.inner = untag_ptr(a);
25079 a_conv.is_owned = ptr_is_owned(a);
25080 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25081 a_conv.is_owned = false;
25082 LDKDelayedPaymentOutputDescriptor b_conv;
25083 b_conv.inner = untag_ptr(b);
25084 b_conv.is_owned = ptr_is_owned(b);
25085 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
25086 b_conv.is_owned = false;
25087 jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
25091 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
25092 LDKDelayedPaymentOutputDescriptor obj_conv;
25093 obj_conv.inner = untag_ptr(obj);
25094 obj_conv.is_owned = ptr_is_owned(obj);
25095 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
25096 obj_conv.is_owned = false;
25097 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
25098 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25099 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25100 CVec_u8Z_free(ret_var);
25104 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
25105 LDKu8slice ser_ref;
25106 ser_ref.datalen = ser->arr_len;
25107 ser_ref.data = ser->elems;
25108 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
25109 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
25111 return tag_ptr(ret_conv, true);
25114 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint64_t this_obj) {
25115 LDKStaticPaymentOutputDescriptor this_obj_conv;
25116 this_obj_conv.inner = untag_ptr(this_obj);
25117 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25119 StaticPaymentOutputDescriptor_free(this_obj_conv);
25122 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpoint"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
25123 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25124 this_ptr_conv.inner = untag_ptr(this_ptr);
25125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25127 this_ptr_conv.is_owned = false;
25128 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
25129 uint64_t ret_ref = 0;
25130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25135 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_outpoint"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
25136 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25137 this_ptr_conv.inner = untag_ptr(this_ptr);
25138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25140 this_ptr_conv.is_owned = false;
25141 LDKOutPoint val_conv;
25142 val_conv.inner = untag_ptr(val);
25143 val_conv.is_owned = ptr_is_owned(val);
25144 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25145 val_conv = OutPoint_clone(&val_conv);
25146 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
25149 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_output"))) TS_StaticPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
25150 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25151 this_ptr_conv.inner = untag_ptr(this_ptr);
25152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25154 this_ptr_conv.is_owned = false;
25155 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
25156 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
25157 return tag_ptr(ret_ref, true);
25160 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output"))) TS_StaticPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
25161 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25162 this_ptr_conv.inner = untag_ptr(this_ptr);
25163 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25165 this_ptr_conv.is_owned = false;
25166 void* val_ptr = untag_ptr(val);
25167 CHECK_ACCESS(val_ptr);
25168 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
25169 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
25170 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
25173 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
25174 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25175 this_ptr_conv.inner = untag_ptr(this_ptr);
25176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25178 this_ptr_conv.is_owned = false;
25179 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25180 memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
25184 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
25185 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25186 this_ptr_conv.inner = untag_ptr(this_ptr);
25187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25189 this_ptr_conv.is_owned = false;
25190 LDKThirtyTwoBytes val_ref;
25191 CHECK(val->arr_len == 32);
25192 memcpy(val_ref.data, val->elems, 32); FREE(val);
25193 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
25196 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
25197 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25198 this_ptr_conv.inner = untag_ptr(this_ptr);
25199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25201 this_ptr_conv.is_owned = false;
25202 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
25206 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
25207 LDKStaticPaymentOutputDescriptor this_ptr_conv;
25208 this_ptr_conv.inner = untag_ptr(this_ptr);
25209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25211 this_ptr_conv.is_owned = false;
25212 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
25215 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_new"))) TS_StaticPaymentOutputDescriptor_new(uint64_t outpoint_arg, uint64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
25216 LDKOutPoint outpoint_arg_conv;
25217 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
25218 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
25219 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
25220 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
25221 void* output_arg_ptr = untag_ptr(output_arg);
25222 CHECK_ACCESS(output_arg_ptr);
25223 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
25224 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
25225 LDKThirtyTwoBytes channel_keys_id_arg_ref;
25226 CHECK(channel_keys_id_arg->arr_len == 32);
25227 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
25228 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
25229 uint64_t ret_ref = 0;
25230 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25231 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25235 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
25236 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
25237 uint64_t ret_ref = 0;
25238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25242 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
25243 LDKStaticPaymentOutputDescriptor arg_conv;
25244 arg_conv.inner = untag_ptr(arg);
25245 arg_conv.is_owned = ptr_is_owned(arg);
25246 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25247 arg_conv.is_owned = false;
25248 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
25252 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) TS_StaticPaymentOutputDescriptor_clone(uint64_t orig) {
25253 LDKStaticPaymentOutputDescriptor orig_conv;
25254 orig_conv.inner = untag_ptr(orig);
25255 orig_conv.is_owned = ptr_is_owned(orig);
25256 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25257 orig_conv.is_owned = false;
25258 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
25259 uint64_t ret_ref = 0;
25260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25265 jboolean __attribute__((export_name("TS_StaticPaymentOutputDescriptor_eq"))) TS_StaticPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) {
25266 LDKStaticPaymentOutputDescriptor a_conv;
25267 a_conv.inner = untag_ptr(a);
25268 a_conv.is_owned = ptr_is_owned(a);
25269 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25270 a_conv.is_owned = false;
25271 LDKStaticPaymentOutputDescriptor b_conv;
25272 b_conv.inner = untag_ptr(b);
25273 b_conv.is_owned = ptr_is_owned(b);
25274 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
25275 b_conv.is_owned = false;
25276 jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
25280 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
25281 LDKStaticPaymentOutputDescriptor obj_conv;
25282 obj_conv.inner = untag_ptr(obj);
25283 obj_conv.is_owned = ptr_is_owned(obj);
25284 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
25285 obj_conv.is_owned = false;
25286 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
25287 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25288 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25289 CVec_u8Z_free(ret_var);
25293 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
25294 LDKu8slice ser_ref;
25295 ser_ref.datalen = ser->arr_len;
25296 ser_ref.data = ser->elems;
25297 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
25298 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
25300 return tag_ptr(ret_conv, true);
25303 void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint64_t this_ptr) {
25304 if (!ptr_is_owned(this_ptr)) return;
25305 void* this_ptr_ptr = untag_ptr(this_ptr);
25306 CHECK_ACCESS(this_ptr_ptr);
25307 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
25308 FREE(untag_ptr(this_ptr));
25309 SpendableOutputDescriptor_free(this_ptr_conv);
25312 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
25313 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25314 *ret_copy = SpendableOutputDescriptor_clone(arg);
25315 uint64_t ret_ref = tag_ptr(ret_copy, true);
25318 int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint64_t arg) {
25319 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
25320 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
25324 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_SpendableOutputDescriptor_clone(uint64_t orig) {
25325 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
25326 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25327 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
25328 uint64_t ret_ref = tag_ptr(ret_copy, true);
25332 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output"))) TS_SpendableOutputDescriptor_static_output(uint64_t outpoint, uint64_t output) {
25333 LDKOutPoint outpoint_conv;
25334 outpoint_conv.inner = untag_ptr(outpoint);
25335 outpoint_conv.is_owned = ptr_is_owned(outpoint);
25336 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
25337 outpoint_conv = OutPoint_clone(&outpoint_conv);
25338 void* output_ptr = untag_ptr(output);
25339 CHECK_ACCESS(output_ptr);
25340 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
25341 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
25342 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25343 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
25344 uint64_t ret_ref = tag_ptr(ret_copy, true);
25348 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payment_output"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint64_t a) {
25349 LDKDelayedPaymentOutputDescriptor a_conv;
25350 a_conv.inner = untag_ptr(a);
25351 a_conv.is_owned = ptr_is_owned(a);
25352 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25353 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
25354 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25355 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
25356 uint64_t ret_ref = tag_ptr(ret_copy, true);
25360 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_payment_output"))) TS_SpendableOutputDescriptor_static_payment_output(uint64_t a) {
25361 LDKStaticPaymentOutputDescriptor a_conv;
25362 a_conv.inner = untag_ptr(a);
25363 a_conv.is_owned = ptr_is_owned(a);
25364 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25365 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
25366 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25367 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
25368 uint64_t ret_ref = tag_ptr(ret_copy, true);
25372 jboolean __attribute__((export_name("TS_SpendableOutputDescriptor_eq"))) TS_SpendableOutputDescriptor_eq(uint64_t a, uint64_t b) {
25373 LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
25374 LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
25375 jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
25379 int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
25380 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
25381 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
25382 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25383 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25384 CVec_u8Z_free(ret_var);
25388 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
25389 LDKu8slice ser_ref;
25390 ser_ref.datalen = ser->arr_len;
25391 ser_ref.data = ser->elems;
25392 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
25393 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
25395 return tag_ptr(ret_conv, true);
25398 void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
25399 if (!ptr_is_owned(this_ptr)) return;
25400 void* this_ptr_ptr = untag_ptr(this_ptr);
25401 CHECK_ACCESS(this_ptr_ptr);
25402 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
25403 FREE(untag_ptr(this_ptr));
25404 BaseSign_free(this_ptr_conv);
25407 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
25408 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25409 *ret_ret = Sign_clone(arg);
25410 return tag_ptr(ret_ret, true);
25412 int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
25413 void* arg_ptr = untag_ptr(arg);
25414 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
25415 LDKSign* arg_conv = (LDKSign*)arg_ptr;
25416 int64_t ret_conv = Sign_clone_ptr(arg_conv);
25420 uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
25421 void* orig_ptr = untag_ptr(orig);
25422 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
25423 LDKSign* orig_conv = (LDKSign*)orig_ptr;
25424 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25425 *ret_ret = Sign_clone(orig_conv);
25426 return tag_ptr(ret_ret, true);
25429 void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
25430 if (!ptr_is_owned(this_ptr)) return;
25431 void* this_ptr_ptr = untag_ptr(this_ptr);
25432 CHECK_ACCESS(this_ptr_ptr);
25433 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
25434 FREE(untag_ptr(this_ptr));
25435 Sign_free(this_ptr_conv);
25438 uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
25439 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
25440 uint32_t ret_conv = LDKRecipient_to_js(Recipient_clone(orig_conv));
25444 uint32_t __attribute__((export_name("TS_Recipient_node"))) TS_Recipient_node() {
25445 uint32_t ret_conv = LDKRecipient_to_js(Recipient_node());
25449 uint32_t __attribute__((export_name("TS_Recipient_phantom_node"))) TS_Recipient_phantom_node() {
25450 uint32_t ret_conv = LDKRecipient_to_js(Recipient_phantom_node());
25454 void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
25455 if (!ptr_is_owned(this_ptr)) return;
25456 void* this_ptr_ptr = untag_ptr(this_ptr);
25457 CHECK_ACCESS(this_ptr_ptr);
25458 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
25459 FREE(untag_ptr(this_ptr));
25460 KeysInterface_free(this_ptr_conv);
25463 void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
25464 LDKInMemorySigner this_obj_conv;
25465 this_obj_conv.inner = untag_ptr(this_obj);
25466 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25468 InMemorySigner_free(this_obj_conv);
25471 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) TS_InMemorySigner_get_funding_key(uint64_t this_ptr) {
25472 LDKInMemorySigner this_ptr_conv;
25473 this_ptr_conv.inner = untag_ptr(this_ptr);
25474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25476 this_ptr_conv.is_owned = false;
25477 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25478 memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
25482 void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMemorySigner_set_funding_key(uint64_t this_ptr, int8_tArray val) {
25483 LDKInMemorySigner this_ptr_conv;
25484 this_ptr_conv.inner = untag_ptr(this_ptr);
25485 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25487 this_ptr_conv.is_owned = false;
25488 LDKSecretKey val_ref;
25489 CHECK(val->arr_len == 32);
25490 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25491 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
25494 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_key"))) TS_InMemorySigner_get_revocation_base_key(uint64_t this_ptr) {
25495 LDKInMemorySigner this_ptr_conv;
25496 this_ptr_conv.inner = untag_ptr(this_ptr);
25497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25499 this_ptr_conv.is_owned = false;
25500 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25501 memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
25505 void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) TS_InMemorySigner_set_revocation_base_key(uint64_t this_ptr, int8_tArray val) {
25506 LDKInMemorySigner this_ptr_conv;
25507 this_ptr_conv.inner = untag_ptr(this_ptr);
25508 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25510 this_ptr_conv.is_owned = false;
25511 LDKSecretKey val_ref;
25512 CHECK(val->arr_len == 32);
25513 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25514 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
25517 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) TS_InMemorySigner_get_payment_key(uint64_t this_ptr) {
25518 LDKInMemorySigner this_ptr_conv;
25519 this_ptr_conv.inner = untag_ptr(this_ptr);
25520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25522 this_ptr_conv.is_owned = false;
25523 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25524 memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
25528 void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMemorySigner_set_payment_key(uint64_t this_ptr, int8_tArray val) {
25529 LDKInMemorySigner this_ptr_conv;
25530 this_ptr_conv.inner = untag_ptr(this_ptr);
25531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25533 this_ptr_conv.is_owned = false;
25534 LDKSecretKey val_ref;
25535 CHECK(val->arr_len == 32);
25536 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25537 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
25540 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_base_key"))) TS_InMemorySigner_get_delayed_payment_base_key(uint64_t this_ptr) {
25541 LDKInMemorySigner this_ptr_conv;
25542 this_ptr_conv.inner = untag_ptr(this_ptr);
25543 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25545 this_ptr_conv.is_owned = false;
25546 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25547 memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
25551 void __attribute__((export_name("TS_InMemorySigner_set_delayed_payment_base_key"))) TS_InMemorySigner_set_delayed_payment_base_key(uint64_t this_ptr, int8_tArray val) {
25552 LDKInMemorySigner this_ptr_conv;
25553 this_ptr_conv.inner = untag_ptr(this_ptr);
25554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25556 this_ptr_conv.is_owned = false;
25557 LDKSecretKey val_ref;
25558 CHECK(val->arr_len == 32);
25559 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25560 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
25563 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) TS_InMemorySigner_get_htlc_base_key(uint64_t this_ptr) {
25564 LDKInMemorySigner this_ptr_conv;
25565 this_ptr_conv.inner = untag_ptr(this_ptr);
25566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25568 this_ptr_conv.is_owned = false;
25569 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25570 memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
25574 void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InMemorySigner_set_htlc_base_key(uint64_t this_ptr, int8_tArray val) {
25575 LDKInMemorySigner this_ptr_conv;
25576 this_ptr_conv.inner = untag_ptr(this_ptr);
25577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25579 this_ptr_conv.is_owned = false;
25580 LDKSecretKey val_ref;
25581 CHECK(val->arr_len == 32);
25582 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25583 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
25586 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed"))) TS_InMemorySigner_get_commitment_seed(uint64_t this_ptr) {
25587 LDKInMemorySigner this_ptr_conv;
25588 this_ptr_conv.inner = untag_ptr(this_ptr);
25589 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25591 this_ptr_conv.is_owned = false;
25592 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25593 memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
25597 void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_InMemorySigner_set_commitment_seed(uint64_t this_ptr, int8_tArray val) {
25598 LDKInMemorySigner this_ptr_conv;
25599 this_ptr_conv.inner = untag_ptr(this_ptr);
25600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25602 this_ptr_conv.is_owned = false;
25603 LDKThirtyTwoBytes val_ref;
25604 CHECK(val->arr_len == 32);
25605 memcpy(val_ref.data, val->elems, 32); FREE(val);
25606 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
25609 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
25610 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
25611 uint64_t ret_ref = 0;
25612 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25613 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25616 int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint64_t arg) {
25617 LDKInMemorySigner arg_conv;
25618 arg_conv.inner = untag_ptr(arg);
25619 arg_conv.is_owned = ptr_is_owned(arg);
25620 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25621 arg_conv.is_owned = false;
25622 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
25626 uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySigner_clone(uint64_t orig) {
25627 LDKInMemorySigner orig_conv;
25628 orig_conv.inner = untag_ptr(orig);
25629 orig_conv.is_owned = ptr_is_owned(orig);
25630 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25631 orig_conv.is_owned = false;
25632 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
25633 uint64_t ret_ref = 0;
25634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25639 uint64_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigner_new(int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
25640 LDKSecretKey node_secret_ref;
25641 CHECK(node_secret->arr_len == 32);
25642 memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
25643 LDKSecretKey funding_key_ref;
25644 CHECK(funding_key->arr_len == 32);
25645 memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
25646 LDKSecretKey revocation_base_key_ref;
25647 CHECK(revocation_base_key->arr_len == 32);
25648 memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key);
25649 LDKSecretKey payment_key_ref;
25650 CHECK(payment_key->arr_len == 32);
25651 memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key);
25652 LDKSecretKey delayed_payment_base_key_ref;
25653 CHECK(delayed_payment_base_key->arr_len == 32);
25654 memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key);
25655 LDKSecretKey htlc_base_key_ref;
25656 CHECK(htlc_base_key->arr_len == 32);
25657 memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key);
25658 LDKThirtyTwoBytes commitment_seed_ref;
25659 CHECK(commitment_seed->arr_len == 32);
25660 memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed);
25661 LDKThirtyTwoBytes channel_keys_id_ref;
25662 CHECK(channel_keys_id->arr_len == 32);
25663 memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
25664 LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
25665 uint64_t ret_ref = 0;
25666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25671 uint64_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) TS_InMemorySigner_counterparty_pubkeys(uint64_t this_arg) {
25672 LDKInMemorySigner this_arg_conv;
25673 this_arg_conv.inner = untag_ptr(this_arg);
25674 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25676 this_arg_conv.is_owned = false;
25677 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
25678 uint64_t ret_ref = 0;
25679 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25680 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25684 int16_t __attribute__((export_name("TS_InMemorySigner_counterparty_selected_contest_delay"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint64_t this_arg) {
25685 LDKInMemorySigner this_arg_conv;
25686 this_arg_conv.inner = untag_ptr(this_arg);
25687 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25689 this_arg_conv.is_owned = false;
25690 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
25694 int16_t __attribute__((export_name("TS_InMemorySigner_holder_selected_contest_delay"))) TS_InMemorySigner_holder_selected_contest_delay(uint64_t this_arg) {
25695 LDKInMemorySigner this_arg_conv;
25696 this_arg_conv.inner = untag_ptr(this_arg);
25697 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25699 this_arg_conv.is_owned = false;
25700 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
25704 jboolean __attribute__((export_name("TS_InMemorySigner_is_outbound"))) TS_InMemorySigner_is_outbound(uint64_t this_arg) {
25705 LDKInMemorySigner this_arg_conv;
25706 this_arg_conv.inner = untag_ptr(this_arg);
25707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25709 this_arg_conv.is_owned = false;
25710 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
25714 uint64_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_InMemorySigner_funding_outpoint(uint64_t this_arg) {
25715 LDKInMemorySigner this_arg_conv;
25716 this_arg_conv.inner = untag_ptr(this_arg);
25717 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25719 this_arg_conv.is_owned = false;
25720 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
25721 uint64_t ret_ref = 0;
25722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25727 uint64_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters"))) TS_InMemorySigner_get_channel_parameters(uint64_t this_arg) {
25728 LDKInMemorySigner this_arg_conv;
25729 this_arg_conv.inner = untag_ptr(this_arg);
25730 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25732 this_arg_conv.is_owned = false;
25733 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
25734 uint64_t ret_ref = 0;
25735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25740 jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMemorySigner_opt_anchors(uint64_t this_arg) {
25741 LDKInMemorySigner this_arg_conv;
25742 this_arg_conv.inner = untag_ptr(this_arg);
25743 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25745 this_arg_conv.is_owned = false;
25746 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
25750 uint64_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_payment_input"))) TS_InMemorySigner_sign_counterparty_payment_input(uint64_t this_arg, int8_tArray spend_tx, uint32_t input_idx, uint64_t descriptor) {
25751 LDKInMemorySigner this_arg_conv;
25752 this_arg_conv.inner = untag_ptr(this_arg);
25753 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25755 this_arg_conv.is_owned = false;
25756 LDKTransaction spend_tx_ref;
25757 spend_tx_ref.datalen = spend_tx->arr_len;
25758 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
25759 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
25760 spend_tx_ref.data_is_owned = true;
25761 LDKStaticPaymentOutputDescriptor descriptor_conv;
25762 descriptor_conv.inner = untag_ptr(descriptor);
25763 descriptor_conv.is_owned = ptr_is_owned(descriptor);
25764 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
25765 descriptor_conv.is_owned = false;
25766 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
25767 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
25768 return tag_ptr(ret_conv, true);
25771 uint64_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint64_t this_arg, int8_tArray spend_tx, uint32_t input_idx, uint64_t descriptor) {
25772 LDKInMemorySigner this_arg_conv;
25773 this_arg_conv.inner = untag_ptr(this_arg);
25774 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25776 this_arg_conv.is_owned = false;
25777 LDKTransaction spend_tx_ref;
25778 spend_tx_ref.datalen = spend_tx->arr_len;
25779 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
25780 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
25781 spend_tx_ref.data_is_owned = true;
25782 LDKDelayedPaymentOutputDescriptor descriptor_conv;
25783 descriptor_conv.inner = untag_ptr(descriptor);
25784 descriptor_conv.is_owned = ptr_is_owned(descriptor);
25785 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
25786 descriptor_conv.is_owned = false;
25787 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
25788 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
25789 return tag_ptr(ret_conv, true);
25792 uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
25793 LDKInMemorySigner this_arg_conv;
25794 this_arg_conv.inner = untag_ptr(this_arg);
25795 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25797 this_arg_conv.is_owned = false;
25798 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
25799 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
25800 return tag_ptr(ret_ret, true);
25803 uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
25804 LDKInMemorySigner this_arg_conv;
25805 this_arg_conv.inner = untag_ptr(this_arg);
25806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25808 this_arg_conv.is_owned = false;
25809 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25810 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
25811 return tag_ptr(ret_ret, true);
25814 int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint64_t obj) {
25815 LDKInMemorySigner obj_conv;
25816 obj_conv.inner = untag_ptr(obj);
25817 obj_conv.is_owned = ptr_is_owned(obj);
25818 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
25819 obj_conv.is_owned = false;
25820 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
25821 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25822 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25823 CVec_u8Z_free(ret_var);
25827 uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
25828 LDKu8slice ser_ref;
25829 ser_ref.datalen = ser->arr_len;
25830 ser_ref.data = ser->elems;
25831 LDKSecretKey arg_ref;
25832 CHECK(arg->arr_len == 32);
25833 memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
25834 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
25835 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
25837 return tag_ptr(ret_conv, true);
25840 void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint64_t this_obj) {
25841 LDKKeysManager this_obj_conv;
25842 this_obj_conv.inner = untag_ptr(this_obj);
25843 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25845 KeysManager_free(this_obj_conv);
25848 uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
25849 unsigned char seed_arr[32];
25850 CHECK(seed->arr_len == 32);
25851 memcpy(seed_arr, seed->elems, 32); FREE(seed);
25852 unsigned char (*seed_ref)[32] = &seed_arr;
25853 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
25854 uint64_t ret_ref = 0;
25855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25860 uint64_t __attribute__((export_name("TS_KeysManager_derive_channel_keys"))) TS_KeysManager_derive_channel_keys(uint64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
25861 LDKKeysManager this_arg_conv;
25862 this_arg_conv.inner = untag_ptr(this_arg);
25863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25865 this_arg_conv.is_owned = false;
25866 unsigned char params_arr[32];
25867 CHECK(params->arr_len == 32);
25868 memcpy(params_arr, params->elems, 32); FREE(params);
25869 unsigned char (*params_ref)[32] = ¶ms_arr;
25870 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
25871 uint64_t ret_ref = 0;
25872 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25873 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25877 uint64_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) TS_KeysManager_spend_spendable_outputs(uint64_t this_arg, uint64_tArray descriptors, uint64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
25878 LDKKeysManager this_arg_conv;
25879 this_arg_conv.inner = untag_ptr(this_arg);
25880 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25882 this_arg_conv.is_owned = false;
25883 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
25884 descriptors_constr.datalen = descriptors->arr_len;
25885 if (descriptors_constr.datalen > 0)
25886 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
25888 descriptors_constr.data = NULL;
25889 uint64_t* descriptors_vals = descriptors->elems;
25890 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
25891 uint64_t descriptors_conv_27 = descriptors_vals[b];
25892 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
25893 CHECK_ACCESS(descriptors_conv_27_ptr);
25894 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
25895 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
25896 descriptors_constr.data[b] = descriptors_conv_27_conv;
25899 LDKCVec_TxOutZ outputs_constr;
25900 outputs_constr.datalen = outputs->arr_len;
25901 if (outputs_constr.datalen > 0)
25902 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
25904 outputs_constr.data = NULL;
25905 uint64_t* outputs_vals = outputs->elems;
25906 for (size_t h = 0; h < outputs_constr.datalen; h++) {
25907 uint64_t outputs_conv_7 = outputs_vals[h];
25908 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
25909 CHECK_ACCESS(outputs_conv_7_ptr);
25910 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
25911 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
25912 outputs_constr.data[h] = outputs_conv_7_conv;
25915 LDKCVec_u8Z change_destination_script_ref;
25916 change_destination_script_ref.datalen = change_destination_script->arr_len;
25917 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
25918 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
25919 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
25920 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
25921 return tag_ptr(ret_conv, true);
25924 uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
25925 LDKKeysManager this_arg_conv;
25926 this_arg_conv.inner = untag_ptr(this_arg);
25927 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25929 this_arg_conv.is_owned = false;
25930 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
25931 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
25932 return tag_ptr(ret_ret, true);
25935 void __attribute__((export_name("TS_PhantomKeysManager_free"))) TS_PhantomKeysManager_free(uint64_t this_obj) {
25936 LDKPhantomKeysManager this_obj_conv;
25937 this_obj_conv.inner = untag_ptr(this_obj);
25938 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25940 PhantomKeysManager_free(this_obj_conv);
25943 uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
25944 LDKPhantomKeysManager this_arg_conv;
25945 this_arg_conv.inner = untag_ptr(this_arg);
25946 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25948 this_arg_conv.is_owned = false;
25949 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
25950 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
25951 return tag_ptr(ret_ret, true);
25954 uint64_t __attribute__((export_name("TS_PhantomKeysManager_new"))) TS_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) {
25955 unsigned char seed_arr[32];
25956 CHECK(seed->arr_len == 32);
25957 memcpy(seed_arr, seed->elems, 32); FREE(seed);
25958 unsigned char (*seed_ref)[32] = &seed_arr;
25959 unsigned char cross_node_seed_arr[32];
25960 CHECK(cross_node_seed->arr_len == 32);
25961 memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
25962 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
25963 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
25964 uint64_t ret_ref = 0;
25965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25970 uint64_t __attribute__((export_name("TS_PhantomKeysManager_spend_spendable_outputs"))) TS_PhantomKeysManager_spend_spendable_outputs(uint64_t this_arg, uint64_tArray descriptors, uint64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
25971 LDKPhantomKeysManager this_arg_conv;
25972 this_arg_conv.inner = untag_ptr(this_arg);
25973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25975 this_arg_conv.is_owned = false;
25976 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
25977 descriptors_constr.datalen = descriptors->arr_len;
25978 if (descriptors_constr.datalen > 0)
25979 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
25981 descriptors_constr.data = NULL;
25982 uint64_t* descriptors_vals = descriptors->elems;
25983 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
25984 uint64_t descriptors_conv_27 = descriptors_vals[b];
25985 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
25986 CHECK_ACCESS(descriptors_conv_27_ptr);
25987 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
25988 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
25989 descriptors_constr.data[b] = descriptors_conv_27_conv;
25992 LDKCVec_TxOutZ outputs_constr;
25993 outputs_constr.datalen = outputs->arr_len;
25994 if (outputs_constr.datalen > 0)
25995 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
25997 outputs_constr.data = NULL;
25998 uint64_t* outputs_vals = outputs->elems;
25999 for (size_t h = 0; h < outputs_constr.datalen; h++) {
26000 uint64_t outputs_conv_7 = outputs_vals[h];
26001 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
26002 CHECK_ACCESS(outputs_conv_7_ptr);
26003 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
26004 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
26005 outputs_constr.data[h] = outputs_conv_7_conv;
26008 LDKCVec_u8Z change_destination_script_ref;
26009 change_destination_script_ref.datalen = change_destination_script->arr_len;
26010 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
26011 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
26012 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
26013 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
26014 return tag_ptr(ret_conv, true);
26017 uint64_t __attribute__((export_name("TS_PhantomKeysManager_derive_channel_keys"))) TS_PhantomKeysManager_derive_channel_keys(uint64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
26018 LDKPhantomKeysManager this_arg_conv;
26019 this_arg_conv.inner = untag_ptr(this_arg);
26020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26022 this_arg_conv.is_owned = false;
26023 unsigned char params_arr[32];
26024 CHECK(params->arr_len == 32);
26025 memcpy(params_arr, params->elems, 32); FREE(params);
26026 unsigned char (*params_ref)[32] = ¶ms_arr;
26027 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
26028 uint64_t ret_ref = 0;
26029 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26030 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26034 void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
26035 LDKChannelManager this_obj_conv;
26036 this_obj_conv.inner = untag_ptr(this_obj);
26037 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26039 ChannelManager_free(this_obj_conv);
26042 void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) {
26043 LDKChainParameters this_obj_conv;
26044 this_obj_conv.inner = untag_ptr(this_obj);
26045 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26047 ChainParameters_free(this_obj_conv);
26050 uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) {
26051 LDKChainParameters this_ptr_conv;
26052 this_ptr_conv.inner = untag_ptr(this_ptr);
26053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26055 this_ptr_conv.is_owned = false;
26056 uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv));
26060 void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) {
26061 LDKChainParameters this_ptr_conv;
26062 this_ptr_conv.inner = untag_ptr(this_ptr);
26063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26065 this_ptr_conv.is_owned = false;
26066 LDKNetwork val_conv = LDKNetwork_from_js(val);
26067 ChainParameters_set_network(&this_ptr_conv, val_conv);
26070 uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) {
26071 LDKChainParameters this_ptr_conv;
26072 this_ptr_conv.inner = untag_ptr(this_ptr);
26073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26075 this_ptr_conv.is_owned = false;
26076 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
26077 uint64_t ret_ref = 0;
26078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26083 void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) {
26084 LDKChainParameters this_ptr_conv;
26085 this_ptr_conv.inner = untag_ptr(this_ptr);
26086 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26088 this_ptr_conv.is_owned = false;
26089 LDKBestBlock val_conv;
26090 val_conv.inner = untag_ptr(val);
26091 val_conv.is_owned = ptr_is_owned(val);
26092 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26093 val_conv = BestBlock_clone(&val_conv);
26094 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
26097 uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) {
26098 LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg);
26099 LDKBestBlock best_block_arg_conv;
26100 best_block_arg_conv.inner = untag_ptr(best_block_arg);
26101 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
26102 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
26103 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
26104 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
26105 uint64_t ret_ref = 0;
26106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26111 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
26112 LDKChainParameters ret_var = ChainParameters_clone(arg);
26113 uint64_t ret_ref = 0;
26114 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26115 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26118 int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) {
26119 LDKChainParameters arg_conv;
26120 arg_conv.inner = untag_ptr(arg);
26121 arg_conv.is_owned = ptr_is_owned(arg);
26122 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26123 arg_conv.is_owned = false;
26124 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
26128 uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) {
26129 LDKChainParameters orig_conv;
26130 orig_conv.inner = untag_ptr(orig);
26131 orig_conv.is_owned = ptr_is_owned(orig);
26132 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26133 orig_conv.is_owned = false;
26134 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
26135 uint64_t ret_ref = 0;
26136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26141 void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) {
26142 LDKCounterpartyForwardingInfo this_obj_conv;
26143 this_obj_conv.inner = untag_ptr(this_obj);
26144 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26146 CounterpartyForwardingInfo_free(this_obj_conv);
26149 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) {
26150 LDKCounterpartyForwardingInfo this_ptr_conv;
26151 this_ptr_conv.inner = untag_ptr(this_ptr);
26152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26154 this_ptr_conv.is_owned = false;
26155 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
26159 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
26160 LDKCounterpartyForwardingInfo this_ptr_conv;
26161 this_ptr_conv.inner = untag_ptr(this_ptr);
26162 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26164 this_ptr_conv.is_owned = false;
26165 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
26168 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) {
26169 LDKCounterpartyForwardingInfo this_ptr_conv;
26170 this_ptr_conv.inner = untag_ptr(this_ptr);
26171 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26172 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26173 this_ptr_conv.is_owned = false;
26174 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
26178 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
26179 LDKCounterpartyForwardingInfo this_ptr_conv;
26180 this_ptr_conv.inner = untag_ptr(this_ptr);
26181 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26183 this_ptr_conv.is_owned = false;
26184 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
26187 int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
26188 LDKCounterpartyForwardingInfo this_ptr_conv;
26189 this_ptr_conv.inner = untag_ptr(this_ptr);
26190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26192 this_ptr_conv.is_owned = false;
26193 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
26197 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
26198 LDKCounterpartyForwardingInfo this_ptr_conv;
26199 this_ptr_conv.inner = untag_ptr(this_ptr);
26200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26202 this_ptr_conv.is_owned = false;
26203 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
26206 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_new"))) TS_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
26207 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
26208 uint64_t ret_ref = 0;
26209 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26210 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26214 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
26215 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
26216 uint64_t ret_ref = 0;
26217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26221 int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) {
26222 LDKCounterpartyForwardingInfo arg_conv;
26223 arg_conv.inner = untag_ptr(arg);
26224 arg_conv.is_owned = ptr_is_owned(arg);
26225 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26226 arg_conv.is_owned = false;
26227 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
26231 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) {
26232 LDKCounterpartyForwardingInfo orig_conv;
26233 orig_conv.inner = untag_ptr(orig);
26234 orig_conv.is_owned = ptr_is_owned(orig);
26235 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26236 orig_conv.is_owned = false;
26237 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
26238 uint64_t ret_ref = 0;
26239 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26240 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26244 void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) {
26245 LDKChannelCounterparty this_obj_conv;
26246 this_obj_conv.inner = untag_ptr(this_obj);
26247 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26249 ChannelCounterparty_free(this_obj_conv);
26252 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) {
26253 LDKChannelCounterparty this_ptr_conv;
26254 this_ptr_conv.inner = untag_ptr(this_ptr);
26255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26257 this_ptr_conv.is_owned = false;
26258 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
26259 memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
26263 void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) {
26264 LDKChannelCounterparty this_ptr_conv;
26265 this_ptr_conv.inner = untag_ptr(this_ptr);
26266 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26268 this_ptr_conv.is_owned = false;
26269 LDKPublicKey val_ref;
26270 CHECK(val->arr_len == 33);
26271 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
26272 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
26275 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) {
26276 LDKChannelCounterparty this_ptr_conv;
26277 this_ptr_conv.inner = untag_ptr(this_ptr);
26278 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26280 this_ptr_conv.is_owned = false;
26281 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
26282 uint64_t ret_ref = 0;
26283 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26284 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26288 void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) {
26289 LDKChannelCounterparty this_ptr_conv;
26290 this_ptr_conv.inner = untag_ptr(this_ptr);
26291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26293 this_ptr_conv.is_owned = false;
26294 LDKInitFeatures val_conv;
26295 val_conv.inner = untag_ptr(val);
26296 val_conv.is_owned = ptr_is_owned(val);
26297 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26298 val_conv = InitFeatures_clone(&val_conv);
26299 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
26302 int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) {
26303 LDKChannelCounterparty this_ptr_conv;
26304 this_ptr_conv.inner = untag_ptr(this_ptr);
26305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26307 this_ptr_conv.is_owned = false;
26308 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
26312 void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) {
26313 LDKChannelCounterparty this_ptr_conv;
26314 this_ptr_conv.inner = untag_ptr(this_ptr);
26315 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26317 this_ptr_conv.is_owned = false;
26318 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
26321 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) {
26322 LDKChannelCounterparty this_ptr_conv;
26323 this_ptr_conv.inner = untag_ptr(this_ptr);
26324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26326 this_ptr_conv.is_owned = false;
26327 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
26328 uint64_t ret_ref = 0;
26329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26334 void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) {
26335 LDKChannelCounterparty this_ptr_conv;
26336 this_ptr_conv.inner = untag_ptr(this_ptr);
26337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26339 this_ptr_conv.is_owned = false;
26340 LDKCounterpartyForwardingInfo val_conv;
26341 val_conv.inner = untag_ptr(val);
26342 val_conv.is_owned = ptr_is_owned(val);
26343 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26344 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
26345 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
26348 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) {
26349 LDKChannelCounterparty this_ptr_conv;
26350 this_ptr_conv.inner = untag_ptr(this_ptr);
26351 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26353 this_ptr_conv.is_owned = false;
26354 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26355 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
26356 uint64_t ret_ref = tag_ptr(ret_copy, true);
26360 void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
26361 LDKChannelCounterparty this_ptr_conv;
26362 this_ptr_conv.inner = untag_ptr(this_ptr);
26363 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26365 this_ptr_conv.is_owned = false;
26366 void* val_ptr = untag_ptr(val);
26367 CHECK_ACCESS(val_ptr);
26368 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26369 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26370 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
26373 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) {
26374 LDKChannelCounterparty this_ptr_conv;
26375 this_ptr_conv.inner = untag_ptr(this_ptr);
26376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26378 this_ptr_conv.is_owned = false;
26379 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26380 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
26381 uint64_t ret_ref = tag_ptr(ret_copy, true);
26385 void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
26386 LDKChannelCounterparty this_ptr_conv;
26387 this_ptr_conv.inner = untag_ptr(this_ptr);
26388 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26390 this_ptr_conv.is_owned = false;
26391 void* val_ptr = untag_ptr(val);
26392 CHECK_ACCESS(val_ptr);
26393 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26394 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26395 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
26398 uint64_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelCounterparty_new(int8_tArray node_id_arg, uint64_t features_arg, int64_t unspendable_punishment_reserve_arg, uint64_t forwarding_info_arg, uint64_t outbound_htlc_minimum_msat_arg, uint64_t outbound_htlc_maximum_msat_arg) {
26399 LDKPublicKey node_id_arg_ref;
26400 CHECK(node_id_arg->arr_len == 33);
26401 memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg);
26402 LDKInitFeatures features_arg_conv;
26403 features_arg_conv.inner = untag_ptr(features_arg);
26404 features_arg_conv.is_owned = ptr_is_owned(features_arg);
26405 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
26406 features_arg_conv = InitFeatures_clone(&features_arg_conv);
26407 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
26408 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
26409 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
26410 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
26411 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
26412 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
26413 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
26414 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
26415 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
26416 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
26417 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
26418 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
26419 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
26420 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);
26421 uint64_t ret_ref = 0;
26422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26427 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
26428 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
26429 uint64_t ret_ref = 0;
26430 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26431 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26434 int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) {
26435 LDKChannelCounterparty arg_conv;
26436 arg_conv.inner = untag_ptr(arg);
26437 arg_conv.is_owned = ptr_is_owned(arg);
26438 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26439 arg_conv.is_owned = false;
26440 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
26444 uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) {
26445 LDKChannelCounterparty orig_conv;
26446 orig_conv.inner = untag_ptr(orig);
26447 orig_conv.is_owned = ptr_is_owned(orig);
26448 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26449 orig_conv.is_owned = false;
26450 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
26451 uint64_t ret_ref = 0;
26452 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26453 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26457 void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) {
26458 LDKChannelDetails this_obj_conv;
26459 this_obj_conv.inner = untag_ptr(this_obj);
26460 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26461 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26462 ChannelDetails_free(this_obj_conv);
26465 int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) {
26466 LDKChannelDetails this_ptr_conv;
26467 this_ptr_conv.inner = untag_ptr(this_ptr);
26468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26470 this_ptr_conv.is_owned = false;
26471 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
26472 memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32);
26476 void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) {
26477 LDKChannelDetails this_ptr_conv;
26478 this_ptr_conv.inner = untag_ptr(this_ptr);
26479 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26480 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26481 this_ptr_conv.is_owned = false;
26482 LDKThirtyTwoBytes val_ref;
26483 CHECK(val->arr_len == 32);
26484 memcpy(val_ref.data, val->elems, 32); FREE(val);
26485 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
26488 uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) {
26489 LDKChannelDetails this_ptr_conv;
26490 this_ptr_conv.inner = untag_ptr(this_ptr);
26491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26493 this_ptr_conv.is_owned = false;
26494 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
26495 uint64_t ret_ref = 0;
26496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26501 void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) {
26502 LDKChannelDetails this_ptr_conv;
26503 this_ptr_conv.inner = untag_ptr(this_ptr);
26504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26506 this_ptr_conv.is_owned = false;
26507 LDKChannelCounterparty val_conv;
26508 val_conv.inner = untag_ptr(val);
26509 val_conv.is_owned = ptr_is_owned(val);
26510 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26511 val_conv = ChannelCounterparty_clone(&val_conv);
26512 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
26515 uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) {
26516 LDKChannelDetails this_ptr_conv;
26517 this_ptr_conv.inner = untag_ptr(this_ptr);
26518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26520 this_ptr_conv.is_owned = false;
26521 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
26522 uint64_t ret_ref = 0;
26523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26528 void __attribute__((export_name("TS_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) {
26529 LDKChannelDetails this_ptr_conv;
26530 this_ptr_conv.inner = untag_ptr(this_ptr);
26531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26533 this_ptr_conv.is_owned = false;
26534 LDKOutPoint val_conv;
26535 val_conv.inner = untag_ptr(val);
26536 val_conv.is_owned = ptr_is_owned(val);
26537 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26538 val_conv = OutPoint_clone(&val_conv);
26539 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
26542 uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(uint64_t this_ptr) {
26543 LDKChannelDetails this_ptr_conv;
26544 this_ptr_conv.inner = untag_ptr(this_ptr);
26545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26547 this_ptr_conv.is_owned = false;
26548 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
26549 uint64_t ret_ref = 0;
26550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26555 void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(uint64_t this_ptr, uint64_t val) {
26556 LDKChannelDetails this_ptr_conv;
26557 this_ptr_conv.inner = untag_ptr(this_ptr);
26558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26560 this_ptr_conv.is_owned = false;
26561 LDKChannelTypeFeatures val_conv;
26562 val_conv.inner = untag_ptr(val);
26563 val_conv.is_owned = ptr_is_owned(val);
26564 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26565 val_conv = ChannelTypeFeatures_clone(&val_conv);
26566 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
26569 uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) {
26570 LDKChannelDetails this_ptr_conv;
26571 this_ptr_conv.inner = untag_ptr(this_ptr);
26572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26574 this_ptr_conv.is_owned = false;
26575 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26576 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
26577 uint64_t ret_ref = tag_ptr(ret_copy, true);
26581 void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(uint64_t this_ptr, uint64_t val) {
26582 LDKChannelDetails this_ptr_conv;
26583 this_ptr_conv.inner = untag_ptr(this_ptr);
26584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26586 this_ptr_conv.is_owned = false;
26587 void* val_ptr = untag_ptr(val);
26588 CHECK_ACCESS(val_ptr);
26589 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26590 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26591 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
26594 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(uint64_t this_ptr) {
26595 LDKChannelDetails this_ptr_conv;
26596 this_ptr_conv.inner = untag_ptr(this_ptr);
26597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26599 this_ptr_conv.is_owned = false;
26600 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26601 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
26602 uint64_t ret_ref = tag_ptr(ret_copy, true);
26606 void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(uint64_t this_ptr, uint64_t val) {
26607 LDKChannelDetails this_ptr_conv;
26608 this_ptr_conv.inner = untag_ptr(this_ptr);
26609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26611 this_ptr_conv.is_owned = false;
26612 void* val_ptr = untag_ptr(val);
26613 CHECK_ACCESS(val_ptr);
26614 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26615 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26616 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
26619 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(uint64_t this_ptr) {
26620 LDKChannelDetails this_ptr_conv;
26621 this_ptr_conv.inner = untag_ptr(this_ptr);
26622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26624 this_ptr_conv.is_owned = false;
26625 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26626 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
26627 uint64_t ret_ref = tag_ptr(ret_copy, true);
26631 void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(uint64_t this_ptr, uint64_t val) {
26632 LDKChannelDetails this_ptr_conv;
26633 this_ptr_conv.inner = untag_ptr(this_ptr);
26634 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26636 this_ptr_conv.is_owned = false;
26637 void* val_ptr = untag_ptr(val);
26638 CHECK_ACCESS(val_ptr);
26639 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26640 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26641 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
26644 int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) {
26645 LDKChannelDetails this_ptr_conv;
26646 this_ptr_conv.inner = untag_ptr(this_ptr);
26647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26649 this_ptr_conv.is_owned = false;
26650 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
26654 void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
26655 LDKChannelDetails this_ptr_conv;
26656 this_ptr_conv.inner = untag_ptr(this_ptr);
26657 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26659 this_ptr_conv.is_owned = false;
26660 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
26663 uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint64_t this_ptr) {
26664 LDKChannelDetails this_ptr_conv;
26665 this_ptr_conv.inner = untag_ptr(this_ptr);
26666 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26668 this_ptr_conv.is_owned = false;
26669 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26670 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
26671 uint64_t ret_ref = tag_ptr(ret_copy, true);
26675 void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint64_t this_ptr, uint64_t val) {
26676 LDKChannelDetails this_ptr_conv;
26677 this_ptr_conv.inner = untag_ptr(this_ptr);
26678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26680 this_ptr_conv.is_owned = false;
26681 void* val_ptr = untag_ptr(val);
26682 CHECK_ACCESS(val_ptr);
26683 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26684 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26685 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
26688 int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
26689 LDKChannelDetails this_ptr_conv;
26690 this_ptr_conv.inner = untag_ptr(this_ptr);
26691 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26693 this_ptr_conv.is_owned = false;
26694 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
26698 void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
26699 LDKChannelDetails this_ptr_conv;
26700 this_ptr_conv.inner = untag_ptr(this_ptr);
26701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26703 this_ptr_conv.is_owned = false;
26704 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
26707 int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
26708 LDKChannelDetails this_ptr_conv;
26709 this_ptr_conv.inner = untag_ptr(this_ptr);
26710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26712 this_ptr_conv.is_owned = false;
26713 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
26717 void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_t val) {
26718 LDKChannelDetails this_ptr_conv;
26719 this_ptr_conv.inner = untag_ptr(this_ptr);
26720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26722 this_ptr_conv.is_owned = false;
26723 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
26726 int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) {
26727 LDKChannelDetails this_ptr_conv;
26728 this_ptr_conv.inner = untag_ptr(this_ptr);
26729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26731 this_ptr_conv.is_owned = false;
26732 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
26736 void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_t val) {
26737 LDKChannelDetails this_ptr_conv;
26738 this_ptr_conv.inner = untag_ptr(this_ptr);
26739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26741 this_ptr_conv.is_owned = false;
26742 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
26745 int64_t __attribute__((export_name("TS_ChannelDetails_get_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_get_next_outbound_htlc_limit_msat(uint64_t this_ptr) {
26746 LDKChannelDetails this_ptr_conv;
26747 this_ptr_conv.inner = untag_ptr(this_ptr);
26748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26750 this_ptr_conv.is_owned = false;
26751 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
26755 void __attribute__((export_name("TS_ChannelDetails_set_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_set_next_outbound_htlc_limit_msat(uint64_t this_ptr, int64_t val) {
26756 LDKChannelDetails this_ptr_conv;
26757 this_ptr_conv.inner = untag_ptr(this_ptr);
26758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26760 this_ptr_conv.is_owned = false;
26761 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
26764 int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) {
26765 LDKChannelDetails this_ptr_conv;
26766 this_ptr_conv.inner = untag_ptr(this_ptr);
26767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26769 this_ptr_conv.is_owned = false;
26770 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
26774 void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_t val) {
26775 LDKChannelDetails this_ptr_conv;
26776 this_ptr_conv.inner = untag_ptr(this_ptr);
26777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26779 this_ptr_conv.is_owned = false;
26780 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
26783 uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) {
26784 LDKChannelDetails this_ptr_conv;
26785 this_ptr_conv.inner = untag_ptr(this_ptr);
26786 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26788 this_ptr_conv.is_owned = false;
26789 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
26790 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
26791 uint64_t ret_ref = tag_ptr(ret_copy, true);
26795 void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) {
26796 LDKChannelDetails this_ptr_conv;
26797 this_ptr_conv.inner = untag_ptr(this_ptr);
26798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26800 this_ptr_conv.is_owned = false;
26801 void* val_ptr = untag_ptr(val);
26802 CHECK_ACCESS(val_ptr);
26803 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
26804 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
26805 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
26808 uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) {
26809 LDKChannelDetails this_ptr_conv;
26810 this_ptr_conv.inner = untag_ptr(this_ptr);
26811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26813 this_ptr_conv.is_owned = false;
26814 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
26815 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
26816 uint64_t ret_ref = tag_ptr(ret_copy, true);
26820 void __attribute__((export_name("TS_ChannelDetails_set_force_close_spend_delay"))) TS_ChannelDetails_set_force_close_spend_delay(uint64_t this_ptr, uint64_t val) {
26821 LDKChannelDetails this_ptr_conv;
26822 this_ptr_conv.inner = untag_ptr(this_ptr);
26823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26825 this_ptr_conv.is_owned = false;
26826 void* val_ptr = untag_ptr(val);
26827 CHECK_ACCESS(val_ptr);
26828 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
26829 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
26830 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
26833 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(uint64_t this_ptr) {
26834 LDKChannelDetails this_ptr_conv;
26835 this_ptr_conv.inner = untag_ptr(this_ptr);
26836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26838 this_ptr_conv.is_owned = false;
26839 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
26843 void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) {
26844 LDKChannelDetails this_ptr_conv;
26845 this_ptr_conv.inner = untag_ptr(this_ptr);
26846 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26848 this_ptr_conv.is_owned = false;
26849 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
26852 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(uint64_t this_ptr) {
26853 LDKChannelDetails this_ptr_conv;
26854 this_ptr_conv.inner = untag_ptr(this_ptr);
26855 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26857 this_ptr_conv.is_owned = false;
26858 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
26862 void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) {
26863 LDKChannelDetails this_ptr_conv;
26864 this_ptr_conv.inner = untag_ptr(this_ptr);
26865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26867 this_ptr_conv.is_owned = false;
26868 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
26871 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(uint64_t this_ptr) {
26872 LDKChannelDetails this_ptr_conv;
26873 this_ptr_conv.inner = untag_ptr(this_ptr);
26874 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26876 this_ptr_conv.is_owned = false;
26877 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
26881 void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) {
26882 LDKChannelDetails this_ptr_conv;
26883 this_ptr_conv.inner = untag_ptr(this_ptr);
26884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26886 this_ptr_conv.is_owned = false;
26887 ChannelDetails_set_is_usable(&this_ptr_conv, val);
26890 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) {
26891 LDKChannelDetails this_ptr_conv;
26892 this_ptr_conv.inner = untag_ptr(this_ptr);
26893 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26895 this_ptr_conv.is_owned = false;
26896 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
26900 void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) {
26901 LDKChannelDetails this_ptr_conv;
26902 this_ptr_conv.inner = untag_ptr(this_ptr);
26903 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26905 this_ptr_conv.is_owned = false;
26906 ChannelDetails_set_is_public(&this_ptr_conv, val);
26909 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) {
26910 LDKChannelDetails this_ptr_conv;
26911 this_ptr_conv.inner = untag_ptr(this_ptr);
26912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26914 this_ptr_conv.is_owned = false;
26915 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26916 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
26917 uint64_t ret_ref = tag_ptr(ret_copy, true);
26921 void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_minimum_msat"))) TS_ChannelDetails_set_inbound_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
26922 LDKChannelDetails this_ptr_conv;
26923 this_ptr_conv.inner = untag_ptr(this_ptr);
26924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26926 this_ptr_conv.is_owned = false;
26927 void* val_ptr = untag_ptr(val);
26928 CHECK_ACCESS(val_ptr);
26929 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26930 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26931 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
26934 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(uint64_t this_ptr) {
26935 LDKChannelDetails this_ptr_conv;
26936 this_ptr_conv.inner = untag_ptr(this_ptr);
26937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26939 this_ptr_conv.is_owned = false;
26940 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26941 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
26942 uint64_t ret_ref = tag_ptr(ret_copy, true);
26946 void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_maximum_msat"))) TS_ChannelDetails_set_inbound_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
26947 LDKChannelDetails this_ptr_conv;
26948 this_ptr_conv.inner = untag_ptr(this_ptr);
26949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26951 this_ptr_conv.is_owned = false;
26952 void* val_ptr = untag_ptr(val);
26953 CHECK_ACCESS(val_ptr);
26954 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26955 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26956 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
26959 uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(uint64_t this_ptr) {
26960 LDKChannelDetails this_ptr_conv;
26961 this_ptr_conv.inner = untag_ptr(this_ptr);
26962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26964 this_ptr_conv.is_owned = false;
26965 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
26966 uint64_t ret_ref = 0;
26967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26972 void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(uint64_t this_ptr, uint64_t val) {
26973 LDKChannelDetails this_ptr_conv;
26974 this_ptr_conv.inner = untag_ptr(this_ptr);
26975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26977 this_ptr_conv.is_owned = false;
26978 LDKChannelConfig val_conv;
26979 val_conv.inner = untag_ptr(val);
26980 val_conv.is_owned = ptr_is_owned(val);
26981 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26982 val_conv = ChannelConfig_clone(&val_conv);
26983 ChannelDetails_set_config(&this_ptr_conv, val_conv);
26986 uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint64_t counterparty_arg, uint64_t funding_txo_arg, uint64_t channel_type_arg, uint64_t short_channel_id_arg, uint64_t outbound_scid_alias_arg, uint64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, uint64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, uint64_t confirmations_required_arg, uint64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, uint64_t inbound_htlc_minimum_msat_arg, uint64_t inbound_htlc_maximum_msat_arg, uint64_t config_arg) {
26987 LDKThirtyTwoBytes channel_id_arg_ref;
26988 CHECK(channel_id_arg->arr_len == 32);
26989 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
26990 LDKChannelCounterparty counterparty_arg_conv;
26991 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
26992 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
26993 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
26994 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
26995 LDKOutPoint funding_txo_arg_conv;
26996 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
26997 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
26998 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
26999 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
27000 LDKChannelTypeFeatures channel_type_arg_conv;
27001 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
27002 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
27003 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
27004 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
27005 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
27006 CHECK_ACCESS(short_channel_id_arg_ptr);
27007 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
27008 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
27009 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
27010 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
27011 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
27012 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
27013 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
27014 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
27015 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
27016 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
27017 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
27018 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
27019 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
27020 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
27021 CHECK_ACCESS(confirmations_required_arg_ptr);
27022 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
27023 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
27024 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
27025 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
27026 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
27027 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
27028 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
27029 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
27030 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
27031 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
27032 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
27033 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
27034 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
27035 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
27036 LDKChannelConfig config_arg_conv;
27037 config_arg_conv.inner = untag_ptr(config_arg);
27038 config_arg_conv.is_owned = ptr_is_owned(config_arg);
27039 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
27040 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
27041 LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv);
27042 uint64_t ret_ref = 0;
27043 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27044 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27048 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
27049 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
27050 uint64_t ret_ref = 0;
27051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27055 int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) {
27056 LDKChannelDetails arg_conv;
27057 arg_conv.inner = untag_ptr(arg);
27058 arg_conv.is_owned = ptr_is_owned(arg);
27059 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27060 arg_conv.is_owned = false;
27061 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
27065 uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) {
27066 LDKChannelDetails orig_conv;
27067 orig_conv.inner = untag_ptr(orig);
27068 orig_conv.is_owned = ptr_is_owned(orig);
27069 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27070 orig_conv.is_owned = false;
27071 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
27072 uint64_t ret_ref = 0;
27073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27078 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) {
27079 LDKChannelDetails this_arg_conv;
27080 this_arg_conv.inner = untag_ptr(this_arg);
27081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27083 this_arg_conv.is_owned = false;
27084 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
27085 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
27086 uint64_t ret_ref = tag_ptr(ret_copy, true);
27090 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) {
27091 LDKChannelDetails this_arg_conv;
27092 this_arg_conv.inner = untag_ptr(this_arg);
27093 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27095 this_arg_conv.is_owned = false;
27096 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
27097 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
27098 uint64_t ret_ref = tag_ptr(ret_copy, true);
27102 void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
27103 if (!ptr_is_owned(this_ptr)) return;
27104 void* this_ptr_ptr = untag_ptr(this_ptr);
27105 CHECK_ACCESS(this_ptr_ptr);
27106 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
27107 FREE(untag_ptr(this_ptr));
27108 PaymentSendFailure_free(this_ptr_conv);
27111 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
27112 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27113 *ret_copy = PaymentSendFailure_clone(arg);
27114 uint64_t ret_ref = tag_ptr(ret_copy, true);
27117 int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
27118 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
27119 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
27123 uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
27124 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
27125 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27126 *ret_copy = PaymentSendFailure_clone(orig_conv);
27127 uint64_t ret_ref = tag_ptr(ret_copy, true);
27131 uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
27132 void* a_ptr = untag_ptr(a);
27133 CHECK_ACCESS(a_ptr);
27134 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
27135 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
27136 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27137 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
27138 uint64_t ret_ref = tag_ptr(ret_copy, true);
27142 uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
27143 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
27144 a_constr.datalen = a->arr_len;
27145 if (a_constr.datalen > 0)
27146 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
27148 a_constr.data = NULL;
27149 uint64_t* a_vals = a->elems;
27150 for (size_t w = 0; w < a_constr.datalen; w++) {
27151 uint64_t a_conv_22 = a_vals[w];
27152 void* a_conv_22_ptr = untag_ptr(a_conv_22);
27153 CHECK_ACCESS(a_conv_22_ptr);
27154 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
27155 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
27156 a_constr.data[w] = a_conv_22_conv;
27159 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27160 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
27161 uint64_t ret_ref = tag_ptr(ret_copy, true);
27165 uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
27166 LDKCVec_APIErrorZ a_constr;
27167 a_constr.datalen = a->arr_len;
27168 if (a_constr.datalen > 0)
27169 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
27171 a_constr.data = NULL;
27172 uint64_t* a_vals = a->elems;
27173 for (size_t k = 0; k < a_constr.datalen; k++) {
27174 uint64_t a_conv_10 = a_vals[k];
27175 void* a_conv_10_ptr = untag_ptr(a_conv_10);
27176 CHECK_ACCESS(a_conv_10_ptr);
27177 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
27178 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
27179 a_constr.data[k] = a_conv_10_conv;
27182 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27183 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
27184 uint64_t ret_ref = tag_ptr(ret_copy, true);
27188 uint64_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) TS_PaymentSendFailure_partial_failure(uint64_tArray results, uint64_t failed_paths_retry, int8_tArray payment_id) {
27189 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
27190 results_constr.datalen = results->arr_len;
27191 if (results_constr.datalen > 0)
27192 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
27194 results_constr.data = NULL;
27195 uint64_t* results_vals = results->elems;
27196 for (size_t w = 0; w < results_constr.datalen; w++) {
27197 uint64_t results_conv_22 = results_vals[w];
27198 void* results_conv_22_ptr = untag_ptr(results_conv_22);
27199 CHECK_ACCESS(results_conv_22_ptr);
27200 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
27201 results_constr.data[w] = results_conv_22_conv;
27204 LDKRouteParameters failed_paths_retry_conv;
27205 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
27206 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
27207 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
27208 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
27209 LDKThirtyTwoBytes payment_id_ref;
27210 CHECK(payment_id->arr_len == 32);
27211 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
27212 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
27213 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
27214 uint64_t ret_ref = tag_ptr(ret_copy, true);
27218 void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) {
27219 LDKPhantomRouteHints this_obj_conv;
27220 this_obj_conv.inner = untag_ptr(this_obj);
27221 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27223 PhantomRouteHints_free(this_obj_conv);
27226 uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) {
27227 LDKPhantomRouteHints this_ptr_conv;
27228 this_ptr_conv.inner = untag_ptr(this_ptr);
27229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27231 this_ptr_conv.is_owned = false;
27232 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
27233 uint64_tArray ret_arr = NULL;
27234 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
27235 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
27236 for (size_t q = 0; q < ret_var.datalen; q++) {
27237 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
27238 uint64_t ret_conv_16_ref = 0;
27239 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
27240 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
27241 ret_arr_ptr[q] = ret_conv_16_ref;
27244 FREE(ret_var.data);
27248 void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) {
27249 LDKPhantomRouteHints this_ptr_conv;
27250 this_ptr_conv.inner = untag_ptr(this_ptr);
27251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27253 this_ptr_conv.is_owned = false;
27254 LDKCVec_ChannelDetailsZ val_constr;
27255 val_constr.datalen = val->arr_len;
27256 if (val_constr.datalen > 0)
27257 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
27259 val_constr.data = NULL;
27260 uint64_t* val_vals = val->elems;
27261 for (size_t q = 0; q < val_constr.datalen; q++) {
27262 uint64_t val_conv_16 = val_vals[q];
27263 LDKChannelDetails val_conv_16_conv;
27264 val_conv_16_conv.inner = untag_ptr(val_conv_16);
27265 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
27266 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
27267 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
27268 val_constr.data[q] = val_conv_16_conv;
27271 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
27274 int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) {
27275 LDKPhantomRouteHints this_ptr_conv;
27276 this_ptr_conv.inner = untag_ptr(this_ptr);
27277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27279 this_ptr_conv.is_owned = false;
27280 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
27284 void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) {
27285 LDKPhantomRouteHints this_ptr_conv;
27286 this_ptr_conv.inner = untag_ptr(this_ptr);
27287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27289 this_ptr_conv.is_owned = false;
27290 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
27293 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) {
27294 LDKPhantomRouteHints this_ptr_conv;
27295 this_ptr_conv.inner = untag_ptr(this_ptr);
27296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27298 this_ptr_conv.is_owned = false;
27299 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27300 memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33);
27304 void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) {
27305 LDKPhantomRouteHints this_ptr_conv;
27306 this_ptr_conv.inner = untag_ptr(this_ptr);
27307 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27309 this_ptr_conv.is_owned = false;
27310 LDKPublicKey val_ref;
27311 CHECK(val->arr_len == 33);
27312 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27313 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
27316 uint64_t __attribute__((export_name("TS_PhantomRouteHints_new"))) TS_PhantomRouteHints_new(uint64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) {
27317 LDKCVec_ChannelDetailsZ channels_arg_constr;
27318 channels_arg_constr.datalen = channels_arg->arr_len;
27319 if (channels_arg_constr.datalen > 0)
27320 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
27322 channels_arg_constr.data = NULL;
27323 uint64_t* channels_arg_vals = channels_arg->elems;
27324 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
27325 uint64_t channels_arg_conv_16 = channels_arg_vals[q];
27326 LDKChannelDetails channels_arg_conv_16_conv;
27327 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
27328 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
27329 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
27330 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
27331 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
27333 FREE(channels_arg);
27334 LDKPublicKey real_node_pubkey_arg_ref;
27335 CHECK(real_node_pubkey_arg->arr_len == 33);
27336 memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
27337 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
27338 uint64_t ret_ref = 0;
27339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27344 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
27345 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
27346 uint64_t ret_ref = 0;
27347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27351 int64_t __attribute__((export_name("TS_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) {
27352 LDKPhantomRouteHints arg_conv;
27353 arg_conv.inner = untag_ptr(arg);
27354 arg_conv.is_owned = ptr_is_owned(arg);
27355 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27356 arg_conv.is_owned = false;
27357 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
27361 uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) {
27362 LDKPhantomRouteHints orig_conv;
27363 orig_conv.inner = untag_ptr(orig);
27364 orig_conv.is_owned = ptr_is_owned(orig);
27365 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27366 orig_conv.is_owned = false;
27367 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
27368 uint64_t ret_ref = 0;
27369 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27370 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27374 uint64_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManager_new(uint64_t fee_est, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t logger, uint64_t keys_manager, uint64_t config, uint64_t params) {
27375 void* fee_est_ptr = untag_ptr(fee_est);
27376 CHECK_ACCESS(fee_est_ptr);
27377 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
27378 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
27379 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27380 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
27382 void* chain_monitor_ptr = untag_ptr(chain_monitor);
27383 CHECK_ACCESS(chain_monitor_ptr);
27384 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
27385 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
27386 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27387 LDKWatch_JCalls_cloned(&chain_monitor_conv);
27389 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
27390 CHECK_ACCESS(tx_broadcaster_ptr);
27391 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
27392 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
27393 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27394 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
27396 void* logger_ptr = untag_ptr(logger);
27397 CHECK_ACCESS(logger_ptr);
27398 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
27399 if (logger_conv.free == LDKLogger_JCalls_free) {
27400 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27401 LDKLogger_JCalls_cloned(&logger_conv);
27403 void* keys_manager_ptr = untag_ptr(keys_manager);
27404 CHECK_ACCESS(keys_manager_ptr);
27405 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
27406 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
27407 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27408 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
27410 LDKUserConfig config_conv;
27411 config_conv.inner = untag_ptr(config);
27412 config_conv.is_owned = ptr_is_owned(config);
27413 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
27414 config_conv = UserConfig_clone(&config_conv);
27415 LDKChainParameters params_conv;
27416 params_conv.inner = untag_ptr(params);
27417 params_conv.is_owned = ptr_is_owned(params);
27418 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
27419 params_conv = ChainParameters_clone(¶ms_conv);
27420 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
27421 uint64_t ret_ref = 0;
27422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27427 uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(uint64_t this_arg) {
27428 LDKChannelManager this_arg_conv;
27429 this_arg_conv.inner = untag_ptr(this_arg);
27430 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27432 this_arg_conv.is_owned = false;
27433 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
27434 uint64_t ret_ref = 0;
27435 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27436 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27440 uint64_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_ChannelManager_create_channel(uint64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, uint64_t override_config) {
27441 LDKChannelManager this_arg_conv;
27442 this_arg_conv.inner = untag_ptr(this_arg);
27443 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27445 this_arg_conv.is_owned = false;
27446 LDKPublicKey their_network_key_ref;
27447 CHECK(their_network_key->arr_len == 33);
27448 memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
27449 LDKUserConfig override_config_conv;
27450 override_config_conv.inner = untag_ptr(override_config);
27451 override_config_conv.is_owned = ptr_is_owned(override_config);
27452 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
27453 override_config_conv = UserConfig_clone(&override_config_conv);
27454 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
27455 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
27456 return tag_ptr(ret_conv, true);
27459 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) {
27460 LDKChannelManager this_arg_conv;
27461 this_arg_conv.inner = untag_ptr(this_arg);
27462 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27464 this_arg_conv.is_owned = false;
27465 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
27466 uint64_tArray ret_arr = NULL;
27467 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
27468 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
27469 for (size_t q = 0; q < ret_var.datalen; q++) {
27470 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
27471 uint64_t ret_conv_16_ref = 0;
27472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
27473 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
27474 ret_arr_ptr[q] = ret_conv_16_ref;
27477 FREE(ret_var.data);
27481 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) {
27482 LDKChannelManager this_arg_conv;
27483 this_arg_conv.inner = untag_ptr(this_arg);
27484 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27486 this_arg_conv.is_owned = false;
27487 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
27488 uint64_tArray ret_arr = NULL;
27489 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
27490 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
27491 for (size_t q = 0; q < ret_var.datalen; q++) {
27492 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
27493 uint64_t ret_conv_16_ref = 0;
27494 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
27495 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
27496 ret_arr_ptr[q] = ret_conv_16_ref;
27499 FREE(ret_var.data);
27503 uint64_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_ChannelManager_close_channel(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
27504 LDKChannelManager this_arg_conv;
27505 this_arg_conv.inner = untag_ptr(this_arg);
27506 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27508 this_arg_conv.is_owned = false;
27509 unsigned char channel_id_arr[32];
27510 CHECK(channel_id->arr_len == 32);
27511 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27512 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27513 LDKPublicKey counterparty_node_id_ref;
27514 CHECK(counterparty_node_id->arr_len == 33);
27515 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27516 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27517 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27518 return tag_ptr(ret_conv, true);
27521 uint64_t __attribute__((export_name("TS_ChannelManager_close_channel_with_target_feerate"))) TS_ChannelManager_close_channel_with_target_feerate(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int32_t target_feerate_sats_per_1000_weight) {
27522 LDKChannelManager this_arg_conv;
27523 this_arg_conv.inner = untag_ptr(this_arg);
27524 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27526 this_arg_conv.is_owned = false;
27527 unsigned char channel_id_arr[32];
27528 CHECK(channel_id->arr_len == 32);
27529 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27530 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27531 LDKPublicKey counterparty_node_id_ref;
27532 CHECK(counterparty_node_id->arr_len == 33);
27533 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27534 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27535 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
27536 return tag_ptr(ret_conv, true);
27539 uint64_t __attribute__((export_name("TS_ChannelManager_force_close_broadcasting_latest_txn"))) TS_ChannelManager_force_close_broadcasting_latest_txn(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
27540 LDKChannelManager this_arg_conv;
27541 this_arg_conv.inner = untag_ptr(this_arg);
27542 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27544 this_arg_conv.is_owned = false;
27545 unsigned char channel_id_arr[32];
27546 CHECK(channel_id->arr_len == 32);
27547 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27548 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27549 LDKPublicKey counterparty_node_id_ref;
27550 CHECK(counterparty_node_id->arr_len == 33);
27551 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27552 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27553 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27554 return tag_ptr(ret_conv, true);
27557 uint64_t __attribute__((export_name("TS_ChannelManager_force_close_without_broadcasting_txn"))) TS_ChannelManager_force_close_without_broadcasting_txn(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
27558 LDKChannelManager this_arg_conv;
27559 this_arg_conv.inner = untag_ptr(this_arg);
27560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27562 this_arg_conv.is_owned = false;
27563 unsigned char channel_id_arr[32];
27564 CHECK(channel_id->arr_len == 32);
27565 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27566 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27567 LDKPublicKey counterparty_node_id_ref;
27568 CHECK(counterparty_node_id->arr_len == 33);
27569 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27570 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27571 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27572 return tag_ptr(ret_conv, true);
27575 void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn"))) TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn(uint64_t this_arg) {
27576 LDKChannelManager this_arg_conv;
27577 this_arg_conv.inner = untag_ptr(this_arg);
27578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27580 this_arg_conv.is_owned = false;
27581 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
27584 void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_without_broadcasting_txn"))) TS_ChannelManager_force_close_all_channels_without_broadcasting_txn(uint64_t this_arg) {
27585 LDKChannelManager this_arg_conv;
27586 this_arg_conv.inner = untag_ptr(this_arg);
27587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27589 this_arg_conv.is_owned = false;
27590 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
27593 uint64_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_ChannelManager_send_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
27594 LDKChannelManager this_arg_conv;
27595 this_arg_conv.inner = untag_ptr(this_arg);
27596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27598 this_arg_conv.is_owned = false;
27599 LDKRoute route_conv;
27600 route_conv.inner = untag_ptr(route);
27601 route_conv.is_owned = ptr_is_owned(route);
27602 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27603 route_conv.is_owned = false;
27604 LDKThirtyTwoBytes payment_hash_ref;
27605 CHECK(payment_hash->arr_len == 32);
27606 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27607 LDKThirtyTwoBytes payment_secret_ref;
27608 CHECK(payment_secret->arr_len == 32);
27609 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
27610 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
27611 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
27612 return tag_ptr(ret_conv, true);
27615 uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
27616 LDKChannelManager this_arg_conv;
27617 this_arg_conv.inner = untag_ptr(this_arg);
27618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27620 this_arg_conv.is_owned = false;
27621 LDKRoute route_conv;
27622 route_conv.inner = untag_ptr(route);
27623 route_conv.is_owned = ptr_is_owned(route);
27624 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27625 route_conv.is_owned = false;
27626 LDKThirtyTwoBytes payment_id_ref;
27627 CHECK(payment_id->arr_len == 32);
27628 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
27629 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
27630 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
27631 return tag_ptr(ret_conv, true);
27634 void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
27635 LDKChannelManager this_arg_conv;
27636 this_arg_conv.inner = untag_ptr(this_arg);
27637 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27639 this_arg_conv.is_owned = false;
27640 LDKThirtyTwoBytes payment_id_ref;
27641 CHECK(payment_id->arr_len == 32);
27642 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
27643 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
27646 uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment"))) TS_ChannelManager_send_spontaneous_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_preimage) {
27647 LDKChannelManager this_arg_conv;
27648 this_arg_conv.inner = untag_ptr(this_arg);
27649 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27651 this_arg_conv.is_owned = false;
27652 LDKRoute route_conv;
27653 route_conv.inner = untag_ptr(route);
27654 route_conv.is_owned = ptr_is_owned(route);
27655 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27656 route_conv.is_owned = false;
27657 LDKThirtyTwoBytes payment_preimage_ref;
27658 CHECK(payment_preimage->arr_len == 32);
27659 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
27660 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
27661 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
27662 return tag_ptr(ret_conv, true);
27665 uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) {
27666 LDKChannelManager this_arg_conv;
27667 this_arg_conv.inner = untag_ptr(this_arg);
27668 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27670 this_arg_conv.is_owned = false;
27671 LDKCVec_RouteHopZ hops_constr;
27672 hops_constr.datalen = hops->arr_len;
27673 if (hops_constr.datalen > 0)
27674 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
27676 hops_constr.data = NULL;
27677 uint64_t* hops_vals = hops->elems;
27678 for (size_t k = 0; k < hops_constr.datalen; k++) {
27679 uint64_t hops_conv_10 = hops_vals[k];
27680 LDKRouteHop hops_conv_10_conv;
27681 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
27682 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
27683 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
27684 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
27685 hops_constr.data[k] = hops_conv_10_conv;
27688 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
27689 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
27690 return tag_ptr(ret_conv, true);
27693 uint64_t __attribute__((export_name("TS_ChannelManager_funding_transaction_generated"))) TS_ChannelManager_funding_transaction_generated(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) {
27694 LDKChannelManager this_arg_conv;
27695 this_arg_conv.inner = untag_ptr(this_arg);
27696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27698 this_arg_conv.is_owned = false;
27699 unsigned char temporary_channel_id_arr[32];
27700 CHECK(temporary_channel_id->arr_len == 32);
27701 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27702 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27703 LDKPublicKey counterparty_node_id_ref;
27704 CHECK(counterparty_node_id->arr_len == 33);
27705 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27706 LDKTransaction funding_transaction_ref;
27707 funding_transaction_ref.datalen = funding_transaction->arr_len;
27708 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
27709 memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction);
27710 funding_transaction_ref.data_is_owned = true;
27711 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27712 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
27713 return tag_ptr(ret_conv, true);
27716 uint64_t __attribute__((export_name("TS_ChannelManager_update_channel_config"))) TS_ChannelManager_update_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, uint64_t config) {
27717 LDKChannelManager this_arg_conv;
27718 this_arg_conv.inner = untag_ptr(this_arg);
27719 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27721 this_arg_conv.is_owned = false;
27722 LDKPublicKey counterparty_node_id_ref;
27723 CHECK(counterparty_node_id->arr_len == 33);
27724 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27725 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
27726 channel_ids_constr.datalen = channel_ids->arr_len;
27727 if (channel_ids_constr.datalen > 0)
27728 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
27730 channel_ids_constr.data = NULL;
27731 int8_tArray* channel_ids_vals = (void*) channel_ids->elems;
27732 for (size_t m = 0; m < channel_ids_constr.datalen; m++) {
27733 int8_tArray channel_ids_conv_12 = channel_ids_vals[m];
27734 LDKThirtyTwoBytes channel_ids_conv_12_ref;
27735 CHECK(channel_ids_conv_12->arr_len == 32);
27736 memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12);
27737 channel_ids_constr.data[m] = channel_ids_conv_12_ref;
27740 LDKChannelConfig config_conv;
27741 config_conv.inner = untag_ptr(config);
27742 config_conv.is_owned = ptr_is_owned(config);
27743 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
27744 config_conv.is_owned = false;
27745 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27746 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
27747 return tag_ptr(ret_conv, true);
27750 void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
27751 LDKChannelManager this_arg_conv;
27752 this_arg_conv.inner = untag_ptr(this_arg);
27753 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27755 this_arg_conv.is_owned = false;
27756 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
27759 void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(uint64_t this_arg) {
27760 LDKChannelManager this_arg_conv;
27761 this_arg_conv.inner = untag_ptr(this_arg);
27762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27764 this_arg_conv.is_owned = false;
27765 ChannelManager_timer_tick_occurred(&this_arg_conv);
27768 void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) {
27769 LDKChannelManager this_arg_conv;
27770 this_arg_conv.inner = untag_ptr(this_arg);
27771 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27773 this_arg_conv.is_owned = false;
27774 unsigned char payment_hash_arr[32];
27775 CHECK(payment_hash->arr_len == 32);
27776 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
27777 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
27778 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
27781 void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
27782 LDKChannelManager this_arg_conv;
27783 this_arg_conv.inner = untag_ptr(this_arg);
27784 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27786 this_arg_conv.is_owned = false;
27787 LDKThirtyTwoBytes payment_preimage_ref;
27788 CHECK(payment_preimage->arr_len == 32);
27789 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
27790 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
27793 int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(uint64_t this_arg) {
27794 LDKChannelManager this_arg_conv;
27795 this_arg_conv.inner = untag_ptr(this_arg);
27796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27798 this_arg_conv.is_owned = false;
27799 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27800 memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
27804 uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel"))) TS_ChannelManager_accept_inbound_channel(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
27805 LDKChannelManager this_arg_conv;
27806 this_arg_conv.inner = untag_ptr(this_arg);
27807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27809 this_arg_conv.is_owned = false;
27810 unsigned char temporary_channel_id_arr[32];
27811 CHECK(temporary_channel_id->arr_len == 32);
27812 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27813 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27814 LDKPublicKey counterparty_node_id_ref;
27815 CHECK(counterparty_node_id->arr_len == 33);
27816 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27817 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27818 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
27819 return tag_ptr(ret_conv, true);
27822 uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf"))) TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
27823 LDKChannelManager this_arg_conv;
27824 this_arg_conv.inner = untag_ptr(this_arg);
27825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27827 this_arg_conv.is_owned = false;
27828 unsigned char temporary_channel_id_arr[32];
27829 CHECK(temporary_channel_id->arr_len == 32);
27830 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27831 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27832 LDKPublicKey counterparty_node_id_ref;
27833 CHECK(counterparty_node_id->arr_len == 33);
27834 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27835 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27836 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
27837 return tag_ptr(ret_conv, true);
27840 uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment"))) TS_ChannelManager_create_inbound_payment(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
27841 LDKChannelManager this_arg_conv;
27842 this_arg_conv.inner = untag_ptr(this_arg);
27843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27845 this_arg_conv.is_owned = false;
27846 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27847 CHECK_ACCESS(min_value_msat_ptr);
27848 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27849 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27850 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
27851 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
27852 return tag_ptr(ret_conv, true);
27855 uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_legacy"))) TS_ChannelManager_create_inbound_payment_legacy(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
27856 LDKChannelManager this_arg_conv;
27857 this_arg_conv.inner = untag_ptr(this_arg);
27858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27860 this_arg_conv.is_owned = false;
27861 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27862 CHECK_ACCESS(min_value_msat_ptr);
27863 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27864 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27865 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
27866 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
27867 return tag_ptr(ret_conv, true);
27870 uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
27871 LDKChannelManager this_arg_conv;
27872 this_arg_conv.inner = untag_ptr(this_arg);
27873 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27875 this_arg_conv.is_owned = false;
27876 LDKThirtyTwoBytes payment_hash_ref;
27877 CHECK(payment_hash->arr_len == 32);
27878 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27879 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27880 CHECK_ACCESS(min_value_msat_ptr);
27881 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27882 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27883 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
27884 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
27885 return tag_ptr(ret_conv, true);
27888 uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash_legacy"))) TS_ChannelManager_create_inbound_payment_for_hash_legacy(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
27889 LDKChannelManager this_arg_conv;
27890 this_arg_conv.inner = untag_ptr(this_arg);
27891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27893 this_arg_conv.is_owned = false;
27894 LDKThirtyTwoBytes payment_hash_ref;
27895 CHECK(payment_hash->arr_len == 32);
27896 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27897 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27898 CHECK_ACCESS(min_value_msat_ptr);
27899 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27900 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27901 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
27902 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
27903 return tag_ptr(ret_conv, true);
27906 uint64_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) TS_ChannelManager_get_payment_preimage(uint64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
27907 LDKChannelManager this_arg_conv;
27908 this_arg_conv.inner = untag_ptr(this_arg);
27909 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27911 this_arg_conv.is_owned = false;
27912 LDKThirtyTwoBytes payment_hash_ref;
27913 CHECK(payment_hash->arr_len == 32);
27914 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27915 LDKThirtyTwoBytes payment_secret_ref;
27916 CHECK(payment_secret->arr_len == 32);
27917 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
27918 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
27919 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
27920 return tag_ptr(ret_conv, true);
27923 int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) {
27924 LDKChannelManager this_arg_conv;
27925 this_arg_conv.inner = untag_ptr(this_arg);
27926 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27928 this_arg_conv.is_owned = false;
27929 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
27933 uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(uint64_t this_arg) {
27934 LDKChannelManager this_arg_conv;
27935 this_arg_conv.inner = untag_ptr(this_arg);
27936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27938 this_arg_conv.is_owned = false;
27939 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
27940 uint64_t ret_ref = 0;
27941 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27942 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27946 uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
27947 LDKChannelManager this_arg_conv;
27948 this_arg_conv.inner = untag_ptr(this_arg);
27949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27951 this_arg_conv.is_owned = false;
27952 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
27953 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
27954 return tag_ptr(ret_ret, true);
27957 uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint64_t this_arg) {
27958 LDKChannelManager this_arg_conv;
27959 this_arg_conv.inner = untag_ptr(this_arg);
27960 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27962 this_arg_conv.is_owned = false;
27963 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
27964 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
27965 return tag_ptr(ret_ret, true);
27968 uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint64_t this_arg) {
27969 LDKChannelManager this_arg_conv;
27970 this_arg_conv.inner = untag_ptr(this_arg);
27971 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27973 this_arg_conv.is_owned = false;
27974 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
27975 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
27976 return tag_ptr(ret_ret, true);
27979 uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint64_t this_arg) {
27980 LDKChannelManager this_arg_conv;
27981 this_arg_conv.inner = untag_ptr(this_arg);
27982 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27984 this_arg_conv.is_owned = false;
27985 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
27986 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
27987 return tag_ptr(ret_ret, true);
27990 void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint64_t this_arg) {
27991 LDKChannelManager this_arg_conv;
27992 this_arg_conv.inner = untag_ptr(this_arg);
27993 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27995 this_arg_conv.is_owned = false;
27996 ChannelManager_await_persistable_update(&this_arg_conv);
27999 uint64_t __attribute__((export_name("TS_ChannelManager_get_persistable_update_future"))) TS_ChannelManager_get_persistable_update_future(uint64_t this_arg) {
28000 LDKChannelManager this_arg_conv;
28001 this_arg_conv.inner = untag_ptr(this_arg);
28002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28004 this_arg_conv.is_owned = false;
28005 LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
28006 uint64_t ret_ref = 0;
28007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28012 uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
28013 LDKChannelManager this_arg_conv;
28014 this_arg_conv.inner = untag_ptr(this_arg);
28015 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28017 this_arg_conv.is_owned = false;
28018 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
28019 uint64_t ret_ref = 0;
28020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28025 uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
28026 LDKChannelManager this_arg_conv;
28027 this_arg_conv.inner = untag_ptr(this_arg);
28028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28030 this_arg_conv.is_owned = false;
28031 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
28032 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
28033 return tag_ptr(ret_ret, true);
28036 uint64_t __attribute__((export_name("TS_provided_node_features"))) TS_provided_node_features() {
28037 LDKNodeFeatures ret_var = provided_node_features();
28038 uint64_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 uint64_t __attribute__((export_name("TS_provided_channel_features"))) TS_provided_channel_features() {
28045 LDKChannelFeatures ret_var = provided_channel_features();
28046 uint64_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);
28052 uint64_t __attribute__((export_name("TS_provided_init_features"))) TS_provided_init_features() {
28053 LDKInitFeatures ret_var = provided_init_features();
28054 uint64_t ret_ref = 0;
28055 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28056 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28060 int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
28061 LDKCounterpartyForwardingInfo obj_conv;
28062 obj_conv.inner = untag_ptr(obj);
28063 obj_conv.is_owned = ptr_is_owned(obj);
28064 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28065 obj_conv.is_owned = false;
28066 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
28067 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28068 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28069 CVec_u8Z_free(ret_var);
28073 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
28074 LDKu8slice ser_ref;
28075 ser_ref.datalen = ser->arr_len;
28076 ser_ref.data = ser->elems;
28077 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
28078 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
28080 return tag_ptr(ret_conv, true);
28083 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) {
28084 LDKChannelCounterparty obj_conv;
28085 obj_conv.inner = untag_ptr(obj);
28086 obj_conv.is_owned = ptr_is_owned(obj);
28087 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28088 obj_conv.is_owned = false;
28089 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
28090 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28091 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28092 CVec_u8Z_free(ret_var);
28096 uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
28097 LDKu8slice ser_ref;
28098 ser_ref.datalen = ser->arr_len;
28099 ser_ref.data = ser->elems;
28100 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
28101 *ret_conv = ChannelCounterparty_read(ser_ref);
28103 return tag_ptr(ret_conv, true);
28106 int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) {
28107 LDKChannelDetails obj_conv;
28108 obj_conv.inner = untag_ptr(obj);
28109 obj_conv.is_owned = ptr_is_owned(obj);
28110 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28111 obj_conv.is_owned = false;
28112 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
28113 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28114 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28115 CVec_u8Z_free(ret_var);
28119 uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
28120 LDKu8slice ser_ref;
28121 ser_ref.datalen = ser->arr_len;
28122 ser_ref.data = ser->elems;
28123 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
28124 *ret_conv = ChannelDetails_read(ser_ref);
28126 return tag_ptr(ret_conv, true);
28129 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) {
28130 LDKPhantomRouteHints obj_conv;
28131 obj_conv.inner = untag_ptr(obj);
28132 obj_conv.is_owned = ptr_is_owned(obj);
28133 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28134 obj_conv.is_owned = false;
28135 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
28136 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28137 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28138 CVec_u8Z_free(ret_var);
28142 uint64_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
28143 LDKu8slice ser_ref;
28144 ser_ref.datalen = ser->arr_len;
28145 ser_ref.data = ser->elems;
28146 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
28147 *ret_conv = PhantomRouteHints_read(ser_ref);
28149 return tag_ptr(ret_conv, true);
28152 int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) {
28153 LDKChannelManager obj_conv;
28154 obj_conv.inner = untag_ptr(obj);
28155 obj_conv.is_owned = ptr_is_owned(obj);
28156 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28157 obj_conv.is_owned = false;
28158 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
28159 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28160 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28161 CVec_u8Z_free(ret_var);
28165 void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) {
28166 LDKChannelManagerReadArgs this_obj_conv;
28167 this_obj_conv.inner = untag_ptr(this_obj);
28168 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28170 ChannelManagerReadArgs_free(this_obj_conv);
28173 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
28174 LDKChannelManagerReadArgs this_ptr_conv;
28175 this_ptr_conv.inner = untag_ptr(this_ptr);
28176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28178 this_ptr_conv.is_owned = false;
28179 // WARNING: This object doesn't live past this scope, needs clone!
28180 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
28184 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
28185 LDKChannelManagerReadArgs this_ptr_conv;
28186 this_ptr_conv.inner = untag_ptr(this_ptr);
28187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28189 this_ptr_conv.is_owned = false;
28190 void* val_ptr = untag_ptr(val);
28191 CHECK_ACCESS(val_ptr);
28192 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
28193 if (val_conv.free == LDKKeysInterface_JCalls_free) {
28194 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28195 LDKKeysInterface_JCalls_cloned(&val_conv);
28197 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
28200 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
28201 LDKChannelManagerReadArgs this_ptr_conv;
28202 this_ptr_conv.inner = untag_ptr(this_ptr);
28203 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28205 this_ptr_conv.is_owned = false;
28206 // WARNING: This object doesn't live past this scope, needs clone!
28207 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
28211 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) {
28212 LDKChannelManagerReadArgs this_ptr_conv;
28213 this_ptr_conv.inner = untag_ptr(this_ptr);
28214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28216 this_ptr_conv.is_owned = false;
28217 void* val_ptr = untag_ptr(val);
28218 CHECK_ACCESS(val_ptr);
28219 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
28220 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
28221 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28222 LDKFeeEstimator_JCalls_cloned(&val_conv);
28224 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
28227 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) {
28228 LDKChannelManagerReadArgs this_ptr_conv;
28229 this_ptr_conv.inner = untag_ptr(this_ptr);
28230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28232 this_ptr_conv.is_owned = false;
28233 // WARNING: This object doesn't live past this scope, needs clone!
28234 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
28238 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) {
28239 LDKChannelManagerReadArgs this_ptr_conv;
28240 this_ptr_conv.inner = untag_ptr(this_ptr);
28241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28243 this_ptr_conv.is_owned = false;
28244 void* val_ptr = untag_ptr(val);
28245 CHECK_ACCESS(val_ptr);
28246 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
28247 if (val_conv.free == LDKWatch_JCalls_free) {
28248 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28249 LDKWatch_JCalls_cloned(&val_conv);
28251 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
28254 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) {
28255 LDKChannelManagerReadArgs this_ptr_conv;
28256 this_ptr_conv.inner = untag_ptr(this_ptr);
28257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28259 this_ptr_conv.is_owned = false;
28260 // WARNING: This object doesn't live past this scope, needs clone!
28261 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
28265 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) {
28266 LDKChannelManagerReadArgs this_ptr_conv;
28267 this_ptr_conv.inner = untag_ptr(this_ptr);
28268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28270 this_ptr_conv.is_owned = false;
28271 void* val_ptr = untag_ptr(val);
28272 CHECK_ACCESS(val_ptr);
28273 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
28274 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
28275 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28276 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
28278 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
28281 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
28282 LDKChannelManagerReadArgs this_ptr_conv;
28283 this_ptr_conv.inner = untag_ptr(this_ptr);
28284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28286 this_ptr_conv.is_owned = false;
28287 // WARNING: This object doesn't live past this scope, needs clone!
28288 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
28292 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) {
28293 LDKChannelManagerReadArgs this_ptr_conv;
28294 this_ptr_conv.inner = untag_ptr(this_ptr);
28295 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28297 this_ptr_conv.is_owned = false;
28298 void* val_ptr = untag_ptr(val);
28299 CHECK_ACCESS(val_ptr);
28300 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
28301 if (val_conv.free == LDKLogger_JCalls_free) {
28302 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28303 LDKLogger_JCalls_cloned(&val_conv);
28305 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
28308 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) {
28309 LDKChannelManagerReadArgs this_ptr_conv;
28310 this_ptr_conv.inner = untag_ptr(this_ptr);
28311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28313 this_ptr_conv.is_owned = false;
28314 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
28315 uint64_t ret_ref = 0;
28316 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28317 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28321 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) {
28322 LDKChannelManagerReadArgs this_ptr_conv;
28323 this_ptr_conv.inner = untag_ptr(this_ptr);
28324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28326 this_ptr_conv.is_owned = false;
28327 LDKUserConfig val_conv;
28328 val_conv.inner = untag_ptr(val);
28329 val_conv.is_owned = ptr_is_owned(val);
28330 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28331 val_conv = UserConfig_clone(&val_conv);
28332 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
28335 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint64_t keys_manager, uint64_t fee_estimator, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t logger, uint64_t default_config, uint64_tArray channel_monitors) {
28336 void* keys_manager_ptr = untag_ptr(keys_manager);
28337 CHECK_ACCESS(keys_manager_ptr);
28338 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
28339 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
28340 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28341 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
28343 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28344 CHECK_ACCESS(fee_estimator_ptr);
28345 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28346 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28347 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28348 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28350 void* chain_monitor_ptr = untag_ptr(chain_monitor);
28351 CHECK_ACCESS(chain_monitor_ptr);
28352 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
28353 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
28354 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28355 LDKWatch_JCalls_cloned(&chain_monitor_conv);
28357 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
28358 CHECK_ACCESS(tx_broadcaster_ptr);
28359 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
28360 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28361 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28362 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
28364 void* logger_ptr = untag_ptr(logger);
28365 CHECK_ACCESS(logger_ptr);
28366 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28367 if (logger_conv.free == LDKLogger_JCalls_free) {
28368 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28369 LDKLogger_JCalls_cloned(&logger_conv);
28371 LDKUserConfig default_config_conv;
28372 default_config_conv.inner = untag_ptr(default_config);
28373 default_config_conv.is_owned = ptr_is_owned(default_config);
28374 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
28375 default_config_conv = UserConfig_clone(&default_config_conv);
28376 LDKCVec_ChannelMonitorZ channel_monitors_constr;
28377 channel_monitors_constr.datalen = channel_monitors->arr_len;
28378 if (channel_monitors_constr.datalen > 0)
28379 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
28381 channel_monitors_constr.data = NULL;
28382 uint64_t* channel_monitors_vals = channel_monitors->elems;
28383 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
28384 uint64_t channel_monitors_conv_16 = channel_monitors_vals[q];
28385 LDKChannelMonitor channel_monitors_conv_16_conv;
28386 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
28387 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
28388 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
28389 channel_monitors_conv_16_conv.is_owned = false;
28390 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
28392 FREE(channel_monitors);
28393 LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
28394 uint64_t ret_ref = 0;
28395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28400 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint64_t arg) {
28401 LDKu8slice ser_ref;
28402 ser_ref.datalen = ser->arr_len;
28403 ser_ref.data = ser->elems;
28404 LDKChannelManagerReadArgs arg_conv;
28405 arg_conv.inner = untag_ptr(arg);
28406 arg_conv.is_owned = ptr_is_owned(arg);
28407 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28408 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
28410 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
28411 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
28413 return tag_ptr(ret_conv, true);
28416 void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) {
28417 LDKExpandedKey this_obj_conv;
28418 this_obj_conv.inner = untag_ptr(this_obj);
28419 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28421 ExpandedKey_free(this_obj_conv);
28424 uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
28425 unsigned char key_material_arr[32];
28426 CHECK(key_material->arr_len == 32);
28427 memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
28428 unsigned char (*key_material_ref)[32] = &key_material_arr;
28429 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
28430 uint64_t ret_ref = 0;
28431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28436 uint64_t __attribute__((export_name("TS_create"))) TS_create(uint64_t keys, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t keys_manager, int64_t current_time) {
28437 LDKExpandedKey keys_conv;
28438 keys_conv.inner = untag_ptr(keys);
28439 keys_conv.is_owned = ptr_is_owned(keys);
28440 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
28441 keys_conv.is_owned = false;
28442 void* min_value_msat_ptr = untag_ptr(min_value_msat);
28443 CHECK_ACCESS(min_value_msat_ptr);
28444 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
28445 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
28446 void* keys_manager_ptr = untag_ptr(keys_manager);
28447 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
28448 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
28449 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
28450 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
28451 return tag_ptr(ret_conv, true);
28454 uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_hash(uint64_t keys, uint64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time) {
28455 LDKExpandedKey keys_conv;
28456 keys_conv.inner = untag_ptr(keys);
28457 keys_conv.is_owned = ptr_is_owned(keys);
28458 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
28459 keys_conv.is_owned = false;
28460 void* min_value_msat_ptr = untag_ptr(min_value_msat);
28461 CHECK_ACCESS(min_value_msat_ptr);
28462 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
28463 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
28464 LDKThirtyTwoBytes payment_hash_ref;
28465 CHECK(payment_hash->arr_len == 32);
28466 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
28467 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
28468 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
28469 return tag_ptr(ret_conv, true);
28472 void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_ptr) {
28473 if (!ptr_is_owned(this_ptr)) return;
28474 void* this_ptr_ptr = untag_ptr(this_ptr);
28475 CHECK_ACCESS(this_ptr_ptr);
28476 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
28477 FREE(untag_ptr(this_ptr));
28478 DecodeError_free(this_ptr_conv);
28481 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
28482 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28483 *ret_copy = DecodeError_clone(arg);
28484 uint64_t ret_ref = tag_ptr(ret_copy, true);
28487 int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
28488 LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
28489 int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
28493 uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
28494 LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
28495 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28496 *ret_copy = DecodeError_clone(orig_conv);
28497 uint64_t ret_ref = tag_ptr(ret_copy, true);
28501 uint64_t __attribute__((export_name("TS_DecodeError_unknown_version"))) TS_DecodeError_unknown_version() {
28502 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28503 *ret_copy = DecodeError_unknown_version();
28504 uint64_t ret_ref = tag_ptr(ret_copy, true);
28508 uint64_t __attribute__((export_name("TS_DecodeError_unknown_required_feature"))) TS_DecodeError_unknown_required_feature() {
28509 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28510 *ret_copy = DecodeError_unknown_required_feature();
28511 uint64_t ret_ref = tag_ptr(ret_copy, true);
28515 uint64_t __attribute__((export_name("TS_DecodeError_invalid_value"))) TS_DecodeError_invalid_value() {
28516 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28517 *ret_copy = DecodeError_invalid_value();
28518 uint64_t ret_ref = tag_ptr(ret_copy, true);
28522 uint64_t __attribute__((export_name("TS_DecodeError_short_read"))) TS_DecodeError_short_read() {
28523 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28524 *ret_copy = DecodeError_short_read();
28525 uint64_t ret_ref = tag_ptr(ret_copy, true);
28529 uint64_t __attribute__((export_name("TS_DecodeError_bad_length_descriptor"))) TS_DecodeError_bad_length_descriptor() {
28530 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28531 *ret_copy = DecodeError_bad_length_descriptor();
28532 uint64_t ret_ref = tag_ptr(ret_copy, true);
28536 uint64_t __attribute__((export_name("TS_DecodeError_io"))) TS_DecodeError_io(uint32_t a) {
28537 LDKIOError a_conv = LDKIOError_from_js(a);
28538 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28539 *ret_copy = DecodeError_io(a_conv);
28540 uint64_t ret_ref = tag_ptr(ret_copy, true);
28544 uint64_t __attribute__((export_name("TS_DecodeError_unsupported_compression"))) TS_DecodeError_unsupported_compression() {
28545 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
28546 *ret_copy = DecodeError_unsupported_compression();
28547 uint64_t ret_ref = tag_ptr(ret_copy, true);
28551 jboolean __attribute__((export_name("TS_DecodeError_eq"))) TS_DecodeError_eq(uint64_t a, uint64_t b) {
28552 LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
28553 LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
28554 jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
28558 void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
28559 LDKInit this_obj_conv;
28560 this_obj_conv.inner = untag_ptr(this_obj);
28561 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28563 Init_free(this_obj_conv);
28566 uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) {
28567 LDKInit this_ptr_conv;
28568 this_ptr_conv.inner = untag_ptr(this_ptr);
28569 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28571 this_ptr_conv.is_owned = false;
28572 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
28573 uint64_t ret_ref = 0;
28574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28579 void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) {
28580 LDKInit this_ptr_conv;
28581 this_ptr_conv.inner = untag_ptr(this_ptr);
28582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28584 this_ptr_conv.is_owned = false;
28585 LDKInitFeatures val_conv;
28586 val_conv.inner = untag_ptr(val);
28587 val_conv.is_owned = ptr_is_owned(val);
28588 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28589 val_conv = InitFeatures_clone(&val_conv);
28590 Init_set_features(&this_ptr_conv, val_conv);
28593 uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) {
28594 LDKInit this_ptr_conv;
28595 this_ptr_conv.inner = untag_ptr(this_ptr);
28596 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28598 this_ptr_conv.is_owned = false;
28599 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
28600 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
28601 uint64_t ret_ref = tag_ptr(ret_copy, true);
28605 void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) {
28606 LDKInit this_ptr_conv;
28607 this_ptr_conv.inner = untag_ptr(this_ptr);
28608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28610 this_ptr_conv.is_owned = false;
28611 void* val_ptr = untag_ptr(val);
28612 CHECK_ACCESS(val_ptr);
28613 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
28614 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
28615 Init_set_remote_network_address(&this_ptr_conv, val_conv);
28618 uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t remote_network_address_arg) {
28619 LDKInitFeatures features_arg_conv;
28620 features_arg_conv.inner = untag_ptr(features_arg);
28621 features_arg_conv.is_owned = ptr_is_owned(features_arg);
28622 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
28623 features_arg_conv = InitFeatures_clone(&features_arg_conv);
28624 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
28625 CHECK_ACCESS(remote_network_address_arg_ptr);
28626 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
28627 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
28628 uint64_t ret_ref = 0;
28629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28634 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
28635 LDKInit ret_var = Init_clone(arg);
28636 uint64_t ret_ref = 0;
28637 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28638 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28641 int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) {
28643 arg_conv.inner = untag_ptr(arg);
28644 arg_conv.is_owned = ptr_is_owned(arg);
28645 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28646 arg_conv.is_owned = false;
28647 int64_t ret_conv = Init_clone_ptr(&arg_conv);
28651 uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) {
28653 orig_conv.inner = untag_ptr(orig);
28654 orig_conv.is_owned = ptr_is_owned(orig);
28655 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28656 orig_conv.is_owned = false;
28657 LDKInit ret_var = Init_clone(&orig_conv);
28658 uint64_t ret_ref = 0;
28659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28664 jboolean __attribute__((export_name("TS_Init_eq"))) TS_Init_eq(uint64_t a, uint64_t b) {
28666 a_conv.inner = untag_ptr(a);
28667 a_conv.is_owned = ptr_is_owned(a);
28668 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28669 a_conv.is_owned = false;
28671 b_conv.inner = untag_ptr(b);
28672 b_conv.is_owned = ptr_is_owned(b);
28673 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28674 b_conv.is_owned = false;
28675 jboolean ret_conv = Init_eq(&a_conv, &b_conv);
28679 void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
28680 LDKErrorMessage this_obj_conv;
28681 this_obj_conv.inner = untag_ptr(this_obj);
28682 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28684 ErrorMessage_free(this_obj_conv);
28687 int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) {
28688 LDKErrorMessage this_ptr_conv;
28689 this_ptr_conv.inner = untag_ptr(this_ptr);
28690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28692 this_ptr_conv.is_owned = false;
28693 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28694 memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32);
28698 void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28699 LDKErrorMessage this_ptr_conv;
28700 this_ptr_conv.inner = untag_ptr(this_ptr);
28701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28703 this_ptr_conv.is_owned = false;
28704 LDKThirtyTwoBytes val_ref;
28705 CHECK(val->arr_len == 32);
28706 memcpy(val_ref.data, val->elems, 32); FREE(val);
28707 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
28710 jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) {
28711 LDKErrorMessage this_ptr_conv;
28712 this_ptr_conv.inner = untag_ptr(this_ptr);
28713 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28715 this_ptr_conv.is_owned = false;
28716 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
28717 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
28722 void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) {
28723 LDKErrorMessage this_ptr_conv;
28724 this_ptr_conv.inner = untag_ptr(this_ptr);
28725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28727 this_ptr_conv.is_owned = false;
28728 LDKStr val_conv = str_ref_to_owned_c(val);
28729 ErrorMessage_set_data(&this_ptr_conv, val_conv);
28732 uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
28733 LDKThirtyTwoBytes channel_id_arg_ref;
28734 CHECK(channel_id_arg->arr_len == 32);
28735 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28736 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
28737 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
28738 uint64_t ret_ref = 0;
28739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28744 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
28745 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
28746 uint64_t ret_ref = 0;
28747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28751 int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) {
28752 LDKErrorMessage arg_conv;
28753 arg_conv.inner = untag_ptr(arg);
28754 arg_conv.is_owned = ptr_is_owned(arg);
28755 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28756 arg_conv.is_owned = false;
28757 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
28761 uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) {
28762 LDKErrorMessage orig_conv;
28763 orig_conv.inner = untag_ptr(orig);
28764 orig_conv.is_owned = ptr_is_owned(orig);
28765 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28766 orig_conv.is_owned = false;
28767 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
28768 uint64_t ret_ref = 0;
28769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28770 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28774 jboolean __attribute__((export_name("TS_ErrorMessage_eq"))) TS_ErrorMessage_eq(uint64_t a, uint64_t b) {
28775 LDKErrorMessage a_conv;
28776 a_conv.inner = untag_ptr(a);
28777 a_conv.is_owned = ptr_is_owned(a);
28778 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28779 a_conv.is_owned = false;
28780 LDKErrorMessage b_conv;
28781 b_conv.inner = untag_ptr(b);
28782 b_conv.is_owned = ptr_is_owned(b);
28783 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28784 b_conv.is_owned = false;
28785 jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
28789 void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
28790 LDKWarningMessage this_obj_conv;
28791 this_obj_conv.inner = untag_ptr(this_obj);
28792 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28794 WarningMessage_free(this_obj_conv);
28797 int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) {
28798 LDKWarningMessage this_ptr_conv;
28799 this_ptr_conv.inner = untag_ptr(this_ptr);
28800 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28802 this_ptr_conv.is_owned = false;
28803 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28804 memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32);
28808 void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28809 LDKWarningMessage this_ptr_conv;
28810 this_ptr_conv.inner = untag_ptr(this_ptr);
28811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28813 this_ptr_conv.is_owned = false;
28814 LDKThirtyTwoBytes val_ref;
28815 CHECK(val->arr_len == 32);
28816 memcpy(val_ref.data, val->elems, 32); FREE(val);
28817 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
28820 jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) {
28821 LDKWarningMessage this_ptr_conv;
28822 this_ptr_conv.inner = untag_ptr(this_ptr);
28823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28825 this_ptr_conv.is_owned = false;
28826 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
28827 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
28832 void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) {
28833 LDKWarningMessage this_ptr_conv;
28834 this_ptr_conv.inner = untag_ptr(this_ptr);
28835 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28837 this_ptr_conv.is_owned = false;
28838 LDKStr val_conv = str_ref_to_owned_c(val);
28839 WarningMessage_set_data(&this_ptr_conv, val_conv);
28842 uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
28843 LDKThirtyTwoBytes channel_id_arg_ref;
28844 CHECK(channel_id_arg->arr_len == 32);
28845 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28846 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
28847 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
28848 uint64_t ret_ref = 0;
28849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28854 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
28855 LDKWarningMessage ret_var = WarningMessage_clone(arg);
28856 uint64_t ret_ref = 0;
28857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28861 int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) {
28862 LDKWarningMessage arg_conv;
28863 arg_conv.inner = untag_ptr(arg);
28864 arg_conv.is_owned = ptr_is_owned(arg);
28865 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28866 arg_conv.is_owned = false;
28867 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
28871 uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) {
28872 LDKWarningMessage orig_conv;
28873 orig_conv.inner = untag_ptr(orig);
28874 orig_conv.is_owned = ptr_is_owned(orig);
28875 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28876 orig_conv.is_owned = false;
28877 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
28878 uint64_t ret_ref = 0;
28879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28884 jboolean __attribute__((export_name("TS_WarningMessage_eq"))) TS_WarningMessage_eq(uint64_t a, uint64_t b) {
28885 LDKWarningMessage a_conv;
28886 a_conv.inner = untag_ptr(a);
28887 a_conv.is_owned = ptr_is_owned(a);
28888 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28889 a_conv.is_owned = false;
28890 LDKWarningMessage b_conv;
28891 b_conv.inner = untag_ptr(b);
28892 b_conv.is_owned = ptr_is_owned(b);
28893 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28894 b_conv.is_owned = false;
28895 jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
28899 void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
28900 LDKPing this_obj_conv;
28901 this_obj_conv.inner = untag_ptr(this_obj);
28902 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28904 Ping_free(this_obj_conv);
28907 int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) {
28908 LDKPing this_ptr_conv;
28909 this_ptr_conv.inner = untag_ptr(this_ptr);
28910 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28912 this_ptr_conv.is_owned = false;
28913 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
28917 void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) {
28918 LDKPing this_ptr_conv;
28919 this_ptr_conv.inner = untag_ptr(this_ptr);
28920 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28922 this_ptr_conv.is_owned = false;
28923 Ping_set_ponglen(&this_ptr_conv, val);
28926 int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) {
28927 LDKPing this_ptr_conv;
28928 this_ptr_conv.inner = untag_ptr(this_ptr);
28929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28931 this_ptr_conv.is_owned = false;
28932 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
28936 void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) {
28937 LDKPing this_ptr_conv;
28938 this_ptr_conv.inner = untag_ptr(this_ptr);
28939 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28941 this_ptr_conv.is_owned = false;
28942 Ping_set_byteslen(&this_ptr_conv, val);
28945 uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
28946 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
28947 uint64_t ret_ref = 0;
28948 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28949 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28953 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
28954 LDKPing ret_var = Ping_clone(arg);
28955 uint64_t ret_ref = 0;
28956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28960 int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) {
28962 arg_conv.inner = untag_ptr(arg);
28963 arg_conv.is_owned = ptr_is_owned(arg);
28964 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28965 arg_conv.is_owned = false;
28966 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
28970 uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) {
28972 orig_conv.inner = untag_ptr(orig);
28973 orig_conv.is_owned = ptr_is_owned(orig);
28974 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28975 orig_conv.is_owned = false;
28976 LDKPing ret_var = Ping_clone(&orig_conv);
28977 uint64_t ret_ref = 0;
28978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28983 jboolean __attribute__((export_name("TS_Ping_eq"))) TS_Ping_eq(uint64_t a, uint64_t b) {
28985 a_conv.inner = untag_ptr(a);
28986 a_conv.is_owned = ptr_is_owned(a);
28987 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28988 a_conv.is_owned = false;
28990 b_conv.inner = untag_ptr(b);
28991 b_conv.is_owned = ptr_is_owned(b);
28992 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28993 b_conv.is_owned = false;
28994 jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
28998 void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
28999 LDKPong this_obj_conv;
29000 this_obj_conv.inner = untag_ptr(this_obj);
29001 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29003 Pong_free(this_obj_conv);
29006 int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) {
29007 LDKPong this_ptr_conv;
29008 this_ptr_conv.inner = untag_ptr(this_ptr);
29009 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29011 this_ptr_conv.is_owned = false;
29012 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
29016 void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) {
29017 LDKPong this_ptr_conv;
29018 this_ptr_conv.inner = untag_ptr(this_ptr);
29019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29021 this_ptr_conv.is_owned = false;
29022 Pong_set_byteslen(&this_ptr_conv, val);
29025 uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) {
29026 LDKPong ret_var = Pong_new(byteslen_arg);
29027 uint64_t ret_ref = 0;
29028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29033 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
29034 LDKPong ret_var = Pong_clone(arg);
29035 uint64_t ret_ref = 0;
29036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29040 int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) {
29042 arg_conv.inner = untag_ptr(arg);
29043 arg_conv.is_owned = ptr_is_owned(arg);
29044 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29045 arg_conv.is_owned = false;
29046 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
29050 uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) {
29052 orig_conv.inner = untag_ptr(orig);
29053 orig_conv.is_owned = ptr_is_owned(orig);
29054 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29055 orig_conv.is_owned = false;
29056 LDKPong ret_var = Pong_clone(&orig_conv);
29057 uint64_t ret_ref = 0;
29058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29059 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29063 jboolean __attribute__((export_name("TS_Pong_eq"))) TS_Pong_eq(uint64_t a, uint64_t b) {
29065 a_conv.inner = untag_ptr(a);
29066 a_conv.is_owned = ptr_is_owned(a);
29067 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29068 a_conv.is_owned = false;
29070 b_conv.inner = untag_ptr(b);
29071 b_conv.is_owned = ptr_is_owned(b);
29072 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29073 b_conv.is_owned = false;
29074 jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
29078 void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
29079 LDKOpenChannel this_obj_conv;
29080 this_obj_conv.inner = untag_ptr(this_obj);
29081 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29083 OpenChannel_free(this_obj_conv);
29086 int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) {
29087 LDKOpenChannel this_ptr_conv;
29088 this_ptr_conv.inner = untag_ptr(this_ptr);
29089 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29091 this_ptr_conv.is_owned = false;
29092 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29093 memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32);
29097 void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
29098 LDKOpenChannel this_ptr_conv;
29099 this_ptr_conv.inner = untag_ptr(this_ptr);
29100 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29102 this_ptr_conv.is_owned = false;
29103 LDKThirtyTwoBytes val_ref;
29104 CHECK(val->arr_len == 32);
29105 memcpy(val_ref.data, val->elems, 32); FREE(val);
29106 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
29109 int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) {
29110 LDKOpenChannel this_ptr_conv;
29111 this_ptr_conv.inner = untag_ptr(this_ptr);
29112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29114 this_ptr_conv.is_owned = false;
29115 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29116 memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32);
29120 void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
29121 LDKOpenChannel this_ptr_conv;
29122 this_ptr_conv.inner = untag_ptr(this_ptr);
29123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29125 this_ptr_conv.is_owned = false;
29126 LDKThirtyTwoBytes val_ref;
29127 CHECK(val->arr_len == 32);
29128 memcpy(val_ref.data, val->elems, 32); FREE(val);
29129 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
29132 int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) {
29133 LDKOpenChannel this_ptr_conv;
29134 this_ptr_conv.inner = untag_ptr(this_ptr);
29135 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29137 this_ptr_conv.is_owned = false;
29138 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
29142 void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) {
29143 LDKOpenChannel this_ptr_conv;
29144 this_ptr_conv.inner = untag_ptr(this_ptr);
29145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29147 this_ptr_conv.is_owned = false;
29148 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
29151 int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) {
29152 LDKOpenChannel this_ptr_conv;
29153 this_ptr_conv.inner = untag_ptr(this_ptr);
29154 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29156 this_ptr_conv.is_owned = false;
29157 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
29161 void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) {
29162 LDKOpenChannel this_ptr_conv;
29163 this_ptr_conv.inner = untag_ptr(this_ptr);
29164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29166 this_ptr_conv.is_owned = false;
29167 OpenChannel_set_push_msat(&this_ptr_conv, val);
29170 int64_t __attribute__((export_name("TS_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
29171 LDKOpenChannel this_ptr_conv;
29172 this_ptr_conv.inner = untag_ptr(this_ptr);
29173 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29175 this_ptr_conv.is_owned = false;
29176 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
29180 void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
29181 LDKOpenChannel this_ptr_conv;
29182 this_ptr_conv.inner = untag_ptr(this_ptr);
29183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29185 this_ptr_conv.is_owned = false;
29186 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
29189 int64_t __attribute__((export_name("TS_OpenChannel_get_max_htlc_value_in_flight_msat"))) TS_OpenChannel_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) {
29190 LDKOpenChannel this_ptr_conv;
29191 this_ptr_conv.inner = untag_ptr(this_ptr);
29192 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29194 this_ptr_conv.is_owned = false;
29195 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
29199 void __attribute__((export_name("TS_OpenChannel_set_max_htlc_value_in_flight_msat"))) TS_OpenChannel_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) {
29200 LDKOpenChannel this_ptr_conv;
29201 this_ptr_conv.inner = untag_ptr(this_ptr);
29202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29204 this_ptr_conv.is_owned = false;
29205 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
29208 int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
29209 LDKOpenChannel this_ptr_conv;
29210 this_ptr_conv.inner = untag_ptr(this_ptr);
29211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29213 this_ptr_conv.is_owned = false;
29214 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
29218 void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
29219 LDKOpenChannel this_ptr_conv;
29220 this_ptr_conv.inner = untag_ptr(this_ptr);
29221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29223 this_ptr_conv.is_owned = false;
29224 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
29227 int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
29228 LDKOpenChannel this_ptr_conv;
29229 this_ptr_conv.inner = untag_ptr(this_ptr);
29230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29232 this_ptr_conv.is_owned = false;
29233 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
29237 void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
29238 LDKOpenChannel this_ptr_conv;
29239 this_ptr_conv.inner = untag_ptr(this_ptr);
29240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29242 this_ptr_conv.is_owned = false;
29243 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
29246 int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) {
29247 LDKOpenChannel this_ptr_conv;
29248 this_ptr_conv.inner = untag_ptr(this_ptr);
29249 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29251 this_ptr_conv.is_owned = false;
29252 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
29256 void __attribute__((export_name("TS_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
29257 LDKOpenChannel this_ptr_conv;
29258 this_ptr_conv.inner = untag_ptr(this_ptr);
29259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29261 this_ptr_conv.is_owned = false;
29262 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
29265 int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) {
29266 LDKOpenChannel this_ptr_conv;
29267 this_ptr_conv.inner = untag_ptr(this_ptr);
29268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29270 this_ptr_conv.is_owned = false;
29271 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
29275 void __attribute__((export_name("TS_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
29276 LDKOpenChannel this_ptr_conv;
29277 this_ptr_conv.inner = untag_ptr(this_ptr);
29278 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29280 this_ptr_conv.is_owned = false;
29281 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
29284 int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
29285 LDKOpenChannel this_ptr_conv;
29286 this_ptr_conv.inner = untag_ptr(this_ptr);
29287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29289 this_ptr_conv.is_owned = false;
29290 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
29294 void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
29295 LDKOpenChannel this_ptr_conv;
29296 this_ptr_conv.inner = untag_ptr(this_ptr);
29297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29299 this_ptr_conv.is_owned = false;
29300 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
29303 int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) {
29304 LDKOpenChannel this_ptr_conv;
29305 this_ptr_conv.inner = untag_ptr(this_ptr);
29306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29308 this_ptr_conv.is_owned = false;
29309 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29310 memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
29314 void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
29315 LDKOpenChannel this_ptr_conv;
29316 this_ptr_conv.inner = untag_ptr(this_ptr);
29317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29319 this_ptr_conv.is_owned = false;
29320 LDKPublicKey val_ref;
29321 CHECK(val->arr_len == 33);
29322 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29323 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
29326 int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) {
29327 LDKOpenChannel this_ptr_conv;
29328 this_ptr_conv.inner = untag_ptr(this_ptr);
29329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29331 this_ptr_conv.is_owned = false;
29332 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29333 memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
29337 void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
29338 LDKOpenChannel this_ptr_conv;
29339 this_ptr_conv.inner = untag_ptr(this_ptr);
29340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29342 this_ptr_conv.is_owned = false;
29343 LDKPublicKey val_ref;
29344 CHECK(val->arr_len == 33);
29345 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29346 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
29349 int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) {
29350 LDKOpenChannel this_ptr_conv;
29351 this_ptr_conv.inner = untag_ptr(this_ptr);
29352 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29354 this_ptr_conv.is_owned = false;
29355 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29356 memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
29360 void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
29361 LDKOpenChannel this_ptr_conv;
29362 this_ptr_conv.inner = untag_ptr(this_ptr);
29363 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29365 this_ptr_conv.is_owned = false;
29366 LDKPublicKey val_ref;
29367 CHECK(val->arr_len == 33);
29368 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29369 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
29372 int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
29373 LDKOpenChannel this_ptr_conv;
29374 this_ptr_conv.inner = untag_ptr(this_ptr);
29375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29377 this_ptr_conv.is_owned = false;
29378 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29379 memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
29383 void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
29384 LDKOpenChannel this_ptr_conv;
29385 this_ptr_conv.inner = untag_ptr(this_ptr);
29386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29388 this_ptr_conv.is_owned = false;
29389 LDKPublicKey val_ref;
29390 CHECK(val->arr_len == 33);
29391 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29392 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
29395 int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) {
29396 LDKOpenChannel this_ptr_conv;
29397 this_ptr_conv.inner = untag_ptr(this_ptr);
29398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29400 this_ptr_conv.is_owned = false;
29401 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29402 memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
29406 void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
29407 LDKOpenChannel this_ptr_conv;
29408 this_ptr_conv.inner = untag_ptr(this_ptr);
29409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29411 this_ptr_conv.is_owned = false;
29412 LDKPublicKey val_ref;
29413 CHECK(val->arr_len == 33);
29414 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29415 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
29418 int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) {
29419 LDKOpenChannel this_ptr_conv;
29420 this_ptr_conv.inner = untag_ptr(this_ptr);
29421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29423 this_ptr_conv.is_owned = false;
29424 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29425 memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29429 void __attribute__((export_name("TS_OpenChannel_set_first_per_commitment_point"))) TS_OpenChannel_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
29430 LDKOpenChannel this_ptr_conv;
29431 this_ptr_conv.inner = untag_ptr(this_ptr);
29432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29434 this_ptr_conv.is_owned = false;
29435 LDKPublicKey val_ref;
29436 CHECK(val->arr_len == 33);
29437 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29438 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
29441 int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) {
29442 LDKOpenChannel this_ptr_conv;
29443 this_ptr_conv.inner = untag_ptr(this_ptr);
29444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29446 this_ptr_conv.is_owned = false;
29447 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
29451 void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) {
29452 LDKOpenChannel this_ptr_conv;
29453 this_ptr_conv.inner = untag_ptr(this_ptr);
29454 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29456 this_ptr_conv.is_owned = false;
29457 OpenChannel_set_channel_flags(&this_ptr_conv, val);
29460 uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) {
29461 LDKOpenChannel this_ptr_conv;
29462 this_ptr_conv.inner = untag_ptr(this_ptr);
29463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29465 this_ptr_conv.is_owned = false;
29466 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
29467 uint64_t ret_ref = 0;
29468 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29469 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29473 void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
29474 LDKOpenChannel this_ptr_conv;
29475 this_ptr_conv.inner = untag_ptr(this_ptr);
29476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29478 this_ptr_conv.is_owned = false;
29479 LDKChannelTypeFeatures val_conv;
29480 val_conv.inner = untag_ptr(val);
29481 val_conv.is_owned = ptr_is_owned(val);
29482 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29483 val_conv = ChannelTypeFeatures_clone(&val_conv);
29484 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
29487 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
29488 LDKOpenChannel ret_var = OpenChannel_clone(arg);
29489 uint64_t ret_ref = 0;
29490 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29491 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29494 int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) {
29495 LDKOpenChannel arg_conv;
29496 arg_conv.inner = untag_ptr(arg);
29497 arg_conv.is_owned = ptr_is_owned(arg);
29498 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29499 arg_conv.is_owned = false;
29500 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
29504 uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) {
29505 LDKOpenChannel orig_conv;
29506 orig_conv.inner = untag_ptr(orig);
29507 orig_conv.is_owned = ptr_is_owned(orig);
29508 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29509 orig_conv.is_owned = false;
29510 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
29511 uint64_t ret_ref = 0;
29512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29517 jboolean __attribute__((export_name("TS_OpenChannel_eq"))) TS_OpenChannel_eq(uint64_t a, uint64_t b) {
29518 LDKOpenChannel a_conv;
29519 a_conv.inner = untag_ptr(a);
29520 a_conv.is_owned = ptr_is_owned(a);
29521 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29522 a_conv.is_owned = false;
29523 LDKOpenChannel b_conv;
29524 b_conv.inner = untag_ptr(b);
29525 b_conv.is_owned = ptr_is_owned(b);
29526 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29527 b_conv.is_owned = false;
29528 jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
29532 void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
29533 LDKAcceptChannel this_obj_conv;
29534 this_obj_conv.inner = untag_ptr(this_obj);
29535 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29537 AcceptChannel_free(this_obj_conv);
29540 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) {
29541 LDKAcceptChannel this_ptr_conv;
29542 this_ptr_conv.inner = untag_ptr(this_ptr);
29543 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29545 this_ptr_conv.is_owned = false;
29546 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29547 memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32);
29551 void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
29552 LDKAcceptChannel this_ptr_conv;
29553 this_ptr_conv.inner = untag_ptr(this_ptr);
29554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29556 this_ptr_conv.is_owned = false;
29557 LDKThirtyTwoBytes val_ref;
29558 CHECK(val->arr_len == 32);
29559 memcpy(val_ref.data, val->elems, 32); FREE(val);
29560 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
29563 int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
29564 LDKAcceptChannel this_ptr_conv;
29565 this_ptr_conv.inner = untag_ptr(this_ptr);
29566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29568 this_ptr_conv.is_owned = false;
29569 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
29573 void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
29574 LDKAcceptChannel this_ptr_conv;
29575 this_ptr_conv.inner = untag_ptr(this_ptr);
29576 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29578 this_ptr_conv.is_owned = false;
29579 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
29582 int64_t __attribute__((export_name("TS_AcceptChannel_get_max_htlc_value_in_flight_msat"))) TS_AcceptChannel_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) {
29583 LDKAcceptChannel this_ptr_conv;
29584 this_ptr_conv.inner = untag_ptr(this_ptr);
29585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29587 this_ptr_conv.is_owned = false;
29588 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
29592 void __attribute__((export_name("TS_AcceptChannel_set_max_htlc_value_in_flight_msat"))) TS_AcceptChannel_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) {
29593 LDKAcceptChannel this_ptr_conv;
29594 this_ptr_conv.inner = untag_ptr(this_ptr);
29595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29597 this_ptr_conv.is_owned = false;
29598 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
29601 int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
29602 LDKAcceptChannel this_ptr_conv;
29603 this_ptr_conv.inner = untag_ptr(this_ptr);
29604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29606 this_ptr_conv.is_owned = false;
29607 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
29611 void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
29612 LDKAcceptChannel this_ptr_conv;
29613 this_ptr_conv.inner = untag_ptr(this_ptr);
29614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29616 this_ptr_conv.is_owned = false;
29617 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
29620 int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
29621 LDKAcceptChannel this_ptr_conv;
29622 this_ptr_conv.inner = untag_ptr(this_ptr);
29623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29625 this_ptr_conv.is_owned = false;
29626 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
29630 void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
29631 LDKAcceptChannel this_ptr_conv;
29632 this_ptr_conv.inner = untag_ptr(this_ptr);
29633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29635 this_ptr_conv.is_owned = false;
29636 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
29639 int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) {
29640 LDKAcceptChannel this_ptr_conv;
29641 this_ptr_conv.inner = untag_ptr(this_ptr);
29642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29644 this_ptr_conv.is_owned = false;
29645 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
29649 void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) {
29650 LDKAcceptChannel this_ptr_conv;
29651 this_ptr_conv.inner = untag_ptr(this_ptr);
29652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29654 this_ptr_conv.is_owned = false;
29655 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
29658 int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) {
29659 LDKAcceptChannel this_ptr_conv;
29660 this_ptr_conv.inner = untag_ptr(this_ptr);
29661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29663 this_ptr_conv.is_owned = false;
29664 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
29668 void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
29669 LDKAcceptChannel this_ptr_conv;
29670 this_ptr_conv.inner = untag_ptr(this_ptr);
29671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29673 this_ptr_conv.is_owned = false;
29674 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
29677 int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
29678 LDKAcceptChannel this_ptr_conv;
29679 this_ptr_conv.inner = untag_ptr(this_ptr);
29680 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29682 this_ptr_conv.is_owned = false;
29683 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
29687 void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
29688 LDKAcceptChannel this_ptr_conv;
29689 this_ptr_conv.inner = untag_ptr(this_ptr);
29690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29692 this_ptr_conv.is_owned = false;
29693 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
29696 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) {
29697 LDKAcceptChannel this_ptr_conv;
29698 this_ptr_conv.inner = untag_ptr(this_ptr);
29699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29701 this_ptr_conv.is_owned = false;
29702 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29703 memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
29707 void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
29708 LDKAcceptChannel this_ptr_conv;
29709 this_ptr_conv.inner = untag_ptr(this_ptr);
29710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29712 this_ptr_conv.is_owned = false;
29713 LDKPublicKey val_ref;
29714 CHECK(val->arr_len == 33);
29715 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29716 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
29719 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) {
29720 LDKAcceptChannel this_ptr_conv;
29721 this_ptr_conv.inner = untag_ptr(this_ptr);
29722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29724 this_ptr_conv.is_owned = false;
29725 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29726 memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
29730 void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
29731 LDKAcceptChannel this_ptr_conv;
29732 this_ptr_conv.inner = untag_ptr(this_ptr);
29733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29735 this_ptr_conv.is_owned = false;
29736 LDKPublicKey val_ref;
29737 CHECK(val->arr_len == 33);
29738 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29739 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
29742 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) {
29743 LDKAcceptChannel this_ptr_conv;
29744 this_ptr_conv.inner = untag_ptr(this_ptr);
29745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29747 this_ptr_conv.is_owned = false;
29748 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29749 memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
29753 void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
29754 LDKAcceptChannel this_ptr_conv;
29755 this_ptr_conv.inner = untag_ptr(this_ptr);
29756 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29758 this_ptr_conv.is_owned = false;
29759 LDKPublicKey val_ref;
29760 CHECK(val->arr_len == 33);
29761 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29762 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
29765 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
29766 LDKAcceptChannel this_ptr_conv;
29767 this_ptr_conv.inner = untag_ptr(this_ptr);
29768 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29770 this_ptr_conv.is_owned = false;
29771 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29772 memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
29776 void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
29777 LDKAcceptChannel this_ptr_conv;
29778 this_ptr_conv.inner = untag_ptr(this_ptr);
29779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29781 this_ptr_conv.is_owned = false;
29782 LDKPublicKey val_ref;
29783 CHECK(val->arr_len == 33);
29784 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29785 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
29788 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) {
29789 LDKAcceptChannel this_ptr_conv;
29790 this_ptr_conv.inner = untag_ptr(this_ptr);
29791 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29793 this_ptr_conv.is_owned = false;
29794 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29795 memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
29799 void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
29800 LDKAcceptChannel this_ptr_conv;
29801 this_ptr_conv.inner = untag_ptr(this_ptr);
29802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29804 this_ptr_conv.is_owned = false;
29805 LDKPublicKey val_ref;
29806 CHECK(val->arr_len == 33);
29807 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29808 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
29811 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) {
29812 LDKAcceptChannel this_ptr_conv;
29813 this_ptr_conv.inner = untag_ptr(this_ptr);
29814 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29816 this_ptr_conv.is_owned = false;
29817 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29818 memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29822 void __attribute__((export_name("TS_AcceptChannel_set_first_per_commitment_point"))) TS_AcceptChannel_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
29823 LDKAcceptChannel this_ptr_conv;
29824 this_ptr_conv.inner = untag_ptr(this_ptr);
29825 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29827 this_ptr_conv.is_owned = false;
29828 LDKPublicKey val_ref;
29829 CHECK(val->arr_len == 33);
29830 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29831 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
29834 uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) {
29835 LDKAcceptChannel this_ptr_conv;
29836 this_ptr_conv.inner = untag_ptr(this_ptr);
29837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29839 this_ptr_conv.is_owned = false;
29840 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
29841 uint64_t ret_ref = 0;
29842 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29843 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29847 void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
29848 LDKAcceptChannel this_ptr_conv;
29849 this_ptr_conv.inner = untag_ptr(this_ptr);
29850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29852 this_ptr_conv.is_owned = false;
29853 LDKChannelTypeFeatures val_conv;
29854 val_conv.inner = untag_ptr(val);
29855 val_conv.is_owned = ptr_is_owned(val);
29856 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29857 val_conv = ChannelTypeFeatures_clone(&val_conv);
29858 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
29861 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
29862 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
29863 uint64_t ret_ref = 0;
29864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29868 int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint64_t arg) {
29869 LDKAcceptChannel arg_conv;
29870 arg_conv.inner = untag_ptr(arg);
29871 arg_conv.is_owned = ptr_is_owned(arg);
29872 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29873 arg_conv.is_owned = false;
29874 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
29878 uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChannel_clone(uint64_t orig) {
29879 LDKAcceptChannel orig_conv;
29880 orig_conv.inner = untag_ptr(orig);
29881 orig_conv.is_owned = ptr_is_owned(orig);
29882 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29883 orig_conv.is_owned = false;
29884 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
29885 uint64_t ret_ref = 0;
29886 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29887 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29891 jboolean __attribute__((export_name("TS_AcceptChannel_eq"))) TS_AcceptChannel_eq(uint64_t a, uint64_t b) {
29892 LDKAcceptChannel a_conv;
29893 a_conv.inner = untag_ptr(a);
29894 a_conv.is_owned = ptr_is_owned(a);
29895 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29896 a_conv.is_owned = false;
29897 LDKAcceptChannel b_conv;
29898 b_conv.inner = untag_ptr(b);
29899 b_conv.is_owned = ptr_is_owned(b);
29900 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29901 b_conv.is_owned = false;
29902 jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
29906 void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
29907 LDKFundingCreated this_obj_conv;
29908 this_obj_conv.inner = untag_ptr(this_obj);
29909 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29911 FundingCreated_free(this_obj_conv);
29914 int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) {
29915 LDKFundingCreated this_ptr_conv;
29916 this_ptr_conv.inner = untag_ptr(this_ptr);
29917 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29919 this_ptr_conv.is_owned = false;
29920 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29921 memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32);
29925 void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
29926 LDKFundingCreated this_ptr_conv;
29927 this_ptr_conv.inner = untag_ptr(this_ptr);
29928 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29929 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29930 this_ptr_conv.is_owned = false;
29931 LDKThirtyTwoBytes val_ref;
29932 CHECK(val->arr_len == 32);
29933 memcpy(val_ref.data, val->elems, 32); FREE(val);
29934 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
29937 int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) {
29938 LDKFundingCreated this_ptr_conv;
29939 this_ptr_conv.inner = untag_ptr(this_ptr);
29940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29942 this_ptr_conv.is_owned = false;
29943 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29944 memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32);
29948 void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_FundingCreated_set_funding_txid(uint64_t this_ptr, int8_tArray val) {
29949 LDKFundingCreated this_ptr_conv;
29950 this_ptr_conv.inner = untag_ptr(this_ptr);
29951 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29953 this_ptr_conv.is_owned = false;
29954 LDKThirtyTwoBytes val_ref;
29955 CHECK(val->arr_len == 32);
29956 memcpy(val_ref.data, val->elems, 32); FREE(val);
29957 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
29960 int16_t __attribute__((export_name("TS_FundingCreated_get_funding_output_index"))) TS_FundingCreated_get_funding_output_index(uint64_t this_ptr) {
29961 LDKFundingCreated this_ptr_conv;
29962 this_ptr_conv.inner = untag_ptr(this_ptr);
29963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29965 this_ptr_conv.is_owned = false;
29966 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
29970 void __attribute__((export_name("TS_FundingCreated_set_funding_output_index"))) TS_FundingCreated_set_funding_output_index(uint64_t this_ptr, int16_t val) {
29971 LDKFundingCreated this_ptr_conv;
29972 this_ptr_conv.inner = untag_ptr(this_ptr);
29973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29975 this_ptr_conv.is_owned = false;
29976 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
29979 int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_FundingCreated_get_signature(uint64_t this_ptr) {
29980 LDKFundingCreated this_ptr_conv;
29981 this_ptr_conv.inner = untag_ptr(this_ptr);
29982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29984 this_ptr_conv.is_owned = false;
29985 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29986 memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
29990 void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_FundingCreated_set_signature(uint64_t this_ptr, int8_tArray val) {
29991 LDKFundingCreated this_ptr_conv;
29992 this_ptr_conv.inner = untag_ptr(this_ptr);
29993 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29995 this_ptr_conv.is_owned = false;
29996 LDKSignature val_ref;
29997 CHECK(val->arr_len == 64);
29998 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29999 FundingCreated_set_signature(&this_ptr_conv, val_ref);
30002 uint64_t __attribute__((export_name("TS_FundingCreated_new"))) TS_FundingCreated_new(int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) {
30003 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
30004 CHECK(temporary_channel_id_arg->arr_len == 32);
30005 memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg);
30006 LDKThirtyTwoBytes funding_txid_arg_ref;
30007 CHECK(funding_txid_arg->arr_len == 32);
30008 memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg);
30009 LDKSignature signature_arg_ref;
30010 CHECK(signature_arg->arr_len == 64);
30011 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30012 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
30013 uint64_t ret_ref = 0;
30014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30019 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
30020 LDKFundingCreated ret_var = FundingCreated_clone(arg);
30021 uint64_t ret_ref = 0;
30022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30026 int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint64_t arg) {
30027 LDKFundingCreated arg_conv;
30028 arg_conv.inner = untag_ptr(arg);
30029 arg_conv.is_owned = ptr_is_owned(arg);
30030 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30031 arg_conv.is_owned = false;
30032 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
30036 uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCreated_clone(uint64_t orig) {
30037 LDKFundingCreated orig_conv;
30038 orig_conv.inner = untag_ptr(orig);
30039 orig_conv.is_owned = ptr_is_owned(orig);
30040 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30041 orig_conv.is_owned = false;
30042 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
30043 uint64_t ret_ref = 0;
30044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30049 jboolean __attribute__((export_name("TS_FundingCreated_eq"))) TS_FundingCreated_eq(uint64_t a, uint64_t b) {
30050 LDKFundingCreated a_conv;
30051 a_conv.inner = untag_ptr(a);
30052 a_conv.is_owned = ptr_is_owned(a);
30053 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30054 a_conv.is_owned = false;
30055 LDKFundingCreated b_conv;
30056 b_conv.inner = untag_ptr(b);
30057 b_conv.is_owned = ptr_is_owned(b);
30058 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30059 b_conv.is_owned = false;
30060 jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
30064 void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
30065 LDKFundingSigned this_obj_conv;
30066 this_obj_conv.inner = untag_ptr(this_obj);
30067 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30068 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30069 FundingSigned_free(this_obj_conv);
30072 int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) {
30073 LDKFundingSigned this_ptr_conv;
30074 this_ptr_conv.inner = untag_ptr(this_ptr);
30075 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30077 this_ptr_conv.is_owned = false;
30078 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30079 memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32);
30083 void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30084 LDKFundingSigned this_ptr_conv;
30085 this_ptr_conv.inner = untag_ptr(this_ptr);
30086 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30088 this_ptr_conv.is_owned = false;
30089 LDKThirtyTwoBytes val_ref;
30090 CHECK(val->arr_len == 32);
30091 memcpy(val_ref.data, val->elems, 32); FREE(val);
30092 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
30095 int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) {
30096 LDKFundingSigned this_ptr_conv;
30097 this_ptr_conv.inner = untag_ptr(this_ptr);
30098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30100 this_ptr_conv.is_owned = false;
30101 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30102 memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
30106 void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
30107 LDKFundingSigned this_ptr_conv;
30108 this_ptr_conv.inner = untag_ptr(this_ptr);
30109 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30111 this_ptr_conv.is_owned = false;
30112 LDKSignature val_ref;
30113 CHECK(val->arr_len == 64);
30114 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30115 FundingSigned_set_signature(&this_ptr_conv, val_ref);
30118 uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) {
30119 LDKThirtyTwoBytes channel_id_arg_ref;
30120 CHECK(channel_id_arg->arr_len == 32);
30121 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30122 LDKSignature signature_arg_ref;
30123 CHECK(signature_arg->arr_len == 64);
30124 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30125 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
30126 uint64_t ret_ref = 0;
30127 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30128 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30132 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
30133 LDKFundingSigned ret_var = FundingSigned_clone(arg);
30134 uint64_t ret_ref = 0;
30135 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30136 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30139 int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint64_t arg) {
30140 LDKFundingSigned arg_conv;
30141 arg_conv.inner = untag_ptr(arg);
30142 arg_conv.is_owned = ptr_is_owned(arg);
30143 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30144 arg_conv.is_owned = false;
30145 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
30149 uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigned_clone(uint64_t orig) {
30150 LDKFundingSigned orig_conv;
30151 orig_conv.inner = untag_ptr(orig);
30152 orig_conv.is_owned = ptr_is_owned(orig);
30153 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30154 orig_conv.is_owned = false;
30155 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
30156 uint64_t ret_ref = 0;
30157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30162 jboolean __attribute__((export_name("TS_FundingSigned_eq"))) TS_FundingSigned_eq(uint64_t a, uint64_t b) {
30163 LDKFundingSigned a_conv;
30164 a_conv.inner = untag_ptr(a);
30165 a_conv.is_owned = ptr_is_owned(a);
30166 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30167 a_conv.is_owned = false;
30168 LDKFundingSigned b_conv;
30169 b_conv.inner = untag_ptr(b);
30170 b_conv.is_owned = ptr_is_owned(b);
30171 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30172 b_conv.is_owned = false;
30173 jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
30177 void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
30178 LDKChannelReady this_obj_conv;
30179 this_obj_conv.inner = untag_ptr(this_obj);
30180 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30182 ChannelReady_free(this_obj_conv);
30185 int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) {
30186 LDKChannelReady this_ptr_conv;
30187 this_ptr_conv.inner = untag_ptr(this_ptr);
30188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30190 this_ptr_conv.is_owned = false;
30191 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30192 memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32);
30196 void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30197 LDKChannelReady this_ptr_conv;
30198 this_ptr_conv.inner = untag_ptr(this_ptr);
30199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30201 this_ptr_conv.is_owned = false;
30202 LDKThirtyTwoBytes val_ref;
30203 CHECK(val->arr_len == 32);
30204 memcpy(val_ref.data, val->elems, 32); FREE(val);
30205 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
30208 int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) {
30209 LDKChannelReady this_ptr_conv;
30210 this_ptr_conv.inner = untag_ptr(this_ptr);
30211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30213 this_ptr_conv.is_owned = false;
30214 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30215 memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
30219 void __attribute__((export_name("TS_ChannelReady_set_next_per_commitment_point"))) TS_ChannelReady_set_next_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
30220 LDKChannelReady this_ptr_conv;
30221 this_ptr_conv.inner = untag_ptr(this_ptr);
30222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30224 this_ptr_conv.is_owned = false;
30225 LDKPublicKey val_ref;
30226 CHECK(val->arr_len == 33);
30227 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30228 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
30231 uint64_t __attribute__((export_name("TS_ChannelReady_get_short_channel_id_alias"))) TS_ChannelReady_get_short_channel_id_alias(uint64_t this_ptr) {
30232 LDKChannelReady this_ptr_conv;
30233 this_ptr_conv.inner = untag_ptr(this_ptr);
30234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30236 this_ptr_conv.is_owned = false;
30237 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30238 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
30239 uint64_t ret_ref = tag_ptr(ret_copy, true);
30243 void __attribute__((export_name("TS_ChannelReady_set_short_channel_id_alias"))) TS_ChannelReady_set_short_channel_id_alias(uint64_t this_ptr, uint64_t val) {
30244 LDKChannelReady this_ptr_conv;
30245 this_ptr_conv.inner = untag_ptr(this_ptr);
30246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30248 this_ptr_conv.is_owned = false;
30249 void* val_ptr = untag_ptr(val);
30250 CHECK_ACCESS(val_ptr);
30251 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30252 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30253 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
30256 uint64_t __attribute__((export_name("TS_ChannelReady_new"))) TS_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, uint64_t short_channel_id_alias_arg) {
30257 LDKThirtyTwoBytes channel_id_arg_ref;
30258 CHECK(channel_id_arg->arr_len == 32);
30259 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30260 LDKPublicKey next_per_commitment_point_arg_ref;
30261 CHECK(next_per_commitment_point_arg->arr_len == 33);
30262 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
30263 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
30264 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
30265 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
30266 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
30267 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
30268 uint64_t ret_ref = 0;
30269 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30270 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30274 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
30275 LDKChannelReady ret_var = ChannelReady_clone(arg);
30276 uint64_t ret_ref = 0;
30277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30281 int64_t __attribute__((export_name("TS_ChannelReady_clone_ptr"))) TS_ChannelReady_clone_ptr(uint64_t arg) {
30282 LDKChannelReady arg_conv;
30283 arg_conv.inner = untag_ptr(arg);
30284 arg_conv.is_owned = ptr_is_owned(arg);
30285 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30286 arg_conv.is_owned = false;
30287 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
30291 uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_clone(uint64_t orig) {
30292 LDKChannelReady orig_conv;
30293 orig_conv.inner = untag_ptr(orig);
30294 orig_conv.is_owned = ptr_is_owned(orig);
30295 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30296 orig_conv.is_owned = false;
30297 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
30298 uint64_t ret_ref = 0;
30299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30304 jboolean __attribute__((export_name("TS_ChannelReady_eq"))) TS_ChannelReady_eq(uint64_t a, uint64_t b) {
30305 LDKChannelReady a_conv;
30306 a_conv.inner = untag_ptr(a);
30307 a_conv.is_owned = ptr_is_owned(a);
30308 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30309 a_conv.is_owned = false;
30310 LDKChannelReady b_conv;
30311 b_conv.inner = untag_ptr(b);
30312 b_conv.is_owned = ptr_is_owned(b);
30313 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30314 b_conv.is_owned = false;
30315 jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
30319 void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
30320 LDKShutdown this_obj_conv;
30321 this_obj_conv.inner = untag_ptr(this_obj);
30322 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30324 Shutdown_free(this_obj_conv);
30327 int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) {
30328 LDKShutdown this_ptr_conv;
30329 this_ptr_conv.inner = untag_ptr(this_ptr);
30330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30332 this_ptr_conv.is_owned = false;
30333 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30334 memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32);
30338 void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30339 LDKShutdown this_ptr_conv;
30340 this_ptr_conv.inner = untag_ptr(this_ptr);
30341 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30343 this_ptr_conv.is_owned = false;
30344 LDKThirtyTwoBytes val_ref;
30345 CHECK(val->arr_len == 32);
30346 memcpy(val_ref.data, val->elems, 32); FREE(val);
30347 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
30350 int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) {
30351 LDKShutdown this_ptr_conv;
30352 this_ptr_conv.inner = untag_ptr(this_ptr);
30353 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30355 this_ptr_conv.is_owned = false;
30356 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
30357 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
30358 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
30362 void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_set_scriptpubkey(uint64_t this_ptr, int8_tArray val) {
30363 LDKShutdown this_ptr_conv;
30364 this_ptr_conv.inner = untag_ptr(this_ptr);
30365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30367 this_ptr_conv.is_owned = false;
30368 LDKCVec_u8Z val_ref;
30369 val_ref.datalen = val->arr_len;
30370 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
30371 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
30372 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
30375 uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
30376 LDKThirtyTwoBytes channel_id_arg_ref;
30377 CHECK(channel_id_arg->arr_len == 32);
30378 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30379 LDKCVec_u8Z scriptpubkey_arg_ref;
30380 scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len;
30381 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
30382 memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg);
30383 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
30384 uint64_t ret_ref = 0;
30385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30390 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
30391 LDKShutdown ret_var = Shutdown_clone(arg);
30392 uint64_t ret_ref = 0;
30393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30397 int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint64_t arg) {
30398 LDKShutdown arg_conv;
30399 arg_conv.inner = untag_ptr(arg);
30400 arg_conv.is_owned = ptr_is_owned(arg);
30401 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30402 arg_conv.is_owned = false;
30403 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
30407 uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(uint64_t orig) {
30408 LDKShutdown orig_conv;
30409 orig_conv.inner = untag_ptr(orig);
30410 orig_conv.is_owned = ptr_is_owned(orig);
30411 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30412 orig_conv.is_owned = false;
30413 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
30414 uint64_t ret_ref = 0;
30415 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30416 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30420 jboolean __attribute__((export_name("TS_Shutdown_eq"))) TS_Shutdown_eq(uint64_t a, uint64_t b) {
30421 LDKShutdown a_conv;
30422 a_conv.inner = untag_ptr(a);
30423 a_conv.is_owned = ptr_is_owned(a);
30424 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30425 a_conv.is_owned = false;
30426 LDKShutdown b_conv;
30427 b_conv.inner = untag_ptr(b);
30428 b_conv.is_owned = ptr_is_owned(b);
30429 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30430 b_conv.is_owned = false;
30431 jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
30435 void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
30436 LDKClosingSignedFeeRange this_obj_conv;
30437 this_obj_conv.inner = untag_ptr(this_obj);
30438 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30440 ClosingSignedFeeRange_free(this_obj_conv);
30443 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_min_fee_satoshis"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint64_t this_ptr) {
30444 LDKClosingSignedFeeRange this_ptr_conv;
30445 this_ptr_conv.inner = untag_ptr(this_ptr);
30446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30448 this_ptr_conv.is_owned = false;
30449 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
30453 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_min_fee_satoshis"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint64_t this_ptr, int64_t val) {
30454 LDKClosingSignedFeeRange this_ptr_conv;
30455 this_ptr_conv.inner = untag_ptr(this_ptr);
30456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30458 this_ptr_conv.is_owned = false;
30459 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
30462 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_max_fee_satoshis"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint64_t this_ptr) {
30463 LDKClosingSignedFeeRange this_ptr_conv;
30464 this_ptr_conv.inner = untag_ptr(this_ptr);
30465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30467 this_ptr_conv.is_owned = false;
30468 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
30472 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
30473 LDKClosingSignedFeeRange this_ptr_conv;
30474 this_ptr_conv.inner = untag_ptr(this_ptr);
30475 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30477 this_ptr_conv.is_owned = false;
30478 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
30481 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
30482 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
30483 uint64_t ret_ref = 0;
30484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30489 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
30490 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
30491 uint64_t ret_ref = 0;
30492 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30493 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30496 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint64_t arg) {
30497 LDKClosingSignedFeeRange arg_conv;
30498 arg_conv.inner = untag_ptr(arg);
30499 arg_conv.is_owned = ptr_is_owned(arg);
30500 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30501 arg_conv.is_owned = false;
30502 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
30506 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_ClosingSignedFeeRange_clone(uint64_t orig) {
30507 LDKClosingSignedFeeRange orig_conv;
30508 orig_conv.inner = untag_ptr(orig);
30509 orig_conv.is_owned = ptr_is_owned(orig);
30510 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30511 orig_conv.is_owned = false;
30512 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
30513 uint64_t ret_ref = 0;
30514 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30515 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30519 jboolean __attribute__((export_name("TS_ClosingSignedFeeRange_eq"))) TS_ClosingSignedFeeRange_eq(uint64_t a, uint64_t b) {
30520 LDKClosingSignedFeeRange a_conv;
30521 a_conv.inner = untag_ptr(a);
30522 a_conv.is_owned = ptr_is_owned(a);
30523 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30524 a_conv.is_owned = false;
30525 LDKClosingSignedFeeRange b_conv;
30526 b_conv.inner = untag_ptr(b);
30527 b_conv.is_owned = ptr_is_owned(b);
30528 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30529 b_conv.is_owned = false;
30530 jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
30534 void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
30535 LDKClosingSigned this_obj_conv;
30536 this_obj_conv.inner = untag_ptr(this_obj);
30537 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30539 ClosingSigned_free(this_obj_conv);
30542 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) {
30543 LDKClosingSigned this_ptr_conv;
30544 this_ptr_conv.inner = untag_ptr(this_ptr);
30545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30547 this_ptr_conv.is_owned = false;
30548 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30549 memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32);
30553 void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30554 LDKClosingSigned this_ptr_conv;
30555 this_ptr_conv.inner = untag_ptr(this_ptr);
30556 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30558 this_ptr_conv.is_owned = false;
30559 LDKThirtyTwoBytes val_ref;
30560 CHECK(val->arr_len == 32);
30561 memcpy(val_ref.data, val->elems, 32); FREE(val);
30562 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
30565 int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) {
30566 LDKClosingSigned this_ptr_conv;
30567 this_ptr_conv.inner = untag_ptr(this_ptr);
30568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30570 this_ptr_conv.is_owned = false;
30571 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
30575 void __attribute__((export_name("TS_ClosingSigned_set_fee_satoshis"))) TS_ClosingSigned_set_fee_satoshis(uint64_t this_ptr, int64_t val) {
30576 LDKClosingSigned this_ptr_conv;
30577 this_ptr_conv.inner = untag_ptr(this_ptr);
30578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30580 this_ptr_conv.is_owned = false;
30581 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
30584 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_ClosingSigned_get_signature(uint64_t this_ptr) {
30585 LDKClosingSigned this_ptr_conv;
30586 this_ptr_conv.inner = untag_ptr(this_ptr);
30587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30589 this_ptr_conv.is_owned = false;
30590 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30591 memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
30595 void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
30596 LDKClosingSigned this_ptr_conv;
30597 this_ptr_conv.inner = untag_ptr(this_ptr);
30598 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30600 this_ptr_conv.is_owned = false;
30601 LDKSignature val_ref;
30602 CHECK(val->arr_len == 64);
30603 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30604 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
30607 uint64_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_ClosingSigned_get_fee_range(uint64_t this_ptr) {
30608 LDKClosingSigned this_ptr_conv;
30609 this_ptr_conv.inner = untag_ptr(this_ptr);
30610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30612 this_ptr_conv.is_owned = false;
30613 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
30614 uint64_t ret_ref = 0;
30615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30620 void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingSigned_set_fee_range(uint64_t this_ptr, uint64_t val) {
30621 LDKClosingSigned 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 LDKClosingSignedFeeRange val_conv;
30627 val_conv.inner = untag_ptr(val);
30628 val_conv.is_owned = ptr_is_owned(val);
30629 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30630 val_conv = ClosingSignedFeeRange_clone(&val_conv);
30631 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
30634 uint64_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, uint64_t fee_range_arg) {
30635 LDKThirtyTwoBytes channel_id_arg_ref;
30636 CHECK(channel_id_arg->arr_len == 32);
30637 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30638 LDKSignature signature_arg_ref;
30639 CHECK(signature_arg->arr_len == 64);
30640 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30641 LDKClosingSignedFeeRange fee_range_arg_conv;
30642 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
30643 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
30644 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
30645 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
30646 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
30647 uint64_t ret_ref = 0;
30648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30653 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
30654 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
30655 uint64_t ret_ref = 0;
30656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30660 int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint64_t arg) {
30661 LDKClosingSigned arg_conv;
30662 arg_conv.inner = untag_ptr(arg);
30663 arg_conv.is_owned = ptr_is_owned(arg);
30664 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30665 arg_conv.is_owned = false;
30666 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
30670 uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigned_clone(uint64_t orig) {
30671 LDKClosingSigned orig_conv;
30672 orig_conv.inner = untag_ptr(orig);
30673 orig_conv.is_owned = ptr_is_owned(orig);
30674 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30675 orig_conv.is_owned = false;
30676 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
30677 uint64_t ret_ref = 0;
30678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30683 jboolean __attribute__((export_name("TS_ClosingSigned_eq"))) TS_ClosingSigned_eq(uint64_t a, uint64_t b) {
30684 LDKClosingSigned a_conv;
30685 a_conv.inner = untag_ptr(a);
30686 a_conv.is_owned = ptr_is_owned(a);
30687 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30688 a_conv.is_owned = false;
30689 LDKClosingSigned b_conv;
30690 b_conv.inner = untag_ptr(b);
30691 b_conv.is_owned = ptr_is_owned(b);
30692 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30693 b_conv.is_owned = false;
30694 jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
30698 void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
30699 LDKUpdateAddHTLC this_obj_conv;
30700 this_obj_conv.inner = untag_ptr(this_obj);
30701 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30703 UpdateAddHTLC_free(this_obj_conv);
30706 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) {
30707 LDKUpdateAddHTLC this_ptr_conv;
30708 this_ptr_conv.inner = untag_ptr(this_ptr);
30709 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30711 this_ptr_conv.is_owned = false;
30712 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30713 memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32);
30717 void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30718 LDKUpdateAddHTLC this_ptr_conv;
30719 this_ptr_conv.inner = untag_ptr(this_ptr);
30720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30722 this_ptr_conv.is_owned = false;
30723 LDKThirtyTwoBytes val_ref;
30724 CHECK(val->arr_len == 32);
30725 memcpy(val_ref.data, val->elems, 32); FREE(val);
30726 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
30729 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) {
30730 LDKUpdateAddHTLC this_ptr_conv;
30731 this_ptr_conv.inner = untag_ptr(this_ptr);
30732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30734 this_ptr_conv.is_owned = false;
30735 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
30739 void __attribute__((export_name("TS_UpdateAddHTLC_set_htlc_id"))) TS_UpdateAddHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30740 LDKUpdateAddHTLC this_ptr_conv;
30741 this_ptr_conv.inner = untag_ptr(this_ptr);
30742 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30744 this_ptr_conv.is_owned = false;
30745 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
30748 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_amount_msat"))) TS_UpdateAddHTLC_get_amount_msat(uint64_t this_ptr) {
30749 LDKUpdateAddHTLC this_ptr_conv;
30750 this_ptr_conv.inner = untag_ptr(this_ptr);
30751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30753 this_ptr_conv.is_owned = false;
30754 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
30758 void __attribute__((export_name("TS_UpdateAddHTLC_set_amount_msat"))) TS_UpdateAddHTLC_set_amount_msat(uint64_t this_ptr, int64_t val) {
30759 LDKUpdateAddHTLC this_ptr_conv;
30760 this_ptr_conv.inner = untag_ptr(this_ptr);
30761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30763 this_ptr_conv.is_owned = false;
30764 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
30767 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) TS_UpdateAddHTLC_get_payment_hash(uint64_t this_ptr) {
30768 LDKUpdateAddHTLC this_ptr_conv;
30769 this_ptr_conv.inner = untag_ptr(this_ptr);
30770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30772 this_ptr_conv.is_owned = false;
30773 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30774 memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32);
30778 void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_UpdateAddHTLC_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
30779 LDKUpdateAddHTLC this_ptr_conv;
30780 this_ptr_conv.inner = untag_ptr(this_ptr);
30781 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30783 this_ptr_conv.is_owned = false;
30784 LDKThirtyTwoBytes val_ref;
30785 CHECK(val->arr_len == 32);
30786 memcpy(val_ref.data, val->elems, 32); FREE(val);
30787 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
30790 int32_t __attribute__((export_name("TS_UpdateAddHTLC_get_cltv_expiry"))) TS_UpdateAddHTLC_get_cltv_expiry(uint64_t this_ptr) {
30791 LDKUpdateAddHTLC this_ptr_conv;
30792 this_ptr_conv.inner = untag_ptr(this_ptr);
30793 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30795 this_ptr_conv.is_owned = false;
30796 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
30800 void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_UpdateAddHTLC_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
30801 LDKUpdateAddHTLC this_ptr_conv;
30802 this_ptr_conv.inner = untag_ptr(this_ptr);
30803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30805 this_ptr_conv.is_owned = false;
30806 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
30809 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
30810 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
30811 uint64_t ret_ref = 0;
30812 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30813 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30816 int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint64_t arg) {
30817 LDKUpdateAddHTLC arg_conv;
30818 arg_conv.inner = untag_ptr(arg);
30819 arg_conv.is_owned = ptr_is_owned(arg);
30820 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30821 arg_conv.is_owned = false;
30822 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
30826 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTLC_clone(uint64_t orig) {
30827 LDKUpdateAddHTLC orig_conv;
30828 orig_conv.inner = untag_ptr(orig);
30829 orig_conv.is_owned = ptr_is_owned(orig);
30830 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30831 orig_conv.is_owned = false;
30832 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
30833 uint64_t ret_ref = 0;
30834 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30835 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30839 jboolean __attribute__((export_name("TS_UpdateAddHTLC_eq"))) TS_UpdateAddHTLC_eq(uint64_t a, uint64_t b) {
30840 LDKUpdateAddHTLC a_conv;
30841 a_conv.inner = untag_ptr(a);
30842 a_conv.is_owned = ptr_is_owned(a);
30843 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30844 a_conv.is_owned = false;
30845 LDKUpdateAddHTLC b_conv;
30846 b_conv.inner = untag_ptr(b);
30847 b_conv.is_owned = ptr_is_owned(b);
30848 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30849 b_conv.is_owned = false;
30850 jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
30854 void __attribute__((export_name("TS_OnionMessage_free"))) TS_OnionMessage_free(uint64_t this_obj) {
30855 LDKOnionMessage this_obj_conv;
30856 this_obj_conv.inner = untag_ptr(this_obj);
30857 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30859 OnionMessage_free(this_obj_conv);
30862 int8_tArray __attribute__((export_name("TS_OnionMessage_get_blinding_point"))) TS_OnionMessage_get_blinding_point(uint64_t this_ptr) {
30863 LDKOnionMessage this_ptr_conv;
30864 this_ptr_conv.inner = untag_ptr(this_ptr);
30865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30867 this_ptr_conv.is_owned = false;
30868 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30869 memcpy(ret_arr->elems, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form, 33);
30873 void __attribute__((export_name("TS_OnionMessage_set_blinding_point"))) TS_OnionMessage_set_blinding_point(uint64_t this_ptr, int8_tArray val) {
30874 LDKOnionMessage this_ptr_conv;
30875 this_ptr_conv.inner = untag_ptr(this_ptr);
30876 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30878 this_ptr_conv.is_owned = false;
30879 LDKPublicKey val_ref;
30880 CHECK(val->arr_len == 33);
30881 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30882 OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
30885 static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
30886 LDKOnionMessage ret_var = OnionMessage_clone(arg);
30887 uint64_t ret_ref = 0;
30888 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30889 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30892 int64_t __attribute__((export_name("TS_OnionMessage_clone_ptr"))) TS_OnionMessage_clone_ptr(uint64_t arg) {
30893 LDKOnionMessage arg_conv;
30894 arg_conv.inner = untag_ptr(arg);
30895 arg_conv.is_owned = ptr_is_owned(arg);
30896 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30897 arg_conv.is_owned = false;
30898 int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
30902 uint64_t __attribute__((export_name("TS_OnionMessage_clone"))) TS_OnionMessage_clone(uint64_t orig) {
30903 LDKOnionMessage orig_conv;
30904 orig_conv.inner = untag_ptr(orig);
30905 orig_conv.is_owned = ptr_is_owned(orig);
30906 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30907 orig_conv.is_owned = false;
30908 LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
30909 uint64_t ret_ref = 0;
30910 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30911 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30915 jboolean __attribute__((export_name("TS_OnionMessage_eq"))) TS_OnionMessage_eq(uint64_t a, uint64_t b) {
30916 LDKOnionMessage a_conv;
30917 a_conv.inner = untag_ptr(a);
30918 a_conv.is_owned = ptr_is_owned(a);
30919 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30920 a_conv.is_owned = false;
30921 LDKOnionMessage b_conv;
30922 b_conv.inner = untag_ptr(b);
30923 b_conv.is_owned = ptr_is_owned(b);
30924 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30925 b_conv.is_owned = false;
30926 jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
30930 void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
30931 LDKUpdateFulfillHTLC this_obj_conv;
30932 this_obj_conv.inner = untag_ptr(this_obj);
30933 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30935 UpdateFulfillHTLC_free(this_obj_conv);
30938 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) {
30939 LDKUpdateFulfillHTLC this_ptr_conv;
30940 this_ptr_conv.inner = untag_ptr(this_ptr);
30941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30943 this_ptr_conv.is_owned = false;
30944 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30945 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32);
30949 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30950 LDKUpdateFulfillHTLC this_ptr_conv;
30951 this_ptr_conv.inner = untag_ptr(this_ptr);
30952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30954 this_ptr_conv.is_owned = false;
30955 LDKThirtyTwoBytes val_ref;
30956 CHECK(val->arr_len == 32);
30957 memcpy(val_ref.data, val->elems, 32); FREE(val);
30958 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
30961 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) {
30962 LDKUpdateFulfillHTLC this_ptr_conv;
30963 this_ptr_conv.inner = untag_ptr(this_ptr);
30964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30966 this_ptr_conv.is_owned = false;
30967 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
30971 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_htlc_id"))) TS_UpdateFulfillHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30972 LDKUpdateFulfillHTLC this_ptr_conv;
30973 this_ptr_conv.inner = untag_ptr(this_ptr);
30974 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30975 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30976 this_ptr_conv.is_owned = false;
30977 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
30980 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preimage"))) TS_UpdateFulfillHTLC_get_payment_preimage(uint64_t this_ptr) {
30981 LDKUpdateFulfillHTLC this_ptr_conv;
30982 this_ptr_conv.inner = untag_ptr(this_ptr);
30983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30985 this_ptr_conv.is_owned = false;
30986 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30987 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32);
30991 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) TS_UpdateFulfillHTLC_set_payment_preimage(uint64_t this_ptr, int8_tArray val) {
30992 LDKUpdateFulfillHTLC this_ptr_conv;
30993 this_ptr_conv.inner = untag_ptr(this_ptr);
30994 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30996 this_ptr_conv.is_owned = false;
30997 LDKThirtyTwoBytes val_ref;
30998 CHECK(val->arr_len == 32);
30999 memcpy(val_ref.data, val->elems, 32); FREE(val);
31000 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
31003 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_new"))) TS_UpdateFulfillHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) {
31004 LDKThirtyTwoBytes channel_id_arg_ref;
31005 CHECK(channel_id_arg->arr_len == 32);
31006 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
31007 LDKThirtyTwoBytes payment_preimage_arg_ref;
31008 CHECK(payment_preimage_arg->arr_len == 32);
31009 memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg);
31010 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
31011 uint64_t ret_ref = 0;
31012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31017 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
31018 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
31019 uint64_t ret_ref = 0;
31020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31024 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint64_t arg) {
31025 LDKUpdateFulfillHTLC arg_conv;
31026 arg_conv.inner = untag_ptr(arg);
31027 arg_conv.is_owned = ptr_is_owned(arg);
31028 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31029 arg_conv.is_owned = false;
31030 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
31034 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFulfillHTLC_clone(uint64_t orig) {
31035 LDKUpdateFulfillHTLC orig_conv;
31036 orig_conv.inner = untag_ptr(orig);
31037 orig_conv.is_owned = ptr_is_owned(orig);
31038 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31039 orig_conv.is_owned = false;
31040 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
31041 uint64_t ret_ref = 0;
31042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31043 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31047 jboolean __attribute__((export_name("TS_UpdateFulfillHTLC_eq"))) TS_UpdateFulfillHTLC_eq(uint64_t a, uint64_t b) {
31048 LDKUpdateFulfillHTLC a_conv;
31049 a_conv.inner = untag_ptr(a);
31050 a_conv.is_owned = ptr_is_owned(a);
31051 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31052 a_conv.is_owned = false;
31053 LDKUpdateFulfillHTLC b_conv;
31054 b_conv.inner = untag_ptr(b);
31055 b_conv.is_owned = ptr_is_owned(b);
31056 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31057 b_conv.is_owned = false;
31058 jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
31062 void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
31063 LDKUpdateFailHTLC this_obj_conv;
31064 this_obj_conv.inner = untag_ptr(this_obj);
31065 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31067 UpdateFailHTLC_free(this_obj_conv);
31070 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) {
31071 LDKUpdateFailHTLC this_ptr_conv;
31072 this_ptr_conv.inner = untag_ptr(this_ptr);
31073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31075 this_ptr_conv.is_owned = false;
31076 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31077 memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32);
31081 void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31082 LDKUpdateFailHTLC this_ptr_conv;
31083 this_ptr_conv.inner = untag_ptr(this_ptr);
31084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31086 this_ptr_conv.is_owned = false;
31087 LDKThirtyTwoBytes val_ref;
31088 CHECK(val->arr_len == 32);
31089 memcpy(val_ref.data, val->elems, 32); FREE(val);
31090 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
31093 int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) {
31094 LDKUpdateFailHTLC this_ptr_conv;
31095 this_ptr_conv.inner = untag_ptr(this_ptr);
31096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31098 this_ptr_conv.is_owned = false;
31099 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
31103 void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFailHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
31104 LDKUpdateFailHTLC this_ptr_conv;
31105 this_ptr_conv.inner = untag_ptr(this_ptr);
31106 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31108 this_ptr_conv.is_owned = false;
31109 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
31112 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
31113 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
31114 uint64_t ret_ref = 0;
31115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31119 int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint64_t arg) {
31120 LDKUpdateFailHTLC arg_conv;
31121 arg_conv.inner = untag_ptr(arg);
31122 arg_conv.is_owned = ptr_is_owned(arg);
31123 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31124 arg_conv.is_owned = false;
31125 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
31129 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailHTLC_clone(uint64_t orig) {
31130 LDKUpdateFailHTLC orig_conv;
31131 orig_conv.inner = untag_ptr(orig);
31132 orig_conv.is_owned = ptr_is_owned(orig);
31133 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31134 orig_conv.is_owned = false;
31135 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
31136 uint64_t ret_ref = 0;
31137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31142 jboolean __attribute__((export_name("TS_UpdateFailHTLC_eq"))) TS_UpdateFailHTLC_eq(uint64_t a, uint64_t b) {
31143 LDKUpdateFailHTLC a_conv;
31144 a_conv.inner = untag_ptr(a);
31145 a_conv.is_owned = ptr_is_owned(a);
31146 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31147 a_conv.is_owned = false;
31148 LDKUpdateFailHTLC b_conv;
31149 b_conv.inner = untag_ptr(b);
31150 b_conv.is_owned = ptr_is_owned(b);
31151 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31152 b_conv.is_owned = false;
31153 jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
31157 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
31158 LDKUpdateFailMalformedHTLC this_obj_conv;
31159 this_obj_conv.inner = untag_ptr(this_obj);
31160 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31162 UpdateFailMalformedHTLC_free(this_obj_conv);
31165 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) {
31166 LDKUpdateFailMalformedHTLC this_ptr_conv;
31167 this_ptr_conv.inner = untag_ptr(this_ptr);
31168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31170 this_ptr_conv.is_owned = false;
31171 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31172 memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32);
31176 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31177 LDKUpdateFailMalformedHTLC this_ptr_conv;
31178 this_ptr_conv.inner = untag_ptr(this_ptr);
31179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31181 this_ptr_conv.is_owned = false;
31182 LDKThirtyTwoBytes val_ref;
31183 CHECK(val->arr_len == 32);
31184 memcpy(val_ref.data, val->elems, 32); FREE(val);
31185 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
31188 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) {
31189 LDKUpdateFailMalformedHTLC this_ptr_conv;
31190 this_ptr_conv.inner = untag_ptr(this_ptr);
31191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31193 this_ptr_conv.is_owned = false;
31194 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
31198 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_htlc_id"))) TS_UpdateFailMalformedHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
31199 LDKUpdateFailMalformedHTLC this_ptr_conv;
31200 this_ptr_conv.inner = untag_ptr(this_ptr);
31201 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31203 this_ptr_conv.is_owned = false;
31204 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
31207 int16_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_failure_code"))) TS_UpdateFailMalformedHTLC_get_failure_code(uint64_t this_ptr) {
31208 LDKUpdateFailMalformedHTLC this_ptr_conv;
31209 this_ptr_conv.inner = untag_ptr(this_ptr);
31210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31212 this_ptr_conv.is_owned = false;
31213 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
31217 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code"))) TS_UpdateFailMalformedHTLC_set_failure_code(uint64_t this_ptr, int16_t val) {
31218 LDKUpdateFailMalformedHTLC this_ptr_conv;
31219 this_ptr_conv.inner = untag_ptr(this_ptr);
31220 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31222 this_ptr_conv.is_owned = false;
31223 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
31226 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
31227 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
31228 uint64_t ret_ref = 0;
31229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31233 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint64_t arg) {
31234 LDKUpdateFailMalformedHTLC arg_conv;
31235 arg_conv.inner = untag_ptr(arg);
31236 arg_conv.is_owned = ptr_is_owned(arg);
31237 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31238 arg_conv.is_owned = false;
31239 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
31243 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_UpdateFailMalformedHTLC_clone(uint64_t orig) {
31244 LDKUpdateFailMalformedHTLC orig_conv;
31245 orig_conv.inner = untag_ptr(orig);
31246 orig_conv.is_owned = ptr_is_owned(orig);
31247 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31248 orig_conv.is_owned = false;
31249 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
31250 uint64_t ret_ref = 0;
31251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31256 jboolean __attribute__((export_name("TS_UpdateFailMalformedHTLC_eq"))) TS_UpdateFailMalformedHTLC_eq(uint64_t a, uint64_t b) {
31257 LDKUpdateFailMalformedHTLC a_conv;
31258 a_conv.inner = untag_ptr(a);
31259 a_conv.is_owned = ptr_is_owned(a);
31260 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31261 a_conv.is_owned = false;
31262 LDKUpdateFailMalformedHTLC b_conv;
31263 b_conv.inner = untag_ptr(b);
31264 b_conv.is_owned = ptr_is_owned(b);
31265 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31266 b_conv.is_owned = false;
31267 jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
31271 void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
31272 LDKCommitmentSigned this_obj_conv;
31273 this_obj_conv.inner = untag_ptr(this_obj);
31274 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31276 CommitmentSigned_free(this_obj_conv);
31279 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) {
31280 LDKCommitmentSigned this_ptr_conv;
31281 this_ptr_conv.inner = untag_ptr(this_ptr);
31282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31284 this_ptr_conv.is_owned = false;
31285 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31286 memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32);
31290 void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31291 LDKCommitmentSigned this_ptr_conv;
31292 this_ptr_conv.inner = untag_ptr(this_ptr);
31293 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31295 this_ptr_conv.is_owned = false;
31296 LDKThirtyTwoBytes val_ref;
31297 CHECK(val->arr_len == 32);
31298 memcpy(val_ref.data, val->elems, 32); FREE(val);
31299 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
31302 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) {
31303 LDKCommitmentSigned this_ptr_conv;
31304 this_ptr_conv.inner = untag_ptr(this_ptr);
31305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31307 this_ptr_conv.is_owned = false;
31308 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31309 memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
31313 void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_CommitmentSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
31314 LDKCommitmentSigned this_ptr_conv;
31315 this_ptr_conv.inner = untag_ptr(this_ptr);
31316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31318 this_ptr_conv.is_owned = false;
31319 LDKSignature val_ref;
31320 CHECK(val->arr_len == 64);
31321 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31322 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
31325 ptrArray __attribute__((export_name("TS_CommitmentSigned_get_htlc_signatures"))) TS_CommitmentSigned_get_htlc_signatures(uint64_t this_ptr) {
31326 LDKCommitmentSigned this_ptr_conv;
31327 this_ptr_conv.inner = untag_ptr(this_ptr);
31328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31330 this_ptr_conv.is_owned = false;
31331 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
31332 ptrArray ret_arr = NULL;
31333 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
31334 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
31335 for (size_t m = 0; m < ret_var.datalen; m++) {
31336 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
31337 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
31338 ret_arr_ptr[m] = ret_conv_12_arr;
31341 FREE(ret_var.data);
31345 void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS_CommitmentSigned_set_htlc_signatures(uint64_t this_ptr, ptrArray val) {
31346 LDKCommitmentSigned this_ptr_conv;
31347 this_ptr_conv.inner = untag_ptr(this_ptr);
31348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31350 this_ptr_conv.is_owned = false;
31351 LDKCVec_SignatureZ val_constr;
31352 val_constr.datalen = val->arr_len;
31353 if (val_constr.datalen > 0)
31354 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
31356 val_constr.data = NULL;
31357 int8_tArray* val_vals = (void*) val->elems;
31358 for (size_t m = 0; m < val_constr.datalen; m++) {
31359 int8_tArray val_conv_12 = val_vals[m];
31360 LDKSignature val_conv_12_ref;
31361 CHECK(val_conv_12->arr_len == 64);
31362 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
31363 val_constr.data[m] = val_conv_12_ref;
31366 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
31369 uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) {
31370 LDKThirtyTwoBytes channel_id_arg_ref;
31371 CHECK(channel_id_arg->arr_len == 32);
31372 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
31373 LDKSignature signature_arg_ref;
31374 CHECK(signature_arg->arr_len == 64);
31375 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
31376 LDKCVec_SignatureZ htlc_signatures_arg_constr;
31377 htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len;
31378 if (htlc_signatures_arg_constr.datalen > 0)
31379 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
31381 htlc_signatures_arg_constr.data = NULL;
31382 int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
31383 for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
31384 int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
31385 LDKSignature htlc_signatures_arg_conv_12_ref;
31386 CHECK(htlc_signatures_arg_conv_12->arr_len == 64);
31387 memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
31388 htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
31390 FREE(htlc_signatures_arg);
31391 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
31392 uint64_t ret_ref = 0;
31393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31398 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
31399 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
31400 uint64_t ret_ref = 0;
31401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31405 int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint64_t arg) {
31406 LDKCommitmentSigned arg_conv;
31407 arg_conv.inner = untag_ptr(arg);
31408 arg_conv.is_owned = ptr_is_owned(arg);
31409 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31410 arg_conv.is_owned = false;
31411 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
31415 uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_CommitmentSigned_clone(uint64_t orig) {
31416 LDKCommitmentSigned orig_conv;
31417 orig_conv.inner = untag_ptr(orig);
31418 orig_conv.is_owned = ptr_is_owned(orig);
31419 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31420 orig_conv.is_owned = false;
31421 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
31422 uint64_t ret_ref = 0;
31423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31428 jboolean __attribute__((export_name("TS_CommitmentSigned_eq"))) TS_CommitmentSigned_eq(uint64_t a, uint64_t b) {
31429 LDKCommitmentSigned a_conv;
31430 a_conv.inner = untag_ptr(a);
31431 a_conv.is_owned = ptr_is_owned(a);
31432 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31433 a_conv.is_owned = false;
31434 LDKCommitmentSigned b_conv;
31435 b_conv.inner = untag_ptr(b);
31436 b_conv.is_owned = ptr_is_owned(b);
31437 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31438 b_conv.is_owned = false;
31439 jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
31443 void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
31444 LDKRevokeAndACK this_obj_conv;
31445 this_obj_conv.inner = untag_ptr(this_obj);
31446 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31448 RevokeAndACK_free(this_obj_conv);
31451 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) {
31452 LDKRevokeAndACK this_ptr_conv;
31453 this_ptr_conv.inner = untag_ptr(this_ptr);
31454 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31456 this_ptr_conv.is_owned = false;
31457 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31458 memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32);
31462 void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31463 LDKRevokeAndACK this_ptr_conv;
31464 this_ptr_conv.inner = untag_ptr(this_ptr);
31465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31467 this_ptr_conv.is_owned = false;
31468 LDKThirtyTwoBytes val_ref;
31469 CHECK(val->arr_len == 32);
31470 memcpy(val_ref.data, val->elems, 32); FREE(val);
31471 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
31474 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) {
31475 LDKRevokeAndACK this_ptr_conv;
31476 this_ptr_conv.inner = untag_ptr(this_ptr);
31477 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31479 this_ptr_conv.is_owned = false;
31480 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31481 memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32);
31485 void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) TS_RevokeAndACK_set_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
31486 LDKRevokeAndACK this_ptr_conv;
31487 this_ptr_conv.inner = untag_ptr(this_ptr);
31488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31490 this_ptr_conv.is_owned = false;
31491 LDKThirtyTwoBytes val_ref;
31492 CHECK(val->arr_len == 32);
31493 memcpy(val_ref.data, val->elems, 32); FREE(val);
31494 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
31497 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment_point"))) TS_RevokeAndACK_get_next_per_commitment_point(uint64_t this_ptr) {
31498 LDKRevokeAndACK this_ptr_conv;
31499 this_ptr_conv.inner = untag_ptr(this_ptr);
31500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31502 this_ptr_conv.is_owned = false;
31503 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31504 memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
31508 void __attribute__((export_name("TS_RevokeAndACK_set_next_per_commitment_point"))) TS_RevokeAndACK_set_next_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
31509 LDKRevokeAndACK this_ptr_conv;
31510 this_ptr_conv.inner = untag_ptr(this_ptr);
31511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31513 this_ptr_conv.is_owned = false;
31514 LDKPublicKey val_ref;
31515 CHECK(val->arr_len == 33);
31516 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31517 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
31520 uint64_t __attribute__((export_name("TS_RevokeAndACK_new"))) TS_RevokeAndACK_new(int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) {
31521 LDKThirtyTwoBytes channel_id_arg_ref;
31522 CHECK(channel_id_arg->arr_len == 32);
31523 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
31524 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
31525 CHECK(per_commitment_secret_arg->arr_len == 32);
31526 memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg);
31527 LDKPublicKey next_per_commitment_point_arg_ref;
31528 CHECK(next_per_commitment_point_arg->arr_len == 33);
31529 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
31530 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
31531 uint64_t ret_ref = 0;
31532 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31533 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31537 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
31538 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
31539 uint64_t ret_ref = 0;
31540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31544 int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint64_t arg) {
31545 LDKRevokeAndACK arg_conv;
31546 arg_conv.inner = untag_ptr(arg);
31547 arg_conv.is_owned = ptr_is_owned(arg);
31548 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31549 arg_conv.is_owned = false;
31550 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
31554 uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_clone(uint64_t orig) {
31555 LDKRevokeAndACK orig_conv;
31556 orig_conv.inner = untag_ptr(orig);
31557 orig_conv.is_owned = ptr_is_owned(orig);
31558 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31559 orig_conv.is_owned = false;
31560 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
31561 uint64_t ret_ref = 0;
31562 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31563 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31567 jboolean __attribute__((export_name("TS_RevokeAndACK_eq"))) TS_RevokeAndACK_eq(uint64_t a, uint64_t b) {
31568 LDKRevokeAndACK a_conv;
31569 a_conv.inner = untag_ptr(a);
31570 a_conv.is_owned = ptr_is_owned(a);
31571 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31572 a_conv.is_owned = false;
31573 LDKRevokeAndACK b_conv;
31574 b_conv.inner = untag_ptr(b);
31575 b_conv.is_owned = ptr_is_owned(b);
31576 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31577 b_conv.is_owned = false;
31578 jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
31582 void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
31583 LDKUpdateFee this_obj_conv;
31584 this_obj_conv.inner = untag_ptr(this_obj);
31585 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31587 UpdateFee_free(this_obj_conv);
31590 int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) {
31591 LDKUpdateFee this_ptr_conv;
31592 this_ptr_conv.inner = untag_ptr(this_ptr);
31593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31595 this_ptr_conv.is_owned = false;
31596 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31597 memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32);
31601 void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31602 LDKUpdateFee this_ptr_conv;
31603 this_ptr_conv.inner = untag_ptr(this_ptr);
31604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31606 this_ptr_conv.is_owned = false;
31607 LDKThirtyTwoBytes val_ref;
31608 CHECK(val->arr_len == 32);
31609 memcpy(val_ref.data, val->elems, 32); FREE(val);
31610 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
31613 int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) {
31614 LDKUpdateFee this_ptr_conv;
31615 this_ptr_conv.inner = untag_ptr(this_ptr);
31616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31618 this_ptr_conv.is_owned = false;
31619 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
31623 void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateFee_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
31624 LDKUpdateFee this_ptr_conv;
31625 this_ptr_conv.inner = untag_ptr(this_ptr);
31626 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31628 this_ptr_conv.is_owned = false;
31629 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
31632 uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
31633 LDKThirtyTwoBytes channel_id_arg_ref;
31634 CHECK(channel_id_arg->arr_len == 32);
31635 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
31636 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
31637 uint64_t ret_ref = 0;
31638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31643 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
31644 LDKUpdateFee ret_var = UpdateFee_clone(arg);
31645 uint64_t ret_ref = 0;
31646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31650 int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint64_t arg) {
31651 LDKUpdateFee arg_conv;
31652 arg_conv.inner = untag_ptr(arg);
31653 arg_conv.is_owned = ptr_is_owned(arg);
31654 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31655 arg_conv.is_owned = false;
31656 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
31660 uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone(uint64_t orig) {
31661 LDKUpdateFee orig_conv;
31662 orig_conv.inner = untag_ptr(orig);
31663 orig_conv.is_owned = ptr_is_owned(orig);
31664 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31665 orig_conv.is_owned = false;
31666 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
31667 uint64_t ret_ref = 0;
31668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31673 jboolean __attribute__((export_name("TS_UpdateFee_eq"))) TS_UpdateFee_eq(uint64_t a, uint64_t b) {
31674 LDKUpdateFee a_conv;
31675 a_conv.inner = untag_ptr(a);
31676 a_conv.is_owned = ptr_is_owned(a);
31677 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31678 a_conv.is_owned = false;
31679 LDKUpdateFee b_conv;
31680 b_conv.inner = untag_ptr(b);
31681 b_conv.is_owned = ptr_is_owned(b);
31682 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31683 b_conv.is_owned = false;
31684 jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
31688 void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
31689 LDKDataLossProtect this_obj_conv;
31690 this_obj_conv.inner = untag_ptr(this_obj);
31691 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31693 DataLossProtect_free(this_obj_conv);
31696 int8_tArray __attribute__((export_name("TS_DataLossProtect_get_your_last_per_commitment_secret"))) TS_DataLossProtect_get_your_last_per_commitment_secret(uint64_t this_ptr) {
31697 LDKDataLossProtect this_ptr_conv;
31698 this_ptr_conv.inner = untag_ptr(this_ptr);
31699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31701 this_ptr_conv.is_owned = false;
31702 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31703 memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32);
31707 void __attribute__((export_name("TS_DataLossProtect_set_your_last_per_commitment_secret"))) TS_DataLossProtect_set_your_last_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
31708 LDKDataLossProtect this_ptr_conv;
31709 this_ptr_conv.inner = untag_ptr(this_ptr);
31710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31712 this_ptr_conv.is_owned = false;
31713 LDKThirtyTwoBytes val_ref;
31714 CHECK(val->arr_len == 32);
31715 memcpy(val_ref.data, val->elems, 32); FREE(val);
31716 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
31719 int8_tArray __attribute__((export_name("TS_DataLossProtect_get_my_current_per_commitment_point"))) TS_DataLossProtect_get_my_current_per_commitment_point(uint64_t this_ptr) {
31720 LDKDataLossProtect this_ptr_conv;
31721 this_ptr_conv.inner = untag_ptr(this_ptr);
31722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31724 this_ptr_conv.is_owned = false;
31725 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31726 memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
31730 void __attribute__((export_name("TS_DataLossProtect_set_my_current_per_commitment_point"))) TS_DataLossProtect_set_my_current_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
31731 LDKDataLossProtect this_ptr_conv;
31732 this_ptr_conv.inner = untag_ptr(this_ptr);
31733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31735 this_ptr_conv.is_owned = false;
31736 LDKPublicKey val_ref;
31737 CHECK(val->arr_len == 33);
31738 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31739 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
31742 uint64_t __attribute__((export_name("TS_DataLossProtect_new"))) TS_DataLossProtect_new(int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) {
31743 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
31744 CHECK(your_last_per_commitment_secret_arg->arr_len == 32);
31745 memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg);
31746 LDKPublicKey my_current_per_commitment_point_arg_ref;
31747 CHECK(my_current_per_commitment_point_arg->arr_len == 33);
31748 memcpy(my_current_per_commitment_point_arg_ref.compressed_form, my_current_per_commitment_point_arg->elems, 33); FREE(my_current_per_commitment_point_arg);
31749 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
31750 uint64_t ret_ref = 0;
31751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31756 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
31757 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
31758 uint64_t ret_ref = 0;
31759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31763 int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint64_t arg) {
31764 LDKDataLossProtect arg_conv;
31765 arg_conv.inner = untag_ptr(arg);
31766 arg_conv.is_owned = ptr_is_owned(arg);
31767 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31768 arg_conv.is_owned = false;
31769 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
31773 uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossProtect_clone(uint64_t orig) {
31774 LDKDataLossProtect orig_conv;
31775 orig_conv.inner = untag_ptr(orig);
31776 orig_conv.is_owned = ptr_is_owned(orig);
31777 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31778 orig_conv.is_owned = false;
31779 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
31780 uint64_t ret_ref = 0;
31781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31786 jboolean __attribute__((export_name("TS_DataLossProtect_eq"))) TS_DataLossProtect_eq(uint64_t a, uint64_t b) {
31787 LDKDataLossProtect a_conv;
31788 a_conv.inner = untag_ptr(a);
31789 a_conv.is_owned = ptr_is_owned(a);
31790 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31791 a_conv.is_owned = false;
31792 LDKDataLossProtect b_conv;
31793 b_conv.inner = untag_ptr(b);
31794 b_conv.is_owned = ptr_is_owned(b);
31795 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31796 b_conv.is_owned = false;
31797 jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
31801 void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
31802 LDKChannelReestablish this_obj_conv;
31803 this_obj_conv.inner = untag_ptr(this_obj);
31804 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31806 ChannelReestablish_free(this_obj_conv);
31809 int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) {
31810 LDKChannelReestablish this_ptr_conv;
31811 this_ptr_conv.inner = untag_ptr(this_ptr);
31812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31814 this_ptr_conv.is_owned = false;
31815 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31816 memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32);
31820 void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31821 LDKChannelReestablish 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 LDKThirtyTwoBytes val_ref;
31827 CHECK(val->arr_len == 32);
31828 memcpy(val_ref.data, val->elems, 32); FREE(val);
31829 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
31832 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) {
31833 LDKChannelReestablish this_ptr_conv;
31834 this_ptr_conv.inner = untag_ptr(this_ptr);
31835 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31837 this_ptr_conv.is_owned = false;
31838 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
31842 void __attribute__((export_name("TS_ChannelReestablish_set_next_local_commitment_number"))) TS_ChannelReestablish_set_next_local_commitment_number(uint64_t this_ptr, int64_t val) {
31843 LDKChannelReestablish this_ptr_conv;
31844 this_ptr_conv.inner = untag_ptr(this_ptr);
31845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31847 this_ptr_conv.is_owned = false;
31848 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
31851 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_remote_commitment_number"))) TS_ChannelReestablish_get_next_remote_commitment_number(uint64_t this_ptr) {
31852 LDKChannelReestablish this_ptr_conv;
31853 this_ptr_conv.inner = untag_ptr(this_ptr);
31854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31856 this_ptr_conv.is_owned = false;
31857 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
31861 void __attribute__((export_name("TS_ChannelReestablish_set_next_remote_commitment_number"))) TS_ChannelReestablish_set_next_remote_commitment_number(uint64_t this_ptr, int64_t val) {
31862 LDKChannelReestablish this_ptr_conv;
31863 this_ptr_conv.inner = untag_ptr(this_ptr);
31864 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31866 this_ptr_conv.is_owned = false;
31867 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
31870 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
31871 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
31872 uint64_t ret_ref = 0;
31873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31877 int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint64_t arg) {
31878 LDKChannelReestablish arg_conv;
31879 arg_conv.inner = untag_ptr(arg);
31880 arg_conv.is_owned = ptr_is_owned(arg);
31881 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31882 arg_conv.is_owned = false;
31883 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
31887 uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_ChannelReestablish_clone(uint64_t orig) {
31888 LDKChannelReestablish orig_conv;
31889 orig_conv.inner = untag_ptr(orig);
31890 orig_conv.is_owned = ptr_is_owned(orig);
31891 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31892 orig_conv.is_owned = false;
31893 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
31894 uint64_t ret_ref = 0;
31895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31900 jboolean __attribute__((export_name("TS_ChannelReestablish_eq"))) TS_ChannelReestablish_eq(uint64_t a, uint64_t b) {
31901 LDKChannelReestablish a_conv;
31902 a_conv.inner = untag_ptr(a);
31903 a_conv.is_owned = ptr_is_owned(a);
31904 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
31905 a_conv.is_owned = false;
31906 LDKChannelReestablish b_conv;
31907 b_conv.inner = untag_ptr(b);
31908 b_conv.is_owned = ptr_is_owned(b);
31909 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
31910 b_conv.is_owned = false;
31911 jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
31915 void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
31916 LDKAnnouncementSignatures this_obj_conv;
31917 this_obj_conv.inner = untag_ptr(this_obj);
31918 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31920 AnnouncementSignatures_free(this_obj_conv);
31923 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) {
31924 LDKAnnouncementSignatures this_ptr_conv;
31925 this_ptr_conv.inner = untag_ptr(this_ptr);
31926 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31928 this_ptr_conv.is_owned = false;
31929 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31930 memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32);
31934 void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31935 LDKAnnouncementSignatures this_ptr_conv;
31936 this_ptr_conv.inner = untag_ptr(this_ptr);
31937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31939 this_ptr_conv.is_owned = false;
31940 LDKThirtyTwoBytes val_ref;
31941 CHECK(val->arr_len == 32);
31942 memcpy(val_ref.data, val->elems, 32); FREE(val);
31943 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
31946 int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) {
31947 LDKAnnouncementSignatures this_ptr_conv;
31948 this_ptr_conv.inner = untag_ptr(this_ptr);
31949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31951 this_ptr_conv.is_owned = false;
31952 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
31956 void __attribute__((export_name("TS_AnnouncementSignatures_set_short_channel_id"))) TS_AnnouncementSignatures_set_short_channel_id(uint64_t this_ptr, int64_t val) {
31957 LDKAnnouncementSignatures this_ptr_conv;
31958 this_ptr_conv.inner = untag_ptr(this_ptr);
31959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31961 this_ptr_conv.is_owned = false;
31962 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
31965 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_signature"))) TS_AnnouncementSignatures_get_node_signature(uint64_t this_ptr) {
31966 LDKAnnouncementSignatures this_ptr_conv;
31967 this_ptr_conv.inner = untag_ptr(this_ptr);
31968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31970 this_ptr_conv.is_owned = false;
31971 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31972 memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
31976 void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature"))) TS_AnnouncementSignatures_set_node_signature(uint64_t this_ptr, int8_tArray val) {
31977 LDKAnnouncementSignatures this_ptr_conv;
31978 this_ptr_conv.inner = untag_ptr(this_ptr);
31979 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31980 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31981 this_ptr_conv.is_owned = false;
31982 LDKSignature val_ref;
31983 CHECK(val->arr_len == 64);
31984 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31985 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
31988 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_signature"))) TS_AnnouncementSignatures_get_bitcoin_signature(uint64_t this_ptr) {
31989 LDKAnnouncementSignatures this_ptr_conv;
31990 this_ptr_conv.inner = untag_ptr(this_ptr);
31991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31993 this_ptr_conv.is_owned = false;
31994 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31995 memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
31999 void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signature"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint64_t this_ptr, int8_tArray val) {
32000 LDKAnnouncementSignatures this_ptr_conv;
32001 this_ptr_conv.inner = untag_ptr(this_ptr);
32002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32004 this_ptr_conv.is_owned = false;
32005 LDKSignature val_ref;
32006 CHECK(val->arr_len == 64);
32007 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32008 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
32011 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_new"))) TS_AnnouncementSignatures_new(int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) {
32012 LDKThirtyTwoBytes channel_id_arg_ref;
32013 CHECK(channel_id_arg->arr_len == 32);
32014 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
32015 LDKSignature node_signature_arg_ref;
32016 CHECK(node_signature_arg->arr_len == 64);
32017 memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg);
32018 LDKSignature bitcoin_signature_arg_ref;
32019 CHECK(bitcoin_signature_arg->arr_len == 64);
32020 memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg);
32021 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
32022 uint64_t ret_ref = 0;
32023 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32024 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32028 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
32029 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
32030 uint64_t ret_ref = 0;
32031 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32032 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32035 int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint64_t arg) {
32036 LDKAnnouncementSignatures arg_conv;
32037 arg_conv.inner = untag_ptr(arg);
32038 arg_conv.is_owned = ptr_is_owned(arg);
32039 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32040 arg_conv.is_owned = false;
32041 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
32045 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_AnnouncementSignatures_clone(uint64_t orig) {
32046 LDKAnnouncementSignatures orig_conv;
32047 orig_conv.inner = untag_ptr(orig);
32048 orig_conv.is_owned = ptr_is_owned(orig);
32049 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32050 orig_conv.is_owned = false;
32051 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
32052 uint64_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 jboolean __attribute__((export_name("TS_AnnouncementSignatures_eq"))) TS_AnnouncementSignatures_eq(uint64_t a, uint64_t b) {
32059 LDKAnnouncementSignatures a_conv;
32060 a_conv.inner = untag_ptr(a);
32061 a_conv.is_owned = ptr_is_owned(a);
32062 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32063 a_conv.is_owned = false;
32064 LDKAnnouncementSignatures b_conv;
32065 b_conv.inner = untag_ptr(b);
32066 b_conv.is_owned = ptr_is_owned(b);
32067 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32068 b_conv.is_owned = false;
32069 jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
32073 void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
32074 if (!ptr_is_owned(this_ptr)) return;
32075 void* this_ptr_ptr = untag_ptr(this_ptr);
32076 CHECK_ACCESS(this_ptr_ptr);
32077 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
32078 FREE(untag_ptr(this_ptr));
32079 NetAddress_free(this_ptr_conv);
32082 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
32083 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32084 *ret_copy = NetAddress_clone(arg);
32085 uint64_t ret_ref = tag_ptr(ret_copy, true);
32088 int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint64_t arg) {
32089 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
32090 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
32094 uint64_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clone(uint64_t orig) {
32095 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
32096 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32097 *ret_copy = NetAddress_clone(orig_conv);
32098 uint64_t ret_ref = tag_ptr(ret_copy, true);
32102 uint64_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
32103 LDKFourBytes addr_ref;
32104 CHECK(addr->arr_len == 4);
32105 memcpy(addr_ref.data, addr->elems, 4); FREE(addr);
32106 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32107 *ret_copy = NetAddress_ipv4(addr_ref, port);
32108 uint64_t ret_ref = tag_ptr(ret_copy, true);
32112 uint64_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
32113 LDKSixteenBytes addr_ref;
32114 CHECK(addr->arr_len == 16);
32115 memcpy(addr_ref.data, addr->elems, 16); FREE(addr);
32116 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32117 *ret_copy = NetAddress_ipv6(addr_ref, port);
32118 uint64_t ret_ref = tag_ptr(ret_copy, true);
32122 uint64_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) {
32123 LDKTwelveBytes a_ref;
32124 CHECK(a->arr_len == 12);
32125 memcpy(a_ref.data, a->elems, 12); FREE(a);
32126 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32127 *ret_copy = NetAddress_onion_v2(a_ref);
32128 uint64_t ret_ref = tag_ptr(ret_copy, true);
32132 uint64_t __attribute__((export_name("TS_NetAddress_onion_v3"))) TS_NetAddress_onion_v3(int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
32133 LDKThirtyTwoBytes ed25519_pubkey_ref;
32134 CHECK(ed25519_pubkey->arr_len == 32);
32135 memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey);
32136 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32137 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
32138 uint64_t ret_ref = tag_ptr(ret_copy, true);
32142 uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_hostname(uint64_t hostname, int16_t port) {
32143 LDKHostname hostname_conv;
32144 hostname_conv.inner = untag_ptr(hostname);
32145 hostname_conv.is_owned = ptr_is_owned(hostname);
32146 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
32147 hostname_conv = Hostname_clone(&hostname_conv);
32148 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32149 *ret_copy = NetAddress_hostname(hostname_conv, port);
32150 uint64_t ret_ref = tag_ptr(ret_copy, true);
32154 jboolean __attribute__((export_name("TS_NetAddress_eq"))) TS_NetAddress_eq(uint64_t a, uint64_t b) {
32155 LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
32156 LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
32157 jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
32161 int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
32162 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
32163 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
32164 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32165 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32166 CVec_u8Z_free(ret_var);
32170 uint64_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
32171 LDKu8slice ser_ref;
32172 ser_ref.datalen = ser->arr_len;
32173 ser_ref.data = ser->elems;
32174 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
32175 *ret_conv = NetAddress_read(ser_ref);
32177 return tag_ptr(ret_conv, true);
32180 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
32181 LDKUnsignedNodeAnnouncement this_obj_conv;
32182 this_obj_conv.inner = untag_ptr(this_obj);
32183 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32185 UnsignedNodeAnnouncement_free(this_obj_conv);
32188 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features"))) TS_UnsignedNodeAnnouncement_get_features(uint64_t this_ptr) {
32189 LDKUnsignedNodeAnnouncement this_ptr_conv;
32190 this_ptr_conv.inner = untag_ptr(this_ptr);
32191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32193 this_ptr_conv.is_owned = false;
32194 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
32195 uint64_t ret_ref = 0;
32196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32201 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_features"))) TS_UnsignedNodeAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
32202 LDKUnsignedNodeAnnouncement this_ptr_conv;
32203 this_ptr_conv.inner = untag_ptr(this_ptr);
32204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32206 this_ptr_conv.is_owned = false;
32207 LDKNodeFeatures val_conv;
32208 val_conv.inner = untag_ptr(val);
32209 val_conv.is_owned = ptr_is_owned(val);
32210 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32211 val_conv = NodeFeatures_clone(&val_conv);
32212 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
32215 int32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_timestamp"))) TS_UnsignedNodeAnnouncement_get_timestamp(uint64_t this_ptr) {
32216 LDKUnsignedNodeAnnouncement this_ptr_conv;
32217 this_ptr_conv.inner = untag_ptr(this_ptr);
32218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32220 this_ptr_conv.is_owned = false;
32221 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
32225 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_timestamp"))) TS_UnsignedNodeAnnouncement_set_timestamp(uint64_t this_ptr, int32_t val) {
32226 LDKUnsignedNodeAnnouncement this_ptr_conv;
32227 this_ptr_conv.inner = untag_ptr(this_ptr);
32228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32230 this_ptr_conv.is_owned = false;
32231 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
32234 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
32235 LDKUnsignedNodeAnnouncement this_ptr_conv;
32236 this_ptr_conv.inner = untag_ptr(this_ptr);
32237 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32239 this_ptr_conv.is_owned = false;
32240 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
32241 memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
32245 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
32246 LDKUnsignedNodeAnnouncement this_ptr_conv;
32247 this_ptr_conv.inner = untag_ptr(this_ptr);
32248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32250 this_ptr_conv.is_owned = false;
32251 LDKPublicKey val_ref;
32252 CHECK(val->arr_len == 33);
32253 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
32254 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
32257 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
32258 LDKUnsignedNodeAnnouncement this_ptr_conv;
32259 this_ptr_conv.inner = untag_ptr(this_ptr);
32260 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32262 this_ptr_conv.is_owned = false;
32263 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
32264 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3);
32268 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_UnsignedNodeAnnouncement_set_rgb(uint64_t this_ptr, int8_tArray val) {
32269 LDKUnsignedNodeAnnouncement this_ptr_conv;
32270 this_ptr_conv.inner = untag_ptr(this_ptr);
32271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32273 this_ptr_conv.is_owned = false;
32274 LDKThreeBytes val_ref;
32275 CHECK(val->arr_len == 3);
32276 memcpy(val_ref.data, val->elems, 3); FREE(val);
32277 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
32280 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) {
32281 LDKUnsignedNodeAnnouncement this_ptr_conv;
32282 this_ptr_conv.inner = untag_ptr(this_ptr);
32283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32285 this_ptr_conv.is_owned = false;
32286 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32287 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32);
32291 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) {
32292 LDKUnsignedNodeAnnouncement this_ptr_conv;
32293 this_ptr_conv.inner = untag_ptr(this_ptr);
32294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32296 this_ptr_conv.is_owned = false;
32297 LDKThirtyTwoBytes val_ref;
32298 CHECK(val->arr_len == 32);
32299 memcpy(val_ref.data, val->elems, 32); FREE(val);
32300 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
32303 uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) {
32304 LDKUnsignedNodeAnnouncement this_ptr_conv;
32305 this_ptr_conv.inner = untag_ptr(this_ptr);
32306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32308 this_ptr_conv.is_owned = false;
32309 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
32310 uint64_tArray ret_arr = NULL;
32311 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32312 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32313 for (size_t m = 0; m < ret_var.datalen; m++) {
32314 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
32315 *ret_conv_12_copy = ret_var.data[m];
32316 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
32317 ret_arr_ptr[m] = ret_conv_12_ref;
32320 FREE(ret_var.data);
32324 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) TS_UnsignedNodeAnnouncement_set_addresses(uint64_t this_ptr, uint64_tArray val) {
32325 LDKUnsignedNodeAnnouncement this_ptr_conv;
32326 this_ptr_conv.inner = untag_ptr(this_ptr);
32327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32329 this_ptr_conv.is_owned = false;
32330 LDKCVec_NetAddressZ val_constr;
32331 val_constr.datalen = val->arr_len;
32332 if (val_constr.datalen > 0)
32333 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
32335 val_constr.data = NULL;
32336 uint64_t* val_vals = val->elems;
32337 for (size_t m = 0; m < val_constr.datalen; m++) {
32338 uint64_t val_conv_12 = val_vals[m];
32339 void* val_conv_12_ptr = untag_ptr(val_conv_12);
32340 CHECK_ACCESS(val_conv_12_ptr);
32341 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
32342 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
32343 val_constr.data[m] = val_conv_12_conv;
32346 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
32349 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
32350 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
32351 uint64_t ret_ref = 0;
32352 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32353 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32356 int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint64_t arg) {
32357 LDKUnsignedNodeAnnouncement arg_conv;
32358 arg_conv.inner = untag_ptr(arg);
32359 arg_conv.is_owned = ptr_is_owned(arg);
32360 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32361 arg_conv.is_owned = false;
32362 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
32366 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_UnsignedNodeAnnouncement_clone(uint64_t orig) {
32367 LDKUnsignedNodeAnnouncement orig_conv;
32368 orig_conv.inner = untag_ptr(orig);
32369 orig_conv.is_owned = ptr_is_owned(orig);
32370 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32371 orig_conv.is_owned = false;
32372 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
32373 uint64_t ret_ref = 0;
32374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32379 jboolean __attribute__((export_name("TS_UnsignedNodeAnnouncement_eq"))) TS_UnsignedNodeAnnouncement_eq(uint64_t a, uint64_t b) {
32380 LDKUnsignedNodeAnnouncement a_conv;
32381 a_conv.inner = untag_ptr(a);
32382 a_conv.is_owned = ptr_is_owned(a);
32383 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32384 a_conv.is_owned = false;
32385 LDKUnsignedNodeAnnouncement b_conv;
32386 b_conv.inner = untag_ptr(b);
32387 b_conv.is_owned = ptr_is_owned(b);
32388 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32389 b_conv.is_owned = false;
32390 jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
32394 void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
32395 LDKNodeAnnouncement this_obj_conv;
32396 this_obj_conv.inner = untag_ptr(this_obj);
32397 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32399 NodeAnnouncement_free(this_obj_conv);
32402 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) TS_NodeAnnouncement_get_signature(uint64_t this_ptr) {
32403 LDKNodeAnnouncement this_ptr_conv;
32404 this_ptr_conv.inner = untag_ptr(this_ptr);
32405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32407 this_ptr_conv.is_owned = false;
32408 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32409 memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
32413 void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeAnnouncement_set_signature(uint64_t this_ptr, int8_tArray val) {
32414 LDKNodeAnnouncement this_ptr_conv;
32415 this_ptr_conv.inner = untag_ptr(this_ptr);
32416 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32418 this_ptr_conv.is_owned = false;
32419 LDKSignature val_ref;
32420 CHECK(val->arr_len == 64);
32421 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32422 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
32425 uint64_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_NodeAnnouncement_get_contents(uint64_t this_ptr) {
32426 LDKNodeAnnouncement this_ptr_conv;
32427 this_ptr_conv.inner = untag_ptr(this_ptr);
32428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32430 this_ptr_conv.is_owned = false;
32431 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
32432 uint64_t ret_ref = 0;
32433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32434 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32438 void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
32439 LDKNodeAnnouncement this_ptr_conv;
32440 this_ptr_conv.inner = untag_ptr(this_ptr);
32441 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32443 this_ptr_conv.is_owned = false;
32444 LDKUnsignedNodeAnnouncement val_conv;
32445 val_conv.inner = untag_ptr(val);
32446 val_conv.is_owned = ptr_is_owned(val);
32447 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32448 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
32449 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
32452 uint64_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint64_t contents_arg) {
32453 LDKSignature signature_arg_ref;
32454 CHECK(signature_arg->arr_len == 64);
32455 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
32456 LDKUnsignedNodeAnnouncement contents_arg_conv;
32457 contents_arg_conv.inner = untag_ptr(contents_arg);
32458 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
32459 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
32460 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
32461 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
32462 uint64_t ret_ref = 0;
32463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32468 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
32469 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
32470 uint64_t ret_ref = 0;
32471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32475 int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint64_t arg) {
32476 LDKNodeAnnouncement arg_conv;
32477 arg_conv.inner = untag_ptr(arg);
32478 arg_conv.is_owned = ptr_is_owned(arg);
32479 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32480 arg_conv.is_owned = false;
32481 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
32485 uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnouncement_clone(uint64_t orig) {
32486 LDKNodeAnnouncement orig_conv;
32487 orig_conv.inner = untag_ptr(orig);
32488 orig_conv.is_owned = ptr_is_owned(orig);
32489 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32490 orig_conv.is_owned = false;
32491 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
32492 uint64_t ret_ref = 0;
32493 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32494 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32498 jboolean __attribute__((export_name("TS_NodeAnnouncement_eq"))) TS_NodeAnnouncement_eq(uint64_t a, uint64_t b) {
32499 LDKNodeAnnouncement a_conv;
32500 a_conv.inner = untag_ptr(a);
32501 a_conv.is_owned = ptr_is_owned(a);
32502 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32503 a_conv.is_owned = false;
32504 LDKNodeAnnouncement b_conv;
32505 b_conv.inner = untag_ptr(b);
32506 b_conv.is_owned = ptr_is_owned(b);
32507 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32508 b_conv.is_owned = false;
32509 jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
32513 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
32514 LDKUnsignedChannelAnnouncement this_obj_conv;
32515 this_obj_conv.inner = untag_ptr(this_obj);
32516 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32518 UnsignedChannelAnnouncement_free(this_obj_conv);
32521 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_features"))) TS_UnsignedChannelAnnouncement_get_features(uint64_t this_ptr) {
32522 LDKUnsignedChannelAnnouncement this_ptr_conv;
32523 this_ptr_conv.inner = untag_ptr(this_ptr);
32524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32526 this_ptr_conv.is_owned = false;
32527 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
32528 uint64_t ret_ref = 0;
32529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32534 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_features"))) TS_UnsignedChannelAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
32535 LDKUnsignedChannelAnnouncement this_ptr_conv;
32536 this_ptr_conv.inner = untag_ptr(this_ptr);
32537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32539 this_ptr_conv.is_owned = false;
32540 LDKChannelFeatures val_conv;
32541 val_conv.inner = untag_ptr(val);
32542 val_conv.is_owned = ptr_is_owned(val);
32543 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32544 val_conv = ChannelFeatures_clone(&val_conv);
32545 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
32548 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chain_hash"))) TS_UnsignedChannelAnnouncement_get_chain_hash(uint64_t this_ptr) {
32549 LDKUnsignedChannelAnnouncement this_ptr_conv;
32550 this_ptr_conv.inner = untag_ptr(this_ptr);
32551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32553 this_ptr_conv.is_owned = false;
32554 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32555 memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32);
32559 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash"))) TS_UnsignedChannelAnnouncement_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32560 LDKUnsignedChannelAnnouncement this_ptr_conv;
32561 this_ptr_conv.inner = untag_ptr(this_ptr);
32562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32564 this_ptr_conv.is_owned = false;
32565 LDKThirtyTwoBytes val_ref;
32566 CHECK(val->arr_len == 32);
32567 memcpy(val_ref.data, val->elems, 32); FREE(val);
32568 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
32571 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_short_channel_id"))) TS_UnsignedChannelAnnouncement_get_short_channel_id(uint64_t this_ptr) {
32572 LDKUnsignedChannelAnnouncement this_ptr_conv;
32573 this_ptr_conv.inner = untag_ptr(this_ptr);
32574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32576 this_ptr_conv.is_owned = false;
32577 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
32581 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_short_channel_id"))) TS_UnsignedChannelAnnouncement_set_short_channel_id(uint64_t this_ptr, int64_t val) {
32582 LDKUnsignedChannelAnnouncement this_ptr_conv;
32583 this_ptr_conv.inner = untag_ptr(this_ptr);
32584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32586 this_ptr_conv.is_owned = false;
32587 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
32590 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
32591 LDKUnsignedChannelAnnouncement this_ptr_conv;
32592 this_ptr_conv.inner = untag_ptr(this_ptr);
32593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32595 this_ptr_conv.is_owned = false;
32596 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
32597 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
32601 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
32602 LDKUnsignedChannelAnnouncement this_ptr_conv;
32603 this_ptr_conv.inner = untag_ptr(this_ptr);
32604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32606 this_ptr_conv.is_owned = false;
32607 LDKPublicKey val_ref;
32608 CHECK(val->arr_len == 33);
32609 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
32610 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
32613 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
32614 LDKUnsignedChannelAnnouncement this_ptr_conv;
32615 this_ptr_conv.inner = untag_ptr(this_ptr);
32616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32618 this_ptr_conv.is_owned = false;
32619 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
32620 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
32624 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
32625 LDKUnsignedChannelAnnouncement this_ptr_conv;
32626 this_ptr_conv.inner = untag_ptr(this_ptr);
32627 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32629 this_ptr_conv.is_owned = false;
32630 LDKPublicKey val_ref;
32631 CHECK(val->arr_len == 33);
32632 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
32633 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
32636 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
32637 LDKUnsignedChannelAnnouncement this_ptr_conv;
32638 this_ptr_conv.inner = untag_ptr(this_ptr);
32639 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32641 this_ptr_conv.is_owned = false;
32642 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
32643 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
32647 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
32648 LDKUnsignedChannelAnnouncement this_ptr_conv;
32649 this_ptr_conv.inner = untag_ptr(this_ptr);
32650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32652 this_ptr_conv.is_owned = false;
32653 LDKPublicKey val_ref;
32654 CHECK(val->arr_len == 33);
32655 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
32656 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
32659 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
32660 LDKUnsignedChannelAnnouncement this_ptr_conv;
32661 this_ptr_conv.inner = untag_ptr(this_ptr);
32662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32664 this_ptr_conv.is_owned = false;
32665 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
32666 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
32670 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
32671 LDKUnsignedChannelAnnouncement this_ptr_conv;
32672 this_ptr_conv.inner = untag_ptr(this_ptr);
32673 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32675 this_ptr_conv.is_owned = false;
32676 LDKPublicKey val_ref;
32677 CHECK(val->arr_len == 33);
32678 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
32679 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
32682 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
32683 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
32684 uint64_t ret_ref = 0;
32685 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32686 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32689 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint64_t arg) {
32690 LDKUnsignedChannelAnnouncement arg_conv;
32691 arg_conv.inner = untag_ptr(arg);
32692 arg_conv.is_owned = ptr_is_owned(arg);
32693 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32694 arg_conv.is_owned = false;
32695 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
32699 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) TS_UnsignedChannelAnnouncement_clone(uint64_t orig) {
32700 LDKUnsignedChannelAnnouncement orig_conv;
32701 orig_conv.inner = untag_ptr(orig);
32702 orig_conv.is_owned = ptr_is_owned(orig);
32703 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32704 orig_conv.is_owned = false;
32705 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
32706 uint64_t ret_ref = 0;
32707 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32708 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32712 jboolean __attribute__((export_name("TS_UnsignedChannelAnnouncement_eq"))) TS_UnsignedChannelAnnouncement_eq(uint64_t a, uint64_t b) {
32713 LDKUnsignedChannelAnnouncement a_conv;
32714 a_conv.inner = untag_ptr(a);
32715 a_conv.is_owned = ptr_is_owned(a);
32716 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32717 a_conv.is_owned = false;
32718 LDKUnsignedChannelAnnouncement b_conv;
32719 b_conv.inner = untag_ptr(b);
32720 b_conv.is_owned = ptr_is_owned(b);
32721 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32722 b_conv.is_owned = false;
32723 jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
32727 void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
32728 LDKChannelAnnouncement this_obj_conv;
32729 this_obj_conv.inner = untag_ptr(this_obj);
32730 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32732 ChannelAnnouncement_free(this_obj_conv);
32735 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_1"))) TS_ChannelAnnouncement_get_node_signature_1(uint64_t this_ptr) {
32736 LDKChannelAnnouncement this_ptr_conv;
32737 this_ptr_conv.inner = untag_ptr(this_ptr);
32738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32740 this_ptr_conv.is_owned = false;
32741 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32742 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
32746 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1"))) TS_ChannelAnnouncement_set_node_signature_1(uint64_t this_ptr, int8_tArray val) {
32747 LDKChannelAnnouncement this_ptr_conv;
32748 this_ptr_conv.inner = untag_ptr(this_ptr);
32749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32751 this_ptr_conv.is_owned = false;
32752 LDKSignature val_ref;
32753 CHECK(val->arr_len == 64);
32754 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32755 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
32758 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_2"))) TS_ChannelAnnouncement_get_node_signature_2(uint64_t this_ptr) {
32759 LDKChannelAnnouncement 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 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32765 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
32769 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2"))) TS_ChannelAnnouncement_set_node_signature_2(uint64_t this_ptr, int8_tArray val) {
32770 LDKChannelAnnouncement this_ptr_conv;
32771 this_ptr_conv.inner = untag_ptr(this_ptr);
32772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32774 this_ptr_conv.is_owned = false;
32775 LDKSignature val_ref;
32776 CHECK(val->arr_len == 64);
32777 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32778 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
32781 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_1"))) TS_ChannelAnnouncement_get_bitcoin_signature_1(uint64_t this_ptr) {
32782 LDKChannelAnnouncement this_ptr_conv;
32783 this_ptr_conv.inner = untag_ptr(this_ptr);
32784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32786 this_ptr_conv.is_owned = false;
32787 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32788 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
32792 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint64_t this_ptr, int8_tArray val) {
32793 LDKChannelAnnouncement this_ptr_conv;
32794 this_ptr_conv.inner = untag_ptr(this_ptr);
32795 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32797 this_ptr_conv.is_owned = false;
32798 LDKSignature val_ref;
32799 CHECK(val->arr_len == 64);
32800 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32801 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
32804 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_2"))) TS_ChannelAnnouncement_get_bitcoin_signature_2(uint64_t this_ptr) {
32805 LDKChannelAnnouncement this_ptr_conv;
32806 this_ptr_conv.inner = untag_ptr(this_ptr);
32807 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32809 this_ptr_conv.is_owned = false;
32810 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32811 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
32815 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint64_t this_ptr, int8_tArray val) {
32816 LDKChannelAnnouncement this_ptr_conv;
32817 this_ptr_conv.inner = untag_ptr(this_ptr);
32818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32820 this_ptr_conv.is_owned = false;
32821 LDKSignature val_ref;
32822 CHECK(val->arr_len == 64);
32823 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32824 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
32827 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS_ChannelAnnouncement_get_contents(uint64_t this_ptr) {
32828 LDKChannelAnnouncement this_ptr_conv;
32829 this_ptr_conv.inner = untag_ptr(this_ptr);
32830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32832 this_ptr_conv.is_owned = false;
32833 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
32834 uint64_t ret_ref = 0;
32835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32840 void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_ChannelAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
32841 LDKChannelAnnouncement this_ptr_conv;
32842 this_ptr_conv.inner = untag_ptr(this_ptr);
32843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32845 this_ptr_conv.is_owned = false;
32846 LDKUnsignedChannelAnnouncement val_conv;
32847 val_conv.inner = untag_ptr(val);
32848 val_conv.is_owned = ptr_is_owned(val);
32849 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32850 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
32851 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
32854 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_new"))) TS_ChannelAnnouncement_new(int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, uint64_t contents_arg) {
32855 LDKSignature node_signature_1_arg_ref;
32856 CHECK(node_signature_1_arg->arr_len == 64);
32857 memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg);
32858 LDKSignature node_signature_2_arg_ref;
32859 CHECK(node_signature_2_arg->arr_len == 64);
32860 memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg);
32861 LDKSignature bitcoin_signature_1_arg_ref;
32862 CHECK(bitcoin_signature_1_arg->arr_len == 64);
32863 memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg);
32864 LDKSignature bitcoin_signature_2_arg_ref;
32865 CHECK(bitcoin_signature_2_arg->arr_len == 64);
32866 memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg);
32867 LDKUnsignedChannelAnnouncement contents_arg_conv;
32868 contents_arg_conv.inner = untag_ptr(contents_arg);
32869 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
32870 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
32871 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
32872 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);
32873 uint64_t ret_ref = 0;
32874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32879 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
32880 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
32881 uint64_t ret_ref = 0;
32882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32886 int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint64_t arg) {
32887 LDKChannelAnnouncement arg_conv;
32888 arg_conv.inner = untag_ptr(arg);
32889 arg_conv.is_owned = ptr_is_owned(arg);
32890 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32891 arg_conv.is_owned = false;
32892 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
32896 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_ChannelAnnouncement_clone(uint64_t orig) {
32897 LDKChannelAnnouncement orig_conv;
32898 orig_conv.inner = untag_ptr(orig);
32899 orig_conv.is_owned = ptr_is_owned(orig);
32900 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32901 orig_conv.is_owned = false;
32902 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
32903 uint64_t ret_ref = 0;
32904 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32905 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32909 jboolean __attribute__((export_name("TS_ChannelAnnouncement_eq"))) TS_ChannelAnnouncement_eq(uint64_t a, uint64_t b) {
32910 LDKChannelAnnouncement a_conv;
32911 a_conv.inner = untag_ptr(a);
32912 a_conv.is_owned = ptr_is_owned(a);
32913 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32914 a_conv.is_owned = false;
32915 LDKChannelAnnouncement b_conv;
32916 b_conv.inner = untag_ptr(b);
32917 b_conv.is_owned = ptr_is_owned(b);
32918 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32919 b_conv.is_owned = false;
32920 jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
32924 void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
32925 LDKUnsignedChannelUpdate this_obj_conv;
32926 this_obj_conv.inner = untag_ptr(this_obj);
32927 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32929 UnsignedChannelUpdate_free(this_obj_conv);
32932 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) {
32933 LDKUnsignedChannelUpdate this_ptr_conv;
32934 this_ptr_conv.inner = untag_ptr(this_ptr);
32935 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32937 this_ptr_conv.is_owned = false;
32938 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32939 memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32);
32943 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32944 LDKUnsignedChannelUpdate this_ptr_conv;
32945 this_ptr_conv.inner = untag_ptr(this_ptr);
32946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32948 this_ptr_conv.is_owned = false;
32949 LDKThirtyTwoBytes val_ref;
32950 CHECK(val->arr_len == 32);
32951 memcpy(val_ref.data, val->elems, 32); FREE(val);
32952 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
32955 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) {
32956 LDKUnsignedChannelUpdate this_ptr_conv;
32957 this_ptr_conv.inner = untag_ptr(this_ptr);
32958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32960 this_ptr_conv.is_owned = false;
32961 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
32965 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) {
32966 LDKUnsignedChannelUpdate this_ptr_conv;
32967 this_ptr_conv.inner = untag_ptr(this_ptr);
32968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32970 this_ptr_conv.is_owned = false;
32971 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
32974 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) {
32975 LDKUnsignedChannelUpdate this_ptr_conv;
32976 this_ptr_conv.inner = untag_ptr(this_ptr);
32977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32979 this_ptr_conv.is_owned = false;
32980 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
32984 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) {
32985 LDKUnsignedChannelUpdate this_ptr_conv;
32986 this_ptr_conv.inner = untag_ptr(this_ptr);
32987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32989 this_ptr_conv.is_owned = false;
32990 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
32993 int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) {
32994 LDKUnsignedChannelUpdate this_ptr_conv;
32995 this_ptr_conv.inner = untag_ptr(this_ptr);
32996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32998 this_ptr_conv.is_owned = false;
32999 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
33003 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) {
33004 LDKUnsignedChannelUpdate this_ptr_conv;
33005 this_ptr_conv.inner = untag_ptr(this_ptr);
33006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33008 this_ptr_conv.is_owned = false;
33009 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
33012 int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) {
33013 LDKUnsignedChannelUpdate this_ptr_conv;
33014 this_ptr_conv.inner = untag_ptr(this_ptr);
33015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33017 this_ptr_conv.is_owned = false;
33018 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
33022 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
33023 LDKUnsignedChannelUpdate this_ptr_conv;
33024 this_ptr_conv.inner = untag_ptr(this_ptr);
33025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33027 this_ptr_conv.is_owned = false;
33028 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
33031 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) {
33032 LDKUnsignedChannelUpdate this_ptr_conv;
33033 this_ptr_conv.inner = untag_ptr(this_ptr);
33034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33036 this_ptr_conv.is_owned = false;
33037 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
33041 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
33042 LDKUnsignedChannelUpdate this_ptr_conv;
33043 this_ptr_conv.inner = untag_ptr(this_ptr);
33044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33046 this_ptr_conv.is_owned = false;
33047 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
33050 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) {
33051 LDKUnsignedChannelUpdate this_ptr_conv;
33052 this_ptr_conv.inner = untag_ptr(this_ptr);
33053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33055 this_ptr_conv.is_owned = false;
33056 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
33060 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
33061 LDKUnsignedChannelUpdate this_ptr_conv;
33062 this_ptr_conv.inner = untag_ptr(this_ptr);
33063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33065 this_ptr_conv.is_owned = false;
33066 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
33069 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) {
33070 LDKUnsignedChannelUpdate this_ptr_conv;
33071 this_ptr_conv.inner = untag_ptr(this_ptr);
33072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33074 this_ptr_conv.is_owned = false;
33075 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
33079 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
33080 LDKUnsignedChannelUpdate this_ptr_conv;
33081 this_ptr_conv.inner = untag_ptr(this_ptr);
33082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33084 this_ptr_conv.is_owned = false;
33085 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
33088 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) {
33089 LDKUnsignedChannelUpdate this_ptr_conv;
33090 this_ptr_conv.inner = untag_ptr(this_ptr);
33091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33093 this_ptr_conv.is_owned = false;
33094 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
33098 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
33099 LDKUnsignedChannelUpdate this_ptr_conv;
33100 this_ptr_conv.inner = untag_ptr(this_ptr);
33101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33103 this_ptr_conv.is_owned = false;
33104 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
33107 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) {
33108 LDKUnsignedChannelUpdate this_ptr_conv;
33109 this_ptr_conv.inner = untag_ptr(this_ptr);
33110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33112 this_ptr_conv.is_owned = false;
33113 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
33114 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33115 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33116 CVec_u8Z_free(ret_var);
33120 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) {
33121 LDKUnsignedChannelUpdate this_ptr_conv;
33122 this_ptr_conv.inner = untag_ptr(this_ptr);
33123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33125 this_ptr_conv.is_owned = false;
33126 LDKCVec_u8Z val_ref;
33127 val_ref.datalen = val->arr_len;
33128 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
33129 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
33130 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
33133 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_new"))) TS_UnsignedChannelUpdate_new(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) {
33134 LDKThirtyTwoBytes chain_hash_arg_ref;
33135 CHECK(chain_hash_arg->arr_len == 32);
33136 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33137 LDKCVec_u8Z excess_data_arg_ref;
33138 excess_data_arg_ref.datalen = excess_data_arg->arr_len;
33139 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
33140 memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg);
33141 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);
33142 uint64_t ret_ref = 0;
33143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33148 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
33149 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
33150 uint64_t ret_ref = 0;
33151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33155 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) {
33156 LDKUnsignedChannelUpdate arg_conv;
33157 arg_conv.inner = untag_ptr(arg);
33158 arg_conv.is_owned = ptr_is_owned(arg);
33159 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33160 arg_conv.is_owned = false;
33161 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
33165 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) {
33166 LDKUnsignedChannelUpdate orig_conv;
33167 orig_conv.inner = untag_ptr(orig);
33168 orig_conv.is_owned = ptr_is_owned(orig);
33169 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33170 orig_conv.is_owned = false;
33171 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
33172 uint64_t ret_ref = 0;
33173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33178 jboolean __attribute__((export_name("TS_UnsignedChannelUpdate_eq"))) TS_UnsignedChannelUpdate_eq(uint64_t a, uint64_t b) {
33179 LDKUnsignedChannelUpdate a_conv;
33180 a_conv.inner = untag_ptr(a);
33181 a_conv.is_owned = ptr_is_owned(a);
33182 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33183 a_conv.is_owned = false;
33184 LDKUnsignedChannelUpdate b_conv;
33185 b_conv.inner = untag_ptr(b);
33186 b_conv.is_owned = ptr_is_owned(b);
33187 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33188 b_conv.is_owned = false;
33189 jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
33193 void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
33194 LDKChannelUpdate this_obj_conv;
33195 this_obj_conv.inner = untag_ptr(this_obj);
33196 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33198 ChannelUpdate_free(this_obj_conv);
33201 int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) {
33202 LDKChannelUpdate this_ptr_conv;
33203 this_ptr_conv.inner = untag_ptr(this_ptr);
33204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33206 this_ptr_conv.is_owned = false;
33207 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
33208 memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
33212 void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) {
33213 LDKChannelUpdate this_ptr_conv;
33214 this_ptr_conv.inner = untag_ptr(this_ptr);
33215 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33217 this_ptr_conv.is_owned = false;
33218 LDKSignature val_ref;
33219 CHECK(val->arr_len == 64);
33220 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
33221 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
33224 uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) {
33225 LDKChannelUpdate this_ptr_conv;
33226 this_ptr_conv.inner = untag_ptr(this_ptr);
33227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33229 this_ptr_conv.is_owned = false;
33230 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
33231 uint64_t ret_ref = 0;
33232 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33233 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33237 void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) {
33238 LDKChannelUpdate this_ptr_conv;
33239 this_ptr_conv.inner = untag_ptr(this_ptr);
33240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33242 this_ptr_conv.is_owned = false;
33243 LDKUnsignedChannelUpdate val_conv;
33244 val_conv.inner = untag_ptr(val);
33245 val_conv.is_owned = ptr_is_owned(val);
33246 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33247 val_conv = UnsignedChannelUpdate_clone(&val_conv);
33248 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
33251 uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) {
33252 LDKSignature signature_arg_ref;
33253 CHECK(signature_arg->arr_len == 64);
33254 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
33255 LDKUnsignedChannelUpdate contents_arg_conv;
33256 contents_arg_conv.inner = untag_ptr(contents_arg);
33257 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
33258 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
33259 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
33260 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
33261 uint64_t ret_ref = 0;
33262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33267 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
33268 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
33269 uint64_t ret_ref = 0;
33270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33274 int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) {
33275 LDKChannelUpdate arg_conv;
33276 arg_conv.inner = untag_ptr(arg);
33277 arg_conv.is_owned = ptr_is_owned(arg);
33278 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33279 arg_conv.is_owned = false;
33280 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
33284 uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) {
33285 LDKChannelUpdate orig_conv;
33286 orig_conv.inner = untag_ptr(orig);
33287 orig_conv.is_owned = ptr_is_owned(orig);
33288 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33289 orig_conv.is_owned = false;
33290 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
33291 uint64_t ret_ref = 0;
33292 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33293 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33297 jboolean __attribute__((export_name("TS_ChannelUpdate_eq"))) TS_ChannelUpdate_eq(uint64_t a, uint64_t b) {
33298 LDKChannelUpdate a_conv;
33299 a_conv.inner = untag_ptr(a);
33300 a_conv.is_owned = ptr_is_owned(a);
33301 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33302 a_conv.is_owned = false;
33303 LDKChannelUpdate b_conv;
33304 b_conv.inner = untag_ptr(b);
33305 b_conv.is_owned = ptr_is_owned(b);
33306 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33307 b_conv.is_owned = false;
33308 jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
33312 void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
33313 LDKQueryChannelRange this_obj_conv;
33314 this_obj_conv.inner = untag_ptr(this_obj);
33315 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33317 QueryChannelRange_free(this_obj_conv);
33320 int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) {
33321 LDKQueryChannelRange this_ptr_conv;
33322 this_ptr_conv.inner = untag_ptr(this_ptr);
33323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33325 this_ptr_conv.is_owned = false;
33326 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33327 memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32);
33331 void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
33332 LDKQueryChannelRange this_ptr_conv;
33333 this_ptr_conv.inner = untag_ptr(this_ptr);
33334 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33336 this_ptr_conv.is_owned = false;
33337 LDKThirtyTwoBytes val_ref;
33338 CHECK(val->arr_len == 32);
33339 memcpy(val_ref.data, val->elems, 32); FREE(val);
33340 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
33343 int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) {
33344 LDKQueryChannelRange this_ptr_conv;
33345 this_ptr_conv.inner = untag_ptr(this_ptr);
33346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33348 this_ptr_conv.is_owned = false;
33349 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
33353 void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
33354 LDKQueryChannelRange this_ptr_conv;
33355 this_ptr_conv.inner = untag_ptr(this_ptr);
33356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33358 this_ptr_conv.is_owned = false;
33359 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
33362 int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) {
33363 LDKQueryChannelRange this_ptr_conv;
33364 this_ptr_conv.inner = untag_ptr(this_ptr);
33365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33367 this_ptr_conv.is_owned = false;
33368 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
33372 void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
33373 LDKQueryChannelRange this_ptr_conv;
33374 this_ptr_conv.inner = untag_ptr(this_ptr);
33375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33377 this_ptr_conv.is_owned = false;
33378 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
33381 uint64_t __attribute__((export_name("TS_QueryChannelRange_new"))) TS_QueryChannelRange_new(int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) {
33382 LDKThirtyTwoBytes chain_hash_arg_ref;
33383 CHECK(chain_hash_arg->arr_len == 32);
33384 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33385 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
33386 uint64_t ret_ref = 0;
33387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33392 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
33393 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
33394 uint64_t ret_ref = 0;
33395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33399 int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) {
33400 LDKQueryChannelRange arg_conv;
33401 arg_conv.inner = untag_ptr(arg);
33402 arg_conv.is_owned = ptr_is_owned(arg);
33403 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33404 arg_conv.is_owned = false;
33405 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
33409 uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) {
33410 LDKQueryChannelRange orig_conv;
33411 orig_conv.inner = untag_ptr(orig);
33412 orig_conv.is_owned = ptr_is_owned(orig);
33413 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33414 orig_conv.is_owned = false;
33415 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
33416 uint64_t ret_ref = 0;
33417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33422 jboolean __attribute__((export_name("TS_QueryChannelRange_eq"))) TS_QueryChannelRange_eq(uint64_t a, uint64_t b) {
33423 LDKQueryChannelRange a_conv;
33424 a_conv.inner = untag_ptr(a);
33425 a_conv.is_owned = ptr_is_owned(a);
33426 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33427 a_conv.is_owned = false;
33428 LDKQueryChannelRange b_conv;
33429 b_conv.inner = untag_ptr(b);
33430 b_conv.is_owned = ptr_is_owned(b);
33431 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33432 b_conv.is_owned = false;
33433 jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
33437 void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
33438 LDKReplyChannelRange this_obj_conv;
33439 this_obj_conv.inner = untag_ptr(this_obj);
33440 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33442 ReplyChannelRange_free(this_obj_conv);
33445 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) {
33446 LDKReplyChannelRange this_ptr_conv;
33447 this_ptr_conv.inner = untag_ptr(this_ptr);
33448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33450 this_ptr_conv.is_owned = false;
33451 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33452 memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32);
33456 void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
33457 LDKReplyChannelRange this_ptr_conv;
33458 this_ptr_conv.inner = untag_ptr(this_ptr);
33459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33461 this_ptr_conv.is_owned = false;
33462 LDKThirtyTwoBytes val_ref;
33463 CHECK(val->arr_len == 32);
33464 memcpy(val_ref.data, val->elems, 32); FREE(val);
33465 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
33468 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) {
33469 LDKReplyChannelRange this_ptr_conv;
33470 this_ptr_conv.inner = untag_ptr(this_ptr);
33471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33473 this_ptr_conv.is_owned = false;
33474 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
33478 void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
33479 LDKReplyChannelRange this_ptr_conv;
33480 this_ptr_conv.inner = untag_ptr(this_ptr);
33481 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33483 this_ptr_conv.is_owned = false;
33484 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
33487 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) {
33488 LDKReplyChannelRange this_ptr_conv;
33489 this_ptr_conv.inner = untag_ptr(this_ptr);
33490 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33492 this_ptr_conv.is_owned = false;
33493 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
33497 void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
33498 LDKReplyChannelRange this_ptr_conv;
33499 this_ptr_conv.inner = untag_ptr(this_ptr);
33500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33502 this_ptr_conv.is_owned = false;
33503 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
33506 jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) {
33507 LDKReplyChannelRange this_ptr_conv;
33508 this_ptr_conv.inner = untag_ptr(this_ptr);
33509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33511 this_ptr_conv.is_owned = false;
33512 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
33516 void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) {
33517 LDKReplyChannelRange this_ptr_conv;
33518 this_ptr_conv.inner = untag_ptr(this_ptr);
33519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33521 this_ptr_conv.is_owned = false;
33522 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
33525 int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) {
33526 LDKReplyChannelRange this_ptr_conv;
33527 this_ptr_conv.inner = untag_ptr(this_ptr);
33528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33530 this_ptr_conv.is_owned = false;
33531 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
33532 int64_tArray ret_arr = NULL;
33533 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
33534 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
33535 for (size_t i = 0; i < ret_var.datalen; i++) {
33536 int64_t ret_conv_8_conv = ret_var.data[i];
33537 ret_arr_ptr[i] = ret_conv_8_conv;
33540 FREE(ret_var.data);
33544 void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
33545 LDKReplyChannelRange this_ptr_conv;
33546 this_ptr_conv.inner = untag_ptr(this_ptr);
33547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33549 this_ptr_conv.is_owned = false;
33550 LDKCVec_u64Z val_constr;
33551 val_constr.datalen = val->arr_len;
33552 if (val_constr.datalen > 0)
33553 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
33555 val_constr.data = NULL;
33556 int64_t* val_vals = val->elems;
33557 for (size_t i = 0; i < val_constr.datalen; i++) {
33558 int64_t val_conv_8 = val_vals[i];
33559 val_constr.data[i] = val_conv_8;
33562 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
33565 uint64_t __attribute__((export_name("TS_ReplyChannelRange_new"))) TS_ReplyChannelRange_new(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) {
33566 LDKThirtyTwoBytes chain_hash_arg_ref;
33567 CHECK(chain_hash_arg->arr_len == 32);
33568 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33569 LDKCVec_u64Z short_channel_ids_arg_constr;
33570 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
33571 if (short_channel_ids_arg_constr.datalen > 0)
33572 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
33574 short_channel_ids_arg_constr.data = NULL;
33575 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
33576 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
33577 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
33578 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
33580 FREE(short_channel_ids_arg);
33581 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
33582 uint64_t ret_ref = 0;
33583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33588 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
33589 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
33590 uint64_t ret_ref = 0;
33591 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33592 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33595 int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) {
33596 LDKReplyChannelRange arg_conv;
33597 arg_conv.inner = untag_ptr(arg);
33598 arg_conv.is_owned = ptr_is_owned(arg);
33599 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33600 arg_conv.is_owned = false;
33601 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
33605 uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) {
33606 LDKReplyChannelRange orig_conv;
33607 orig_conv.inner = untag_ptr(orig);
33608 orig_conv.is_owned = ptr_is_owned(orig);
33609 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33610 orig_conv.is_owned = false;
33611 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
33612 uint64_t ret_ref = 0;
33613 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33614 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33618 jboolean __attribute__((export_name("TS_ReplyChannelRange_eq"))) TS_ReplyChannelRange_eq(uint64_t a, uint64_t b) {
33619 LDKReplyChannelRange a_conv;
33620 a_conv.inner = untag_ptr(a);
33621 a_conv.is_owned = ptr_is_owned(a);
33622 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33623 a_conv.is_owned = false;
33624 LDKReplyChannelRange b_conv;
33625 b_conv.inner = untag_ptr(b);
33626 b_conv.is_owned = ptr_is_owned(b);
33627 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33628 b_conv.is_owned = false;
33629 jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
33633 void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
33634 LDKQueryShortChannelIds this_obj_conv;
33635 this_obj_conv.inner = untag_ptr(this_obj);
33636 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33638 QueryShortChannelIds_free(this_obj_conv);
33641 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) {
33642 LDKQueryShortChannelIds this_ptr_conv;
33643 this_ptr_conv.inner = untag_ptr(this_ptr);
33644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33646 this_ptr_conv.is_owned = false;
33647 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33648 memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32);
33652 void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
33653 LDKQueryShortChannelIds this_ptr_conv;
33654 this_ptr_conv.inner = untag_ptr(this_ptr);
33655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33657 this_ptr_conv.is_owned = false;
33658 LDKThirtyTwoBytes val_ref;
33659 CHECK(val->arr_len == 32);
33660 memcpy(val_ref.data, val->elems, 32); FREE(val);
33661 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
33664 int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) {
33665 LDKQueryShortChannelIds this_ptr_conv;
33666 this_ptr_conv.inner = untag_ptr(this_ptr);
33667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33669 this_ptr_conv.is_owned = false;
33670 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
33671 int64_tArray ret_arr = NULL;
33672 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
33673 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
33674 for (size_t i = 0; i < ret_var.datalen; i++) {
33675 int64_t ret_conv_8_conv = ret_var.data[i];
33676 ret_arr_ptr[i] = ret_conv_8_conv;
33679 FREE(ret_var.data);
33683 void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
33684 LDKQueryShortChannelIds this_ptr_conv;
33685 this_ptr_conv.inner = untag_ptr(this_ptr);
33686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33688 this_ptr_conv.is_owned = false;
33689 LDKCVec_u64Z val_constr;
33690 val_constr.datalen = val->arr_len;
33691 if (val_constr.datalen > 0)
33692 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
33694 val_constr.data = NULL;
33695 int64_t* val_vals = val->elems;
33696 for (size_t i = 0; i < val_constr.datalen; i++) {
33697 int64_t val_conv_8 = val_vals[i];
33698 val_constr.data[i] = val_conv_8;
33701 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
33704 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
33705 LDKThirtyTwoBytes chain_hash_arg_ref;
33706 CHECK(chain_hash_arg->arr_len == 32);
33707 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33708 LDKCVec_u64Z short_channel_ids_arg_constr;
33709 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
33710 if (short_channel_ids_arg_constr.datalen > 0)
33711 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
33713 short_channel_ids_arg_constr.data = NULL;
33714 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
33715 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
33716 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
33717 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
33719 FREE(short_channel_ids_arg);
33720 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
33721 uint64_t ret_ref = 0;
33722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33727 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
33728 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
33729 uint64_t ret_ref = 0;
33730 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33731 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33734 int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) {
33735 LDKQueryShortChannelIds arg_conv;
33736 arg_conv.inner = untag_ptr(arg);
33737 arg_conv.is_owned = ptr_is_owned(arg);
33738 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33739 arg_conv.is_owned = false;
33740 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
33744 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) {
33745 LDKQueryShortChannelIds orig_conv;
33746 orig_conv.inner = untag_ptr(orig);
33747 orig_conv.is_owned = ptr_is_owned(orig);
33748 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33749 orig_conv.is_owned = false;
33750 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
33751 uint64_t ret_ref = 0;
33752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33757 jboolean __attribute__((export_name("TS_QueryShortChannelIds_eq"))) TS_QueryShortChannelIds_eq(uint64_t a, uint64_t b) {
33758 LDKQueryShortChannelIds a_conv;
33759 a_conv.inner = untag_ptr(a);
33760 a_conv.is_owned = ptr_is_owned(a);
33761 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33762 a_conv.is_owned = false;
33763 LDKQueryShortChannelIds b_conv;
33764 b_conv.inner = untag_ptr(b);
33765 b_conv.is_owned = ptr_is_owned(b);
33766 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33767 b_conv.is_owned = false;
33768 jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
33772 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
33773 LDKReplyShortChannelIdsEnd this_obj_conv;
33774 this_obj_conv.inner = untag_ptr(this_obj);
33775 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33777 ReplyShortChannelIdsEnd_free(this_obj_conv);
33780 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) {
33781 LDKReplyShortChannelIdsEnd this_ptr_conv;
33782 this_ptr_conv.inner = untag_ptr(this_ptr);
33783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33785 this_ptr_conv.is_owned = false;
33786 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33787 memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32);
33791 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
33792 LDKReplyShortChannelIdsEnd this_ptr_conv;
33793 this_ptr_conv.inner = untag_ptr(this_ptr);
33794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33796 this_ptr_conv.is_owned = false;
33797 LDKThirtyTwoBytes val_ref;
33798 CHECK(val->arr_len == 32);
33799 memcpy(val_ref.data, val->elems, 32); FREE(val);
33800 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
33803 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) {
33804 LDKReplyShortChannelIdsEnd this_ptr_conv;
33805 this_ptr_conv.inner = untag_ptr(this_ptr);
33806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33808 this_ptr_conv.is_owned = false;
33809 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
33813 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) {
33814 LDKReplyShortChannelIdsEnd this_ptr_conv;
33815 this_ptr_conv.inner = untag_ptr(this_ptr);
33816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33818 this_ptr_conv.is_owned = false;
33819 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
33822 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) {
33823 LDKThirtyTwoBytes chain_hash_arg_ref;
33824 CHECK(chain_hash_arg->arr_len == 32);
33825 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33826 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
33827 uint64_t ret_ref = 0;
33828 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33829 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33833 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
33834 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
33835 uint64_t ret_ref = 0;
33836 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33837 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33840 int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) {
33841 LDKReplyShortChannelIdsEnd arg_conv;
33842 arg_conv.inner = untag_ptr(arg);
33843 arg_conv.is_owned = ptr_is_owned(arg);
33844 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33845 arg_conv.is_owned = false;
33846 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
33850 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) {
33851 LDKReplyShortChannelIdsEnd orig_conv;
33852 orig_conv.inner = untag_ptr(orig);
33853 orig_conv.is_owned = ptr_is_owned(orig);
33854 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33855 orig_conv.is_owned = false;
33856 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
33857 uint64_t ret_ref = 0;
33858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33863 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_eq"))) TS_ReplyShortChannelIdsEnd_eq(uint64_t a, uint64_t b) {
33864 LDKReplyShortChannelIdsEnd a_conv;
33865 a_conv.inner = untag_ptr(a);
33866 a_conv.is_owned = ptr_is_owned(a);
33867 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33868 a_conv.is_owned = false;
33869 LDKReplyShortChannelIdsEnd b_conv;
33870 b_conv.inner = untag_ptr(b);
33871 b_conv.is_owned = ptr_is_owned(b);
33872 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33873 b_conv.is_owned = false;
33874 jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
33878 void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
33879 LDKGossipTimestampFilter this_obj_conv;
33880 this_obj_conv.inner = untag_ptr(this_obj);
33881 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33883 GossipTimestampFilter_free(this_obj_conv);
33886 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) {
33887 LDKGossipTimestampFilter this_ptr_conv;
33888 this_ptr_conv.inner = untag_ptr(this_ptr);
33889 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33891 this_ptr_conv.is_owned = false;
33892 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33893 memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32);
33897 void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
33898 LDKGossipTimestampFilter this_ptr_conv;
33899 this_ptr_conv.inner = untag_ptr(this_ptr);
33900 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33902 this_ptr_conv.is_owned = false;
33903 LDKThirtyTwoBytes val_ref;
33904 CHECK(val->arr_len == 32);
33905 memcpy(val_ref.data, val->elems, 32); FREE(val);
33906 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
33909 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) {
33910 LDKGossipTimestampFilter this_ptr_conv;
33911 this_ptr_conv.inner = untag_ptr(this_ptr);
33912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33914 this_ptr_conv.is_owned = false;
33915 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
33919 void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) {
33920 LDKGossipTimestampFilter this_ptr_conv;
33921 this_ptr_conv.inner = untag_ptr(this_ptr);
33922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33924 this_ptr_conv.is_owned = false;
33925 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
33928 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) {
33929 LDKGossipTimestampFilter this_ptr_conv;
33930 this_ptr_conv.inner = untag_ptr(this_ptr);
33931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33933 this_ptr_conv.is_owned = false;
33934 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
33938 void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) {
33939 LDKGossipTimestampFilter this_ptr_conv;
33940 this_ptr_conv.inner = untag_ptr(this_ptr);
33941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33943 this_ptr_conv.is_owned = false;
33944 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
33947 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_new"))) TS_GossipTimestampFilter_new(int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) {
33948 LDKThirtyTwoBytes chain_hash_arg_ref;
33949 CHECK(chain_hash_arg->arr_len == 32);
33950 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33951 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
33952 uint64_t ret_ref = 0;
33953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33954 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33958 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
33959 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
33960 uint64_t ret_ref = 0;
33961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33965 int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) {
33966 LDKGossipTimestampFilter arg_conv;
33967 arg_conv.inner = untag_ptr(arg);
33968 arg_conv.is_owned = ptr_is_owned(arg);
33969 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33970 arg_conv.is_owned = false;
33971 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
33975 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) {
33976 LDKGossipTimestampFilter orig_conv;
33977 orig_conv.inner = untag_ptr(orig);
33978 orig_conv.is_owned = ptr_is_owned(orig);
33979 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33980 orig_conv.is_owned = false;
33981 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
33982 uint64_t ret_ref = 0;
33983 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33984 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33988 jboolean __attribute__((export_name("TS_GossipTimestampFilter_eq"))) TS_GossipTimestampFilter_eq(uint64_t a, uint64_t b) {
33989 LDKGossipTimestampFilter a_conv;
33990 a_conv.inner = untag_ptr(a);
33991 a_conv.is_owned = ptr_is_owned(a);
33992 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33993 a_conv.is_owned = false;
33994 LDKGossipTimestampFilter b_conv;
33995 b_conv.inner = untag_ptr(b);
33996 b_conv.is_owned = ptr_is_owned(b);
33997 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33998 b_conv.is_owned = false;
33999 jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
34003 void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
34004 if (!ptr_is_owned(this_ptr)) return;
34005 void* this_ptr_ptr = untag_ptr(this_ptr);
34006 CHECK_ACCESS(this_ptr_ptr);
34007 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
34008 FREE(untag_ptr(this_ptr));
34009 ErrorAction_free(this_ptr_conv);
34012 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
34013 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34014 *ret_copy = ErrorAction_clone(arg);
34015 uint64_t ret_ref = tag_ptr(ret_copy, true);
34018 int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) {
34019 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
34020 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
34024 uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) {
34025 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
34026 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34027 *ret_copy = ErrorAction_clone(orig_conv);
34028 uint64_t ret_ref = tag_ptr(ret_copy, true);
34032 uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) {
34033 LDKErrorMessage msg_conv;
34034 msg_conv.inner = untag_ptr(msg);
34035 msg_conv.is_owned = ptr_is_owned(msg);
34036 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
34037 msg_conv = ErrorMessage_clone(&msg_conv);
34038 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34039 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
34040 uint64_t ret_ref = tag_ptr(ret_copy, true);
34044 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() {
34045 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34046 *ret_copy = ErrorAction_ignore_error();
34047 uint64_t ret_ref = tag_ptr(ret_copy, true);
34051 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
34052 LDKLevel a_conv = LDKLevel_from_js(a);
34053 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34054 *ret_copy = ErrorAction_ignore_and_log(a_conv);
34055 uint64_t ret_ref = tag_ptr(ret_copy, true);
34059 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() {
34060 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34061 *ret_copy = ErrorAction_ignore_duplicate_gossip();
34062 uint64_t ret_ref = tag_ptr(ret_copy, true);
34066 uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) {
34067 LDKErrorMessage msg_conv;
34068 msg_conv.inner = untag_ptr(msg);
34069 msg_conv.is_owned = ptr_is_owned(msg);
34070 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
34071 msg_conv = ErrorMessage_clone(&msg_conv);
34072 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34073 *ret_copy = ErrorAction_send_error_message(msg_conv);
34074 uint64_t ret_ref = tag_ptr(ret_copy, true);
34078 uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) {
34079 LDKWarningMessage msg_conv;
34080 msg_conv.inner = untag_ptr(msg);
34081 msg_conv.is_owned = ptr_is_owned(msg);
34082 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
34083 msg_conv = WarningMessage_clone(&msg_conv);
34084 LDKLevel log_level_conv = LDKLevel_from_js(log_level);
34085 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34086 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
34087 uint64_t ret_ref = tag_ptr(ret_copy, true);
34091 void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) {
34092 LDKLightningError this_obj_conv;
34093 this_obj_conv.inner = untag_ptr(this_obj);
34094 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34096 LightningError_free(this_obj_conv);
34099 jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) {
34100 LDKLightningError this_ptr_conv;
34101 this_ptr_conv.inner = untag_ptr(this_ptr);
34102 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34104 this_ptr_conv.is_owned = false;
34105 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
34106 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
34111 void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) {
34112 LDKLightningError this_ptr_conv;
34113 this_ptr_conv.inner = untag_ptr(this_ptr);
34114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34116 this_ptr_conv.is_owned = false;
34117 LDKStr val_conv = str_ref_to_owned_c(val);
34118 LightningError_set_err(&this_ptr_conv, val_conv);
34121 uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) {
34122 LDKLightningError this_ptr_conv;
34123 this_ptr_conv.inner = untag_ptr(this_ptr);
34124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34126 this_ptr_conv.is_owned = false;
34127 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
34128 *ret_copy = LightningError_get_action(&this_ptr_conv);
34129 uint64_t ret_ref = tag_ptr(ret_copy, true);
34133 void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) {
34134 LDKLightningError this_ptr_conv;
34135 this_ptr_conv.inner = untag_ptr(this_ptr);
34136 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34138 this_ptr_conv.is_owned = false;
34139 void* val_ptr = untag_ptr(val);
34140 CHECK_ACCESS(val_ptr);
34141 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
34142 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
34143 LightningError_set_action(&this_ptr_conv, val_conv);
34146 uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) {
34147 LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
34148 void* action_arg_ptr = untag_ptr(action_arg);
34149 CHECK_ACCESS(action_arg_ptr);
34150 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
34151 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
34152 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
34153 uint64_t ret_ref = 0;
34154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34159 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
34160 LDKLightningError ret_var = LightningError_clone(arg);
34161 uint64_t ret_ref = 0;
34162 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34163 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34166 int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) {
34167 LDKLightningError arg_conv;
34168 arg_conv.inner = untag_ptr(arg);
34169 arg_conv.is_owned = ptr_is_owned(arg);
34170 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34171 arg_conv.is_owned = false;
34172 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
34176 uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) {
34177 LDKLightningError orig_conv;
34178 orig_conv.inner = untag_ptr(orig);
34179 orig_conv.is_owned = ptr_is_owned(orig);
34180 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34181 orig_conv.is_owned = false;
34182 LDKLightningError ret_var = LightningError_clone(&orig_conv);
34183 uint64_t ret_ref = 0;
34184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34189 void __attribute__((export_name("TS_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) {
34190 LDKCommitmentUpdate this_obj_conv;
34191 this_obj_conv.inner = untag_ptr(this_obj);
34192 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34194 CommitmentUpdate_free(this_obj_conv);
34197 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) {
34198 LDKCommitmentUpdate this_ptr_conv;
34199 this_ptr_conv.inner = untag_ptr(this_ptr);
34200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34202 this_ptr_conv.is_owned = false;
34203 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
34204 uint64_tArray ret_arr = NULL;
34205 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
34206 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
34207 for (size_t p = 0; p < ret_var.datalen; p++) {
34208 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
34209 uint64_t ret_conv_15_ref = 0;
34210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
34211 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
34212 ret_arr_ptr[p] = ret_conv_15_ref;
34215 FREE(ret_var.data);
34219 void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) {
34220 LDKCommitmentUpdate 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 LDKCVec_UpdateAddHTLCZ val_constr;
34226 val_constr.datalen = val->arr_len;
34227 if (val_constr.datalen > 0)
34228 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
34230 val_constr.data = NULL;
34231 uint64_t* val_vals = val->elems;
34232 for (size_t p = 0; p < val_constr.datalen; p++) {
34233 uint64_t val_conv_15 = val_vals[p];
34234 LDKUpdateAddHTLC val_conv_15_conv;
34235 val_conv_15_conv.inner = untag_ptr(val_conv_15);
34236 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
34237 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
34238 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
34239 val_constr.data[p] = val_conv_15_conv;
34242 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
34245 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) {
34246 LDKCommitmentUpdate this_ptr_conv;
34247 this_ptr_conv.inner = untag_ptr(this_ptr);
34248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34250 this_ptr_conv.is_owned = false;
34251 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
34252 uint64_tArray ret_arr = NULL;
34253 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
34254 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
34255 for (size_t t = 0; t < ret_var.datalen; t++) {
34256 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
34257 uint64_t ret_conv_19_ref = 0;
34258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
34259 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
34260 ret_arr_ptr[t] = ret_conv_19_ref;
34263 FREE(ret_var.data);
34267 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) {
34268 LDKCommitmentUpdate this_ptr_conv;
34269 this_ptr_conv.inner = untag_ptr(this_ptr);
34270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34272 this_ptr_conv.is_owned = false;
34273 LDKCVec_UpdateFulfillHTLCZ val_constr;
34274 val_constr.datalen = val->arr_len;
34275 if (val_constr.datalen > 0)
34276 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
34278 val_constr.data = NULL;
34279 uint64_t* val_vals = val->elems;
34280 for (size_t t = 0; t < val_constr.datalen; t++) {
34281 uint64_t val_conv_19 = val_vals[t];
34282 LDKUpdateFulfillHTLC val_conv_19_conv;
34283 val_conv_19_conv.inner = untag_ptr(val_conv_19);
34284 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
34285 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
34286 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
34287 val_constr.data[t] = val_conv_19_conv;
34290 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
34293 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) {
34294 LDKCommitmentUpdate this_ptr_conv;
34295 this_ptr_conv.inner = untag_ptr(this_ptr);
34296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34298 this_ptr_conv.is_owned = false;
34299 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
34300 uint64_tArray ret_arr = NULL;
34301 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
34302 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
34303 for (size_t q = 0; q < ret_var.datalen; q++) {
34304 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
34305 uint64_t ret_conv_16_ref = 0;
34306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
34307 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
34308 ret_arr_ptr[q] = ret_conv_16_ref;
34311 FREE(ret_var.data);
34315 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) {
34316 LDKCommitmentUpdate this_ptr_conv;
34317 this_ptr_conv.inner = untag_ptr(this_ptr);
34318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34320 this_ptr_conv.is_owned = false;
34321 LDKCVec_UpdateFailHTLCZ val_constr;
34322 val_constr.datalen = val->arr_len;
34323 if (val_constr.datalen > 0)
34324 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
34326 val_constr.data = NULL;
34327 uint64_t* val_vals = val->elems;
34328 for (size_t q = 0; q < val_constr.datalen; q++) {
34329 uint64_t val_conv_16 = val_vals[q];
34330 LDKUpdateFailHTLC val_conv_16_conv;
34331 val_conv_16_conv.inner = untag_ptr(val_conv_16);
34332 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
34333 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
34334 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
34335 val_constr.data[q] = val_conv_16_conv;
34338 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
34341 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) {
34342 LDKCommitmentUpdate this_ptr_conv;
34343 this_ptr_conv.inner = untag_ptr(this_ptr);
34344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34346 this_ptr_conv.is_owned = false;
34347 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
34348 uint64_tArray ret_arr = NULL;
34349 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
34350 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
34351 for (size_t z = 0; z < ret_var.datalen; z++) {
34352 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
34353 uint64_t ret_conv_25_ref = 0;
34354 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
34355 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
34356 ret_arr_ptr[z] = ret_conv_25_ref;
34359 FREE(ret_var.data);
34363 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_set_update_fail_malformed_htlcs(uint64_t this_ptr, uint64_tArray val) {
34364 LDKCommitmentUpdate this_ptr_conv;
34365 this_ptr_conv.inner = untag_ptr(this_ptr);
34366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34368 this_ptr_conv.is_owned = false;
34369 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
34370 val_constr.datalen = val->arr_len;
34371 if (val_constr.datalen > 0)
34372 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
34374 val_constr.data = NULL;
34375 uint64_t* val_vals = val->elems;
34376 for (size_t z = 0; z < val_constr.datalen; z++) {
34377 uint64_t val_conv_25 = val_vals[z];
34378 LDKUpdateFailMalformedHTLC val_conv_25_conv;
34379 val_conv_25_conv.inner = untag_ptr(val_conv_25);
34380 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
34381 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
34382 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
34383 val_constr.data[z] = val_conv_25_conv;
34386 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
34389 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) {
34390 LDKCommitmentUpdate this_ptr_conv;
34391 this_ptr_conv.inner = untag_ptr(this_ptr);
34392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34394 this_ptr_conv.is_owned = false;
34395 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
34396 uint64_t ret_ref = 0;
34397 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34398 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34402 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) {
34403 LDKCommitmentUpdate this_ptr_conv;
34404 this_ptr_conv.inner = untag_ptr(this_ptr);
34405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34407 this_ptr_conv.is_owned = false;
34408 LDKUpdateFee val_conv;
34409 val_conv.inner = untag_ptr(val);
34410 val_conv.is_owned = ptr_is_owned(val);
34411 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34412 val_conv = UpdateFee_clone(&val_conv);
34413 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
34416 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) {
34417 LDKCommitmentUpdate this_ptr_conv;
34418 this_ptr_conv.inner = untag_ptr(this_ptr);
34419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34421 this_ptr_conv.is_owned = false;
34422 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
34423 uint64_t ret_ref = 0;
34424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34429 void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) {
34430 LDKCommitmentUpdate this_ptr_conv;
34431 this_ptr_conv.inner = untag_ptr(this_ptr);
34432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34434 this_ptr_conv.is_owned = false;
34435 LDKCommitmentSigned val_conv;
34436 val_conv.inner = untag_ptr(val);
34437 val_conv.is_owned = ptr_is_owned(val);
34438 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34439 val_conv = CommitmentSigned_clone(&val_conv);
34440 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
34443 uint64_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentUpdate_new(uint64_tArray update_add_htlcs_arg, uint64_tArray update_fulfill_htlcs_arg, uint64_tArray update_fail_htlcs_arg, uint64_tArray update_fail_malformed_htlcs_arg, uint64_t update_fee_arg, uint64_t commitment_signed_arg) {
34444 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
34445 update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len;
34446 if (update_add_htlcs_arg_constr.datalen > 0)
34447 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
34449 update_add_htlcs_arg_constr.data = NULL;
34450 uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
34451 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
34452 uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
34453 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
34454 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
34455 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
34456 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
34457 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
34458 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
34460 FREE(update_add_htlcs_arg);
34461 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
34462 update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
34463 if (update_fulfill_htlcs_arg_constr.datalen > 0)
34464 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
34466 update_fulfill_htlcs_arg_constr.data = NULL;
34467 uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
34468 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
34469 uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
34470 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
34471 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
34472 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
34473 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
34474 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
34475 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
34477 FREE(update_fulfill_htlcs_arg);
34478 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
34479 update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
34480 if (update_fail_htlcs_arg_constr.datalen > 0)
34481 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
34483 update_fail_htlcs_arg_constr.data = NULL;
34484 uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
34485 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
34486 uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
34487 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
34488 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
34489 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
34490 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
34491 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
34492 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
34494 FREE(update_fail_htlcs_arg);
34495 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
34496 update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
34497 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
34498 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
34500 update_fail_malformed_htlcs_arg_constr.data = NULL;
34501 uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
34502 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
34503 uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
34504 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
34505 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
34506 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
34507 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
34508 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
34509 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
34511 FREE(update_fail_malformed_htlcs_arg);
34512 LDKUpdateFee update_fee_arg_conv;
34513 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
34514 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
34515 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
34516 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
34517 LDKCommitmentSigned commitment_signed_arg_conv;
34518 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
34519 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
34520 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
34521 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
34522 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);
34523 uint64_t ret_ref = 0;
34524 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34525 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34529 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
34530 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
34531 uint64_t ret_ref = 0;
34532 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34533 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34536 int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) {
34537 LDKCommitmentUpdate arg_conv;
34538 arg_conv.inner = untag_ptr(arg);
34539 arg_conv.is_owned = ptr_is_owned(arg);
34540 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34541 arg_conv.is_owned = false;
34542 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
34546 uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) {
34547 LDKCommitmentUpdate orig_conv;
34548 orig_conv.inner = untag_ptr(orig);
34549 orig_conv.is_owned = ptr_is_owned(orig);
34550 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34551 orig_conv.is_owned = false;
34552 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
34553 uint64_t ret_ref = 0;
34554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34559 jboolean __attribute__((export_name("TS_CommitmentUpdate_eq"))) TS_CommitmentUpdate_eq(uint64_t a, uint64_t b) {
34560 LDKCommitmentUpdate a_conv;
34561 a_conv.inner = untag_ptr(a);
34562 a_conv.is_owned = ptr_is_owned(a);
34563 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34564 a_conv.is_owned = false;
34565 LDKCommitmentUpdate b_conv;
34566 b_conv.inner = untag_ptr(b);
34567 b_conv.is_owned = ptr_is_owned(b);
34568 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34569 b_conv.is_owned = false;
34570 jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
34574 void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
34575 if (!ptr_is_owned(this_ptr)) return;
34576 void* this_ptr_ptr = untag_ptr(this_ptr);
34577 CHECK_ACCESS(this_ptr_ptr);
34578 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
34579 FREE(untag_ptr(this_ptr));
34580 ChannelMessageHandler_free(this_ptr_conv);
34583 void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint64_t this_ptr) {
34584 if (!ptr_is_owned(this_ptr)) return;
34585 void* this_ptr_ptr = untag_ptr(this_ptr);
34586 CHECK_ACCESS(this_ptr_ptr);
34587 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
34588 FREE(untag_ptr(this_ptr));
34589 RoutingMessageHandler_free(this_ptr_conv);
34592 void __attribute__((export_name("TS_OnionMessageHandler_free"))) TS_OnionMessageHandler_free(uint64_t this_ptr) {
34593 if (!ptr_is_owned(this_ptr)) return;
34594 void* this_ptr_ptr = untag_ptr(this_ptr);
34595 CHECK_ACCESS(this_ptr_ptr);
34596 LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
34597 FREE(untag_ptr(this_ptr));
34598 OnionMessageHandler_free(this_ptr_conv);
34601 int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
34602 LDKAcceptChannel obj_conv;
34603 obj_conv.inner = untag_ptr(obj);
34604 obj_conv.is_owned = ptr_is_owned(obj);
34605 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34606 obj_conv.is_owned = false;
34607 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
34608 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34609 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34610 CVec_u8Z_free(ret_var);
34614 uint64_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
34615 LDKu8slice ser_ref;
34616 ser_ref.datalen = ser->arr_len;
34617 ser_ref.data = ser->elems;
34618 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
34619 *ret_conv = AcceptChannel_read(ser_ref);
34621 return tag_ptr(ret_conv, true);
34624 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) {
34625 LDKAnnouncementSignatures obj_conv;
34626 obj_conv.inner = untag_ptr(obj);
34627 obj_conv.is_owned = ptr_is_owned(obj);
34628 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34629 obj_conv.is_owned = false;
34630 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
34631 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34632 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34633 CVec_u8Z_free(ret_var);
34637 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
34638 LDKu8slice ser_ref;
34639 ser_ref.datalen = ser->arr_len;
34640 ser_ref.data = ser->elems;
34641 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
34642 *ret_conv = AnnouncementSignatures_read(ser_ref);
34644 return tag_ptr(ret_conv, true);
34647 int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) {
34648 LDKChannelReestablish obj_conv;
34649 obj_conv.inner = untag_ptr(obj);
34650 obj_conv.is_owned = ptr_is_owned(obj);
34651 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34652 obj_conv.is_owned = false;
34653 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
34654 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34655 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34656 CVec_u8Z_free(ret_var);
34660 uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
34661 LDKu8slice ser_ref;
34662 ser_ref.datalen = ser->arr_len;
34663 ser_ref.data = ser->elems;
34664 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
34665 *ret_conv = ChannelReestablish_read(ser_ref);
34667 return tag_ptr(ret_conv, true);
34670 int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) {
34671 LDKClosingSigned obj_conv;
34672 obj_conv.inner = untag_ptr(obj);
34673 obj_conv.is_owned = ptr_is_owned(obj);
34674 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34675 obj_conv.is_owned = false;
34676 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
34677 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34678 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34679 CVec_u8Z_free(ret_var);
34683 uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
34684 LDKu8slice ser_ref;
34685 ser_ref.datalen = ser->arr_len;
34686 ser_ref.data = ser->elems;
34687 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
34688 *ret_conv = ClosingSigned_read(ser_ref);
34690 return tag_ptr(ret_conv, true);
34693 int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) {
34694 LDKClosingSignedFeeRange obj_conv;
34695 obj_conv.inner = untag_ptr(obj);
34696 obj_conv.is_owned = ptr_is_owned(obj);
34697 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34698 obj_conv.is_owned = false;
34699 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
34700 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34701 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34702 CVec_u8Z_free(ret_var);
34706 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
34707 LDKu8slice ser_ref;
34708 ser_ref.datalen = ser->arr_len;
34709 ser_ref.data = ser->elems;
34710 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
34711 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
34713 return tag_ptr(ret_conv, true);
34716 int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) {
34717 LDKCommitmentSigned obj_conv;
34718 obj_conv.inner = untag_ptr(obj);
34719 obj_conv.is_owned = ptr_is_owned(obj);
34720 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34721 obj_conv.is_owned = false;
34722 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
34723 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34724 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34725 CVec_u8Z_free(ret_var);
34729 uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
34730 LDKu8slice ser_ref;
34731 ser_ref.datalen = ser->arr_len;
34732 ser_ref.data = ser->elems;
34733 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
34734 *ret_conv = CommitmentSigned_read(ser_ref);
34736 return tag_ptr(ret_conv, true);
34739 int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) {
34740 LDKFundingCreated obj_conv;
34741 obj_conv.inner = untag_ptr(obj);
34742 obj_conv.is_owned = ptr_is_owned(obj);
34743 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34744 obj_conv.is_owned = false;
34745 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
34746 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34747 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34748 CVec_u8Z_free(ret_var);
34752 uint64_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
34753 LDKu8slice ser_ref;
34754 ser_ref.datalen = ser->arr_len;
34755 ser_ref.data = ser->elems;
34756 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
34757 *ret_conv = FundingCreated_read(ser_ref);
34759 return tag_ptr(ret_conv, true);
34762 int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) {
34763 LDKFundingSigned obj_conv;
34764 obj_conv.inner = untag_ptr(obj);
34765 obj_conv.is_owned = ptr_is_owned(obj);
34766 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34767 obj_conv.is_owned = false;
34768 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
34769 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34770 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34771 CVec_u8Z_free(ret_var);
34775 uint64_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
34776 LDKu8slice ser_ref;
34777 ser_ref.datalen = ser->arr_len;
34778 ser_ref.data = ser->elems;
34779 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
34780 *ret_conv = FundingSigned_read(ser_ref);
34782 return tag_ptr(ret_conv, true);
34785 int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) {
34786 LDKChannelReady obj_conv;
34787 obj_conv.inner = untag_ptr(obj);
34788 obj_conv.is_owned = ptr_is_owned(obj);
34789 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34790 obj_conv.is_owned = false;
34791 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
34792 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34793 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34794 CVec_u8Z_free(ret_var);
34798 uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
34799 LDKu8slice ser_ref;
34800 ser_ref.datalen = ser->arr_len;
34801 ser_ref.data = ser->elems;
34802 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
34803 *ret_conv = ChannelReady_read(ser_ref);
34805 return tag_ptr(ret_conv, true);
34808 int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) {
34810 obj_conv.inner = untag_ptr(obj);
34811 obj_conv.is_owned = ptr_is_owned(obj);
34812 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34813 obj_conv.is_owned = false;
34814 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
34815 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34816 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34817 CVec_u8Z_free(ret_var);
34821 uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
34822 LDKu8slice ser_ref;
34823 ser_ref.datalen = ser->arr_len;
34824 ser_ref.data = ser->elems;
34825 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
34826 *ret_conv = Init_read(ser_ref);
34828 return tag_ptr(ret_conv, true);
34831 int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) {
34832 LDKOpenChannel obj_conv;
34833 obj_conv.inner = untag_ptr(obj);
34834 obj_conv.is_owned = ptr_is_owned(obj);
34835 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34836 obj_conv.is_owned = false;
34837 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
34838 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34839 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34840 CVec_u8Z_free(ret_var);
34844 uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
34845 LDKu8slice ser_ref;
34846 ser_ref.datalen = ser->arr_len;
34847 ser_ref.data = ser->elems;
34848 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
34849 *ret_conv = OpenChannel_read(ser_ref);
34851 return tag_ptr(ret_conv, true);
34854 int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) {
34855 LDKRevokeAndACK obj_conv;
34856 obj_conv.inner = untag_ptr(obj);
34857 obj_conv.is_owned = ptr_is_owned(obj);
34858 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34859 obj_conv.is_owned = false;
34860 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
34861 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34862 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34863 CVec_u8Z_free(ret_var);
34867 uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
34868 LDKu8slice ser_ref;
34869 ser_ref.datalen = ser->arr_len;
34870 ser_ref.data = ser->elems;
34871 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
34872 *ret_conv = RevokeAndACK_read(ser_ref);
34874 return tag_ptr(ret_conv, true);
34877 int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) {
34878 LDKShutdown obj_conv;
34879 obj_conv.inner = untag_ptr(obj);
34880 obj_conv.is_owned = ptr_is_owned(obj);
34881 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34882 obj_conv.is_owned = false;
34883 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
34884 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34885 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34886 CVec_u8Z_free(ret_var);
34890 uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
34891 LDKu8slice ser_ref;
34892 ser_ref.datalen = ser->arr_len;
34893 ser_ref.data = ser->elems;
34894 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
34895 *ret_conv = Shutdown_read(ser_ref);
34897 return tag_ptr(ret_conv, true);
34900 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) {
34901 LDKUpdateFailHTLC obj_conv;
34902 obj_conv.inner = untag_ptr(obj);
34903 obj_conv.is_owned = ptr_is_owned(obj);
34904 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34905 obj_conv.is_owned = false;
34906 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
34907 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34908 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34909 CVec_u8Z_free(ret_var);
34913 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
34914 LDKu8slice ser_ref;
34915 ser_ref.datalen = ser->arr_len;
34916 ser_ref.data = ser->elems;
34917 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
34918 *ret_conv = UpdateFailHTLC_read(ser_ref);
34920 return tag_ptr(ret_conv, true);
34923 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) {
34924 LDKUpdateFailMalformedHTLC obj_conv;
34925 obj_conv.inner = untag_ptr(obj);
34926 obj_conv.is_owned = ptr_is_owned(obj);
34927 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34928 obj_conv.is_owned = false;
34929 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
34930 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34931 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34932 CVec_u8Z_free(ret_var);
34936 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
34937 LDKu8slice ser_ref;
34938 ser_ref.datalen = ser->arr_len;
34939 ser_ref.data = ser->elems;
34940 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
34941 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
34943 return tag_ptr(ret_conv, true);
34946 int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) {
34947 LDKUpdateFee obj_conv;
34948 obj_conv.inner = untag_ptr(obj);
34949 obj_conv.is_owned = ptr_is_owned(obj);
34950 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34951 obj_conv.is_owned = false;
34952 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
34953 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34954 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34955 CVec_u8Z_free(ret_var);
34959 uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
34960 LDKu8slice ser_ref;
34961 ser_ref.datalen = ser->arr_len;
34962 ser_ref.data = ser->elems;
34963 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
34964 *ret_conv = UpdateFee_read(ser_ref);
34966 return tag_ptr(ret_conv, true);
34969 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) {
34970 LDKUpdateFulfillHTLC obj_conv;
34971 obj_conv.inner = untag_ptr(obj);
34972 obj_conv.is_owned = ptr_is_owned(obj);
34973 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34974 obj_conv.is_owned = false;
34975 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
34976 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34977 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34978 CVec_u8Z_free(ret_var);
34982 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
34983 LDKu8slice ser_ref;
34984 ser_ref.datalen = ser->arr_len;
34985 ser_ref.data = ser->elems;
34986 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
34987 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
34989 return tag_ptr(ret_conv, true);
34992 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) {
34993 LDKUpdateAddHTLC obj_conv;
34994 obj_conv.inner = untag_ptr(obj);
34995 obj_conv.is_owned = ptr_is_owned(obj);
34996 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34997 obj_conv.is_owned = false;
34998 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
34999 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35000 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35001 CVec_u8Z_free(ret_var);
35005 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
35006 LDKu8slice ser_ref;
35007 ser_ref.datalen = ser->arr_len;
35008 ser_ref.data = ser->elems;
35009 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
35010 *ret_conv = UpdateAddHTLC_read(ser_ref);
35012 return tag_ptr(ret_conv, true);
35015 uint64_t __attribute__((export_name("TS_OnionMessage_read"))) TS_OnionMessage_read(int8_tArray ser) {
35016 LDKu8slice ser_ref;
35017 ser_ref.datalen = ser->arr_len;
35018 ser_ref.data = ser->elems;
35019 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
35020 *ret_conv = OnionMessage_read(ser_ref);
35022 return tag_ptr(ret_conv, true);
35025 int8_tArray __attribute__((export_name("TS_OnionMessage_write"))) TS_OnionMessage_write(uint64_t obj) {
35026 LDKOnionMessage obj_conv;
35027 obj_conv.inner = untag_ptr(obj);
35028 obj_conv.is_owned = ptr_is_owned(obj);
35029 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35030 obj_conv.is_owned = false;
35031 LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
35032 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35033 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35034 CVec_u8Z_free(ret_var);
35038 int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
35040 obj_conv.inner = untag_ptr(obj);
35041 obj_conv.is_owned = ptr_is_owned(obj);
35042 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35043 obj_conv.is_owned = false;
35044 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
35045 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35046 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35047 CVec_u8Z_free(ret_var);
35051 uint64_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
35052 LDKu8slice ser_ref;
35053 ser_ref.datalen = ser->arr_len;
35054 ser_ref.data = ser->elems;
35055 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
35056 *ret_conv = Ping_read(ser_ref);
35058 return tag_ptr(ret_conv, true);
35061 int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) {
35063 obj_conv.inner = untag_ptr(obj);
35064 obj_conv.is_owned = ptr_is_owned(obj);
35065 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35066 obj_conv.is_owned = false;
35067 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
35068 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35069 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35070 CVec_u8Z_free(ret_var);
35074 uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
35075 LDKu8slice ser_ref;
35076 ser_ref.datalen = ser->arr_len;
35077 ser_ref.data = ser->elems;
35078 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
35079 *ret_conv = Pong_read(ser_ref);
35081 return tag_ptr(ret_conv, true);
35084 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) {
35085 LDKUnsignedChannelAnnouncement obj_conv;
35086 obj_conv.inner = untag_ptr(obj);
35087 obj_conv.is_owned = ptr_is_owned(obj);
35088 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35089 obj_conv.is_owned = false;
35090 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
35091 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35092 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35093 CVec_u8Z_free(ret_var);
35097 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
35098 LDKu8slice ser_ref;
35099 ser_ref.datalen = ser->arr_len;
35100 ser_ref.data = ser->elems;
35101 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
35102 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
35104 return tag_ptr(ret_conv, true);
35107 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) {
35108 LDKChannelAnnouncement obj_conv;
35109 obj_conv.inner = untag_ptr(obj);
35110 obj_conv.is_owned = ptr_is_owned(obj);
35111 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35112 obj_conv.is_owned = false;
35113 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
35114 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35115 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35116 CVec_u8Z_free(ret_var);
35120 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
35121 LDKu8slice ser_ref;
35122 ser_ref.datalen = ser->arr_len;
35123 ser_ref.data = ser->elems;
35124 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
35125 *ret_conv = ChannelAnnouncement_read(ser_ref);
35127 return tag_ptr(ret_conv, true);
35130 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) {
35131 LDKUnsignedChannelUpdate obj_conv;
35132 obj_conv.inner = untag_ptr(obj);
35133 obj_conv.is_owned = ptr_is_owned(obj);
35134 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35135 obj_conv.is_owned = false;
35136 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
35137 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35138 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35139 CVec_u8Z_free(ret_var);
35143 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
35144 LDKu8slice ser_ref;
35145 ser_ref.datalen = ser->arr_len;
35146 ser_ref.data = ser->elems;
35147 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
35148 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
35150 return tag_ptr(ret_conv, true);
35153 int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) {
35154 LDKChannelUpdate obj_conv;
35155 obj_conv.inner = untag_ptr(obj);
35156 obj_conv.is_owned = ptr_is_owned(obj);
35157 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35158 obj_conv.is_owned = false;
35159 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
35160 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35161 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35162 CVec_u8Z_free(ret_var);
35166 uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
35167 LDKu8slice ser_ref;
35168 ser_ref.datalen = ser->arr_len;
35169 ser_ref.data = ser->elems;
35170 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
35171 *ret_conv = ChannelUpdate_read(ser_ref);
35173 return tag_ptr(ret_conv, true);
35176 int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) {
35177 LDKErrorMessage obj_conv;
35178 obj_conv.inner = untag_ptr(obj);
35179 obj_conv.is_owned = ptr_is_owned(obj);
35180 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35181 obj_conv.is_owned = false;
35182 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
35183 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35184 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35185 CVec_u8Z_free(ret_var);
35189 uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
35190 LDKu8slice ser_ref;
35191 ser_ref.datalen = ser->arr_len;
35192 ser_ref.data = ser->elems;
35193 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
35194 *ret_conv = ErrorMessage_read(ser_ref);
35196 return tag_ptr(ret_conv, true);
35199 int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) {
35200 LDKWarningMessage obj_conv;
35201 obj_conv.inner = untag_ptr(obj);
35202 obj_conv.is_owned = ptr_is_owned(obj);
35203 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35204 obj_conv.is_owned = false;
35205 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
35206 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35207 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35208 CVec_u8Z_free(ret_var);
35212 uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
35213 LDKu8slice ser_ref;
35214 ser_ref.datalen = ser->arr_len;
35215 ser_ref.data = ser->elems;
35216 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
35217 *ret_conv = WarningMessage_read(ser_ref);
35219 return tag_ptr(ret_conv, true);
35222 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) {
35223 LDKUnsignedNodeAnnouncement obj_conv;
35224 obj_conv.inner = untag_ptr(obj);
35225 obj_conv.is_owned = ptr_is_owned(obj);
35226 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35227 obj_conv.is_owned = false;
35228 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
35229 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35230 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35231 CVec_u8Z_free(ret_var);
35235 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
35236 LDKu8slice ser_ref;
35237 ser_ref.datalen = ser->arr_len;
35238 ser_ref.data = ser->elems;
35239 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
35240 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
35242 return tag_ptr(ret_conv, true);
35245 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) {
35246 LDKNodeAnnouncement obj_conv;
35247 obj_conv.inner = untag_ptr(obj);
35248 obj_conv.is_owned = ptr_is_owned(obj);
35249 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35250 obj_conv.is_owned = false;
35251 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
35252 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35253 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35254 CVec_u8Z_free(ret_var);
35258 uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
35259 LDKu8slice ser_ref;
35260 ser_ref.datalen = ser->arr_len;
35261 ser_ref.data = ser->elems;
35262 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
35263 *ret_conv = NodeAnnouncement_read(ser_ref);
35265 return tag_ptr(ret_conv, true);
35268 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
35269 LDKu8slice ser_ref;
35270 ser_ref.datalen = ser->arr_len;
35271 ser_ref.data = ser->elems;
35272 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
35273 *ret_conv = QueryShortChannelIds_read(ser_ref);
35275 return tag_ptr(ret_conv, true);
35278 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) {
35279 LDKQueryShortChannelIds obj_conv;
35280 obj_conv.inner = untag_ptr(obj);
35281 obj_conv.is_owned = ptr_is_owned(obj);
35282 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35283 obj_conv.is_owned = false;
35284 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
35285 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35286 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35287 CVec_u8Z_free(ret_var);
35291 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) {
35292 LDKReplyShortChannelIdsEnd obj_conv;
35293 obj_conv.inner = untag_ptr(obj);
35294 obj_conv.is_owned = ptr_is_owned(obj);
35295 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35296 obj_conv.is_owned = false;
35297 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
35298 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35299 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35300 CVec_u8Z_free(ret_var);
35304 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
35305 LDKu8slice ser_ref;
35306 ser_ref.datalen = ser->arr_len;
35307 ser_ref.data = ser->elems;
35308 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
35309 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
35311 return tag_ptr(ret_conv, true);
35314 int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) {
35315 LDKQueryChannelRange this_arg_conv;
35316 this_arg_conv.inner = untag_ptr(this_arg);
35317 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35319 this_arg_conv.is_owned = false;
35320 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
35324 int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) {
35325 LDKQueryChannelRange obj_conv;
35326 obj_conv.inner = untag_ptr(obj);
35327 obj_conv.is_owned = ptr_is_owned(obj);
35328 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35329 obj_conv.is_owned = false;
35330 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
35331 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35332 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35333 CVec_u8Z_free(ret_var);
35337 uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
35338 LDKu8slice ser_ref;
35339 ser_ref.datalen = ser->arr_len;
35340 ser_ref.data = ser->elems;
35341 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
35342 *ret_conv = QueryChannelRange_read(ser_ref);
35344 return tag_ptr(ret_conv, true);
35347 uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
35348 LDKu8slice ser_ref;
35349 ser_ref.datalen = ser->arr_len;
35350 ser_ref.data = ser->elems;
35351 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
35352 *ret_conv = ReplyChannelRange_read(ser_ref);
35354 return tag_ptr(ret_conv, true);
35357 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) {
35358 LDKReplyChannelRange obj_conv;
35359 obj_conv.inner = untag_ptr(obj);
35360 obj_conv.is_owned = ptr_is_owned(obj);
35361 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35362 obj_conv.is_owned = false;
35363 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
35364 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35365 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35366 CVec_u8Z_free(ret_var);
35370 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) {
35371 LDKGossipTimestampFilter obj_conv;
35372 obj_conv.inner = untag_ptr(obj);
35373 obj_conv.is_owned = ptr_is_owned(obj);
35374 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35375 obj_conv.is_owned = false;
35376 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
35377 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35378 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35379 CVec_u8Z_free(ret_var);
35383 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
35384 LDKu8slice ser_ref;
35385 ser_ref.datalen = ser->arr_len;
35386 ser_ref.data = ser->elems;
35387 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
35388 *ret_conv = GossipTimestampFilter_read(ser_ref);
35390 return tag_ptr(ret_conv, true);
35393 void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint64_t this_ptr) {
35394 if (!ptr_is_owned(this_ptr)) return;
35395 void* this_ptr_ptr = untag_ptr(this_ptr);
35396 CHECK_ACCESS(this_ptr_ptr);
35397 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
35398 FREE(untag_ptr(this_ptr));
35399 CustomMessageHandler_free(this_ptr_conv);
35402 void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) {
35403 LDKIgnoringMessageHandler this_obj_conv;
35404 this_obj_conv.inner = untag_ptr(this_obj);
35405 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35407 IgnoringMessageHandler_free(this_obj_conv);
35410 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() {
35411 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
35412 uint64_t ret_ref = 0;
35413 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35414 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35418 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
35419 LDKIgnoringMessageHandler this_arg_conv;
35420 this_arg_conv.inner = untag_ptr(this_arg);
35421 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35423 this_arg_conv.is_owned = false;
35424 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
35425 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
35426 return tag_ptr(ret_ret, true);
35429 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint64_t this_arg) {
35430 LDKIgnoringMessageHandler this_arg_conv;
35431 this_arg_conv.inner = untag_ptr(this_arg);
35432 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35434 this_arg_conv.is_owned = false;
35435 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
35436 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
35437 return tag_ptr(ret_ret, true);
35440 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageProvider"))) TS_IgnoringMessageHandler_as_OnionMessageProvider(uint64_t this_arg) {
35441 LDKIgnoringMessageHandler this_arg_conv;
35442 this_arg_conv.inner = untag_ptr(this_arg);
35443 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35445 this_arg_conv.is_owned = false;
35446 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
35447 *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
35448 return tag_ptr(ret_ret, true);
35451 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageHandler"))) TS_IgnoringMessageHandler_as_OnionMessageHandler(uint64_t this_arg) {
35452 LDKIgnoringMessageHandler this_arg_conv;
35453 this_arg_conv.inner = untag_ptr(this_arg);
35454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35456 this_arg_conv.is_owned = false;
35457 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
35458 *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
35459 return tag_ptr(ret_ret, true);
35462 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomOnionMessageHandler"))) TS_IgnoringMessageHandler_as_CustomOnionMessageHandler(uint64_t this_arg) {
35463 LDKIgnoringMessageHandler this_arg_conv;
35464 this_arg_conv.inner = untag_ptr(this_arg);
35465 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35467 this_arg_conv.is_owned = false;
35468 LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
35469 *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
35470 return tag_ptr(ret_ret, true);
35473 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
35474 LDKIgnoringMessageHandler this_arg_conv;
35475 this_arg_conv.inner = untag_ptr(this_arg);
35476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35478 this_arg_conv.is_owned = false;
35479 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
35480 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
35481 return tag_ptr(ret_ret, true);
35484 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) {
35485 LDKIgnoringMessageHandler this_arg_conv;
35486 this_arg_conv.inner = untag_ptr(this_arg);
35487 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35489 this_arg_conv.is_owned = false;
35490 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
35491 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
35492 return tag_ptr(ret_ret, true);
35495 void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) {
35496 LDKErroringMessageHandler this_obj_conv;
35497 this_obj_conv.inner = untag_ptr(this_obj);
35498 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35499 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35500 ErroringMessageHandler_free(this_obj_conv);
35503 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() {
35504 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
35505 uint64_t ret_ref = 0;
35506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35511 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
35512 LDKErroringMessageHandler this_arg_conv;
35513 this_arg_conv.inner = untag_ptr(this_arg);
35514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35516 this_arg_conv.is_owned = false;
35517 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
35518 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
35519 return tag_ptr(ret_ret, true);
35522 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) {
35523 LDKErroringMessageHandler this_arg_conv;
35524 this_arg_conv.inner = untag_ptr(this_arg);
35525 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35527 this_arg_conv.is_owned = false;
35528 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
35529 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
35530 return tag_ptr(ret_ret, true);
35533 void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) {
35534 LDKMessageHandler this_obj_conv;
35535 this_obj_conv.inner = untag_ptr(this_obj);
35536 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35538 MessageHandler_free(this_obj_conv);
35541 uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_handler(uint64_t this_ptr) {
35542 LDKMessageHandler this_ptr_conv;
35543 this_ptr_conv.inner = untag_ptr(this_ptr);
35544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35546 this_ptr_conv.is_owned = false;
35547 // WARNING: This object doesn't live past this scope, needs clone!
35548 uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
35552 void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_handler(uint64_t this_ptr, uint64_t val) {
35553 LDKMessageHandler this_ptr_conv;
35554 this_ptr_conv.inner = untag_ptr(this_ptr);
35555 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35557 this_ptr_conv.is_owned = false;
35558 void* val_ptr = untag_ptr(val);
35559 CHECK_ACCESS(val_ptr);
35560 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
35561 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
35562 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35563 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
35565 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
35568 uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_handler(uint64_t this_ptr) {
35569 LDKMessageHandler this_ptr_conv;
35570 this_ptr_conv.inner = untag_ptr(this_ptr);
35571 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35573 this_ptr_conv.is_owned = false;
35574 // WARNING: This object doesn't live past this scope, needs clone!
35575 uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
35579 void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_handler(uint64_t this_ptr, uint64_t val) {
35580 LDKMessageHandler this_ptr_conv;
35581 this_ptr_conv.inner = untag_ptr(this_ptr);
35582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35584 this_ptr_conv.is_owned = false;
35585 void* val_ptr = untag_ptr(val);
35586 CHECK_ACCESS(val_ptr);
35587 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
35588 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
35589 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35590 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
35592 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
35595 uint64_t __attribute__((export_name("TS_MessageHandler_get_onion_message_handler"))) TS_MessageHandler_get_onion_message_handler(uint64_t this_ptr) {
35596 LDKMessageHandler this_ptr_conv;
35597 this_ptr_conv.inner = untag_ptr(this_ptr);
35598 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35600 this_ptr_conv.is_owned = false;
35601 // WARNING: This object doesn't live past this scope, needs clone!
35602 uint64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
35606 void __attribute__((export_name("TS_MessageHandler_set_onion_message_handler"))) TS_MessageHandler_set_onion_message_handler(uint64_t this_ptr, uint64_t val) {
35607 LDKMessageHandler this_ptr_conv;
35608 this_ptr_conv.inner = untag_ptr(this_ptr);
35609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35611 this_ptr_conv.is_owned = false;
35612 void* val_ptr = untag_ptr(val);
35613 CHECK_ACCESS(val_ptr);
35614 LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
35615 if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
35616 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35617 LDKOnionMessageHandler_JCalls_cloned(&val_conv);
35619 MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
35622 uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg, uint64_t onion_message_handler_arg) {
35623 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
35624 CHECK_ACCESS(chan_handler_arg_ptr);
35625 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
35626 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
35627 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35628 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
35630 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
35631 CHECK_ACCESS(route_handler_arg_ptr);
35632 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
35633 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
35634 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35635 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
35637 void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
35638 CHECK_ACCESS(onion_message_handler_arg_ptr);
35639 LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
35640 if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
35641 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35642 LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
35644 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
35645 uint64_t ret_ref = 0;
35646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35651 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
35652 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
35653 *ret_ret = SocketDescriptor_clone(arg);
35654 return tag_ptr(ret_ret, true);
35656 int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) {
35657 void* arg_ptr = untag_ptr(arg);
35658 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
35659 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
35660 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
35664 uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) {
35665 void* orig_ptr = untag_ptr(orig);
35666 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
35667 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
35668 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
35669 *ret_ret = SocketDescriptor_clone(orig_conv);
35670 return tag_ptr(ret_ret, true);
35673 void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint64_t this_ptr) {
35674 if (!ptr_is_owned(this_ptr)) return;
35675 void* this_ptr_ptr = untag_ptr(this_ptr);
35676 CHECK_ACCESS(this_ptr_ptr);
35677 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
35678 FREE(untag_ptr(this_ptr));
35679 SocketDescriptor_free(this_ptr_conv);
35682 void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) {
35683 LDKPeerHandleError this_obj_conv;
35684 this_obj_conv.inner = untag_ptr(this_obj);
35685 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35687 PeerHandleError_free(this_obj_conv);
35690 jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
35691 LDKPeerHandleError this_ptr_conv;
35692 this_ptr_conv.inner = untag_ptr(this_ptr);
35693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35695 this_ptr_conv.is_owned = false;
35696 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
35700 void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
35701 LDKPeerHandleError 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 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
35709 uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
35710 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
35711 uint64_t ret_ref = 0;
35712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35717 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
35718 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
35719 uint64_t ret_ref = 0;
35720 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35721 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35724 int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) {
35725 LDKPeerHandleError arg_conv;
35726 arg_conv.inner = untag_ptr(arg);
35727 arg_conv.is_owned = ptr_is_owned(arg);
35728 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35729 arg_conv.is_owned = false;
35730 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
35734 uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) {
35735 LDKPeerHandleError orig_conv;
35736 orig_conv.inner = untag_ptr(orig);
35737 orig_conv.is_owned = ptr_is_owned(orig);
35738 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35739 orig_conv.is_owned = false;
35740 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
35741 uint64_t ret_ref = 0;
35742 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35743 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35747 void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) {
35748 LDKPeerManager this_obj_conv;
35749 this_obj_conv.inner = untag_ptr(this_obj);
35750 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35752 PeerManager_free(this_obj_conv);
35755 uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int32_t current_time, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) {
35756 LDKMessageHandler message_handler_conv;
35757 message_handler_conv.inner = untag_ptr(message_handler);
35758 message_handler_conv.is_owned = ptr_is_owned(message_handler);
35759 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
35760 // WARNING: we need a move here but no clone is available for LDKMessageHandler
35762 LDKSecretKey our_node_secret_ref;
35763 CHECK(our_node_secret->arr_len == 32);
35764 memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
35765 unsigned char ephemeral_random_data_arr[32];
35766 CHECK(ephemeral_random_data->arr_len == 32);
35767 memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
35768 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
35769 void* logger_ptr = untag_ptr(logger);
35770 CHECK_ACCESS(logger_ptr);
35771 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
35772 if (logger_conv.free == LDKLogger_JCalls_free) {
35773 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35774 LDKLogger_JCalls_cloned(&logger_conv);
35776 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
35777 CHECK_ACCESS(custom_message_handler_ptr);
35778 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
35779 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
35780 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35781 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
35783 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
35784 uint64_t ret_ref = 0;
35785 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35786 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35790 ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
35791 LDKPeerManager this_arg_conv;
35792 this_arg_conv.inner = untag_ptr(this_arg);
35793 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35795 this_arg_conv.is_owned = false;
35796 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
35797 ptrArray ret_arr = NULL;
35798 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
35799 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
35800 for (size_t m = 0; m < ret_var.datalen; m++) {
35801 int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
35802 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
35803 ret_arr_ptr[m] = ret_conv_12_arr;
35806 FREE(ret_var.data);
35810 uint64_t __attribute__((export_name("TS_PeerManager_new_outbound_connection"))) TS_PeerManager_new_outbound_connection(uint64_t this_arg, int8_tArray their_node_id, uint64_t descriptor, uint64_t remote_network_address) {
35811 LDKPeerManager this_arg_conv;
35812 this_arg_conv.inner = untag_ptr(this_arg);
35813 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35815 this_arg_conv.is_owned = false;
35816 LDKPublicKey their_node_id_ref;
35817 CHECK(their_node_id->arr_len == 33);
35818 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
35819 void* descriptor_ptr = untag_ptr(descriptor);
35820 CHECK_ACCESS(descriptor_ptr);
35821 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
35822 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
35823 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35824 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
35826 void* remote_network_address_ptr = untag_ptr(remote_network_address);
35827 CHECK_ACCESS(remote_network_address_ptr);
35828 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
35829 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
35830 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
35831 return tag_ptr(ret_conv, true);
35834 uint64_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) TS_PeerManager_new_inbound_connection(uint64_t this_arg, uint64_t descriptor, uint64_t remote_network_address) {
35835 LDKPeerManager this_arg_conv;
35836 this_arg_conv.inner = untag_ptr(this_arg);
35837 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35839 this_arg_conv.is_owned = false;
35840 void* descriptor_ptr = untag_ptr(descriptor);
35841 CHECK_ACCESS(descriptor_ptr);
35842 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
35843 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
35844 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
35845 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
35847 void* remote_network_address_ptr = untag_ptr(remote_network_address);
35848 CHECK_ACCESS(remote_network_address_ptr);
35849 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
35850 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
35851 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
35852 return tag_ptr(ret_conv, true);
35855 uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) {
35856 LDKPeerManager this_arg_conv;
35857 this_arg_conv.inner = untag_ptr(this_arg);
35858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35860 this_arg_conv.is_owned = false;
35861 void* descriptor_ptr = untag_ptr(descriptor);
35862 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
35863 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
35864 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
35865 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
35866 return tag_ptr(ret_conv, true);
35869 uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) {
35870 LDKPeerManager this_arg_conv;
35871 this_arg_conv.inner = untag_ptr(this_arg);
35872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35874 this_arg_conv.is_owned = false;
35875 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
35876 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
35877 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
35878 LDKu8slice data_ref;
35879 data_ref.datalen = data->arr_len;
35880 data_ref.data = data->elems;
35881 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
35882 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
35884 return tag_ptr(ret_conv, true);
35887 void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) {
35888 LDKPeerManager this_arg_conv;
35889 this_arg_conv.inner = untag_ptr(this_arg);
35890 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35892 this_arg_conv.is_owned = false;
35893 PeerManager_process_events(&this_arg_conv);
35896 void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) {
35897 LDKPeerManager this_arg_conv;
35898 this_arg_conv.inner = untag_ptr(this_arg);
35899 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35901 this_arg_conv.is_owned = false;
35902 void* descriptor_ptr = untag_ptr(descriptor);
35903 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
35904 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
35905 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
35908 void __attribute__((export_name("TS_PeerManager_disconnect_by_node_id"))) TS_PeerManager_disconnect_by_node_id(uint64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) {
35909 LDKPeerManager this_arg_conv;
35910 this_arg_conv.inner = untag_ptr(this_arg);
35911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35913 this_arg_conv.is_owned = false;
35914 LDKPublicKey node_id_ref;
35915 CHECK(node_id->arr_len == 33);
35916 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
35917 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
35920 void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
35921 LDKPeerManager this_arg_conv;
35922 this_arg_conv.inner = untag_ptr(this_arg);
35923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35925 this_arg_conv.is_owned = false;
35926 PeerManager_disconnect_all_peers(&this_arg_conv);
35929 void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(uint64_t this_arg) {
35930 LDKPeerManager this_arg_conv;
35931 this_arg_conv.inner = untag_ptr(this_arg);
35932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35934 this_arg_conv.is_owned = false;
35935 PeerManager_timer_tick_occurred(&this_arg_conv);
35938 void __attribute__((export_name("TS_PeerManager_broadcast_node_announcement"))) TS_PeerManager_broadcast_node_announcement(uint64_t this_arg, int8_tArray rgb, int8_tArray alias, uint64_tArray addresses) {
35939 LDKPeerManager this_arg_conv;
35940 this_arg_conv.inner = untag_ptr(this_arg);
35941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35943 this_arg_conv.is_owned = false;
35944 LDKThreeBytes rgb_ref;
35945 CHECK(rgb->arr_len == 3);
35946 memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
35947 LDKThirtyTwoBytes alias_ref;
35948 CHECK(alias->arr_len == 32);
35949 memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
35950 LDKCVec_NetAddressZ addresses_constr;
35951 addresses_constr.datalen = addresses->arr_len;
35952 if (addresses_constr.datalen > 0)
35953 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
35955 addresses_constr.data = NULL;
35956 uint64_t* addresses_vals = addresses->elems;
35957 for (size_t m = 0; m < addresses_constr.datalen; m++) {
35958 uint64_t addresses_conv_12 = addresses_vals[m];
35959 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
35960 CHECK_ACCESS(addresses_conv_12_ptr);
35961 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
35962 addresses_constr.data[m] = addresses_conv_12_conv;
35965 PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
35968 int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
35969 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
35973 int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
35974 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
35978 int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
35979 unsigned char commitment_seed_arr[32];
35980 CHECK(commitment_seed->arr_len == 32);
35981 memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
35982 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
35983 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35984 memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
35988 int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_build_closing_transaction(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint64_t funding_outpoint) {
35989 LDKCVec_u8Z to_holder_script_ref;
35990 to_holder_script_ref.datalen = to_holder_script->arr_len;
35991 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
35992 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
35993 LDKCVec_u8Z to_counterparty_script_ref;
35994 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
35995 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
35996 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
35997 LDKOutPoint funding_outpoint_conv;
35998 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35999 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
36000 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
36001 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
36002 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);
36003 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36004 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36005 Transaction_free(ret_var);
36009 void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) {
36010 LDKCounterpartyCommitmentSecrets this_obj_conv;
36011 this_obj_conv.inner = untag_ptr(this_obj);
36012 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36014 CounterpartyCommitmentSecrets_free(this_obj_conv);
36017 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
36018 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
36019 uint64_t ret_ref = 0;
36020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36024 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) {
36025 LDKCounterpartyCommitmentSecrets arg_conv;
36026 arg_conv.inner = untag_ptr(arg);
36027 arg_conv.is_owned = ptr_is_owned(arg);
36028 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36029 arg_conv.is_owned = false;
36030 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
36034 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) {
36035 LDKCounterpartyCommitmentSecrets orig_conv;
36036 orig_conv.inner = untag_ptr(orig);
36037 orig_conv.is_owned = ptr_is_owned(orig);
36038 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36039 orig_conv.is_owned = false;
36040 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
36041 uint64_t ret_ref = 0;
36042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36043 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36047 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() {
36048 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
36049 uint64_t ret_ref = 0;
36050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36055 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) {
36056 LDKCounterpartyCommitmentSecrets this_arg_conv;
36057 this_arg_conv.inner = untag_ptr(this_arg);
36058 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36060 this_arg_conv.is_owned = false;
36061 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
36065 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) {
36066 LDKCounterpartyCommitmentSecrets this_arg_conv;
36067 this_arg_conv.inner = untag_ptr(this_arg);
36068 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36070 this_arg_conv.is_owned = false;
36071 LDKThirtyTwoBytes secret_ref;
36072 CHECK(secret->arr_len == 32);
36073 memcpy(secret_ref.data, secret->elems, 32); FREE(secret);
36074 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
36075 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
36076 return tag_ptr(ret_conv, true);
36079 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) {
36080 LDKCounterpartyCommitmentSecrets this_arg_conv;
36081 this_arg_conv.inner = untag_ptr(this_arg);
36082 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36084 this_arg_conv.is_owned = false;
36085 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
36086 memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32);
36090 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) {
36091 LDKCounterpartyCommitmentSecrets obj_conv;
36092 obj_conv.inner = untag_ptr(obj);
36093 obj_conv.is_owned = ptr_is_owned(obj);
36094 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36095 obj_conv.is_owned = false;
36096 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
36097 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36098 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36099 CVec_u8Z_free(ret_var);
36103 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
36104 LDKu8slice ser_ref;
36105 ser_ref.datalen = ser->arr_len;
36106 ser_ref.data = ser->elems;
36107 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
36108 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
36110 return tag_ptr(ret_conv, true);
36113 uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
36114 LDKPublicKey per_commitment_point_ref;
36115 CHECK(per_commitment_point->arr_len == 33);
36116 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
36117 unsigned char base_secret_arr[32];
36118 CHECK(base_secret->arr_len == 32);
36119 memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
36120 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
36121 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
36122 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
36123 return tag_ptr(ret_conv, true);
36126 uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
36127 LDKPublicKey per_commitment_point_ref;
36128 CHECK(per_commitment_point->arr_len == 33);
36129 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
36130 LDKPublicKey base_point_ref;
36131 CHECK(base_point->arr_len == 33);
36132 memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
36133 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
36134 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
36135 return tag_ptr(ret_conv, true);
36138 uint64_t __attribute__((export_name("TS_derive_private_revocation_key"))) TS_derive_private_revocation_key(int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) {
36139 unsigned char per_commitment_secret_arr[32];
36140 CHECK(per_commitment_secret->arr_len == 32);
36141 memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
36142 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
36143 unsigned char countersignatory_revocation_base_secret_arr[32];
36144 CHECK(countersignatory_revocation_base_secret->arr_len == 32);
36145 memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
36146 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
36147 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
36148 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
36149 return tag_ptr(ret_conv, true);
36152 uint64_t __attribute__((export_name("TS_derive_public_revocation_key"))) TS_derive_public_revocation_key(int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) {
36153 LDKPublicKey per_commitment_point_ref;
36154 CHECK(per_commitment_point->arr_len == 33);
36155 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
36156 LDKPublicKey countersignatory_revocation_base_point_ref;
36157 CHECK(countersignatory_revocation_base_point->arr_len == 33);
36158 memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
36159 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
36160 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
36161 return tag_ptr(ret_conv, true);
36164 void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
36165 LDKTxCreationKeys this_obj_conv;
36166 this_obj_conv.inner = untag_ptr(this_obj);
36167 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36169 TxCreationKeys_free(this_obj_conv);
36172 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) {
36173 LDKTxCreationKeys this_ptr_conv;
36174 this_ptr_conv.inner = untag_ptr(this_ptr);
36175 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36177 this_ptr_conv.is_owned = false;
36178 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36179 memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
36183 void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
36184 LDKTxCreationKeys this_ptr_conv;
36185 this_ptr_conv.inner = untag_ptr(this_ptr);
36186 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36188 this_ptr_conv.is_owned = false;
36189 LDKPublicKey val_ref;
36190 CHECK(val->arr_len == 33);
36191 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36192 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
36195 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) {
36196 LDKTxCreationKeys this_ptr_conv;
36197 this_ptr_conv.inner = untag_ptr(this_ptr);
36198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36200 this_ptr_conv.is_owned = false;
36201 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36202 memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
36206 void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) {
36207 LDKTxCreationKeys this_ptr_conv;
36208 this_ptr_conv.inner = untag_ptr(this_ptr);
36209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36211 this_ptr_conv.is_owned = false;
36212 LDKPublicKey val_ref;
36213 CHECK(val->arr_len == 33);
36214 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36215 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
36218 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) {
36219 LDKTxCreationKeys this_ptr_conv;
36220 this_ptr_conv.inner = untag_ptr(this_ptr);
36221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36223 this_ptr_conv.is_owned = false;
36224 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36225 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
36229 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) {
36230 LDKTxCreationKeys this_ptr_conv;
36231 this_ptr_conv.inner = untag_ptr(this_ptr);
36232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36234 this_ptr_conv.is_owned = false;
36235 LDKPublicKey val_ref;
36236 CHECK(val->arr_len == 33);
36237 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36238 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
36241 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) {
36242 LDKTxCreationKeys this_ptr_conv;
36243 this_ptr_conv.inner = untag_ptr(this_ptr);
36244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36246 this_ptr_conv.is_owned = false;
36247 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36248 memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
36252 void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) {
36253 LDKTxCreationKeys this_ptr_conv;
36254 this_ptr_conv.inner = untag_ptr(this_ptr);
36255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36257 this_ptr_conv.is_owned = false;
36258 LDKPublicKey val_ref;
36259 CHECK(val->arr_len == 33);
36260 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36261 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
36264 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) {
36265 LDKTxCreationKeys this_ptr_conv;
36266 this_ptr_conv.inner = untag_ptr(this_ptr);
36267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36269 this_ptr_conv.is_owned = false;
36270 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36271 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
36275 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_set_broadcaster_delayed_payment_key(uint64_t this_ptr, int8_tArray val) {
36276 LDKTxCreationKeys this_ptr_conv;
36277 this_ptr_conv.inner = untag_ptr(this_ptr);
36278 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36280 this_ptr_conv.is_owned = false;
36281 LDKPublicKey val_ref;
36282 CHECK(val->arr_len == 33);
36283 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36284 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
36287 uint64_t __attribute__((export_name("TS_TxCreationKeys_new"))) TS_TxCreationKeys_new(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) {
36288 LDKPublicKey per_commitment_point_arg_ref;
36289 CHECK(per_commitment_point_arg->arr_len == 33);
36290 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
36291 LDKPublicKey revocation_key_arg_ref;
36292 CHECK(revocation_key_arg->arr_len == 33);
36293 memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg);
36294 LDKPublicKey broadcaster_htlc_key_arg_ref;
36295 CHECK(broadcaster_htlc_key_arg->arr_len == 33);
36296 memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg);
36297 LDKPublicKey countersignatory_htlc_key_arg_ref;
36298 CHECK(countersignatory_htlc_key_arg->arr_len == 33);
36299 memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg);
36300 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
36301 CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33);
36302 memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg);
36303 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);
36304 uint64_t ret_ref = 0;
36305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36310 jboolean __attribute__((export_name("TS_TxCreationKeys_eq"))) TS_TxCreationKeys_eq(uint64_t a, uint64_t b) {
36311 LDKTxCreationKeys a_conv;
36312 a_conv.inner = untag_ptr(a);
36313 a_conv.is_owned = ptr_is_owned(a);
36314 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36315 a_conv.is_owned = false;
36316 LDKTxCreationKeys b_conv;
36317 b_conv.inner = untag_ptr(b);
36318 b_conv.is_owned = ptr_is_owned(b);
36319 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36320 b_conv.is_owned = false;
36321 jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
36325 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
36326 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
36327 uint64_t ret_ref = 0;
36328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36332 int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) {
36333 LDKTxCreationKeys arg_conv;
36334 arg_conv.inner = untag_ptr(arg);
36335 arg_conv.is_owned = ptr_is_owned(arg);
36336 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36337 arg_conv.is_owned = false;
36338 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
36342 uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) {
36343 LDKTxCreationKeys orig_conv;
36344 orig_conv.inner = untag_ptr(orig);
36345 orig_conv.is_owned = ptr_is_owned(orig);
36346 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36347 orig_conv.is_owned = false;
36348 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
36349 uint64_t ret_ref = 0;
36350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36355 int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) {
36356 LDKTxCreationKeys obj_conv;
36357 obj_conv.inner = untag_ptr(obj);
36358 obj_conv.is_owned = ptr_is_owned(obj);
36359 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36360 obj_conv.is_owned = false;
36361 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
36362 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36363 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36364 CVec_u8Z_free(ret_var);
36368 uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
36369 LDKu8slice ser_ref;
36370 ser_ref.datalen = ser->arr_len;
36371 ser_ref.data = ser->elems;
36372 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
36373 *ret_conv = TxCreationKeys_read(ser_ref);
36375 return tag_ptr(ret_conv, true);
36378 void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) {
36379 LDKChannelPublicKeys this_obj_conv;
36380 this_obj_conv.inner = untag_ptr(this_obj);
36381 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36383 ChannelPublicKeys_free(this_obj_conv);
36386 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) {
36387 LDKChannelPublicKeys this_ptr_conv;
36388 this_ptr_conv.inner = untag_ptr(this_ptr);
36389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36391 this_ptr_conv.is_owned = false;
36392 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36393 memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
36397 void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
36398 LDKChannelPublicKeys this_ptr_conv;
36399 this_ptr_conv.inner = untag_ptr(this_ptr);
36400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36402 this_ptr_conv.is_owned = false;
36403 LDKPublicKey val_ref;
36404 CHECK(val->arr_len == 33);
36405 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36406 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
36409 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) {
36410 LDKChannelPublicKeys this_ptr_conv;
36411 this_ptr_conv.inner = untag_ptr(this_ptr);
36412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36414 this_ptr_conv.is_owned = false;
36415 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36416 memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
36420 void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
36421 LDKChannelPublicKeys this_ptr_conv;
36422 this_ptr_conv.inner = untag_ptr(this_ptr);
36423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36425 this_ptr_conv.is_owned = false;
36426 LDKPublicKey val_ref;
36427 CHECK(val->arr_len == 33);
36428 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36429 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
36432 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) {
36433 LDKChannelPublicKeys this_ptr_conv;
36434 this_ptr_conv.inner = untag_ptr(this_ptr);
36435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36437 this_ptr_conv.is_owned = false;
36438 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36439 memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
36443 void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) {
36444 LDKChannelPublicKeys this_ptr_conv;
36445 this_ptr_conv.inner = untag_ptr(this_ptr);
36446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36448 this_ptr_conv.is_owned = false;
36449 LDKPublicKey val_ref;
36450 CHECK(val->arr_len == 33);
36451 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36452 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
36455 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) {
36456 LDKChannelPublicKeys this_ptr_conv;
36457 this_ptr_conv.inner = untag_ptr(this_ptr);
36458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36460 this_ptr_conv.is_owned = false;
36461 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36462 memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
36466 void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
36467 LDKChannelPublicKeys this_ptr_conv;
36468 this_ptr_conv.inner = untag_ptr(this_ptr);
36469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36471 this_ptr_conv.is_owned = false;
36472 LDKPublicKey val_ref;
36473 CHECK(val->arr_len == 33);
36474 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36475 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
36478 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) {
36479 LDKChannelPublicKeys this_ptr_conv;
36480 this_ptr_conv.inner = untag_ptr(this_ptr);
36481 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36483 this_ptr_conv.is_owned = false;
36484 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
36485 memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
36489 void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
36490 LDKChannelPublicKeys this_ptr_conv;
36491 this_ptr_conv.inner = untag_ptr(this_ptr);
36492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36494 this_ptr_conv.is_owned = false;
36495 LDKPublicKey val_ref;
36496 CHECK(val->arr_len == 33);
36497 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
36498 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
36501 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_new"))) TS_ChannelPublicKeys_new(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) {
36502 LDKPublicKey funding_pubkey_arg_ref;
36503 CHECK(funding_pubkey_arg->arr_len == 33);
36504 memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg);
36505 LDKPublicKey revocation_basepoint_arg_ref;
36506 CHECK(revocation_basepoint_arg->arr_len == 33);
36507 memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg);
36508 LDKPublicKey payment_point_arg_ref;
36509 CHECK(payment_point_arg->arr_len == 33);
36510 memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg);
36511 LDKPublicKey delayed_payment_basepoint_arg_ref;
36512 CHECK(delayed_payment_basepoint_arg->arr_len == 33);
36513 memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg);
36514 LDKPublicKey htlc_basepoint_arg_ref;
36515 CHECK(htlc_basepoint_arg->arr_len == 33);
36516 memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg);
36517 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);
36518 uint64_t ret_ref = 0;
36519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36524 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
36525 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
36526 uint64_t ret_ref = 0;
36527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36531 int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) {
36532 LDKChannelPublicKeys arg_conv;
36533 arg_conv.inner = untag_ptr(arg);
36534 arg_conv.is_owned = ptr_is_owned(arg);
36535 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36536 arg_conv.is_owned = false;
36537 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
36541 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) {
36542 LDKChannelPublicKeys orig_conv;
36543 orig_conv.inner = untag_ptr(orig);
36544 orig_conv.is_owned = ptr_is_owned(orig);
36545 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36546 orig_conv.is_owned = false;
36547 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
36548 uint64_t ret_ref = 0;
36549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36554 jboolean __attribute__((export_name("TS_ChannelPublicKeys_eq"))) TS_ChannelPublicKeys_eq(uint64_t a, uint64_t b) {
36555 LDKChannelPublicKeys a_conv;
36556 a_conv.inner = untag_ptr(a);
36557 a_conv.is_owned = ptr_is_owned(a);
36558 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36559 a_conv.is_owned = false;
36560 LDKChannelPublicKeys b_conv;
36561 b_conv.inner = untag_ptr(b);
36562 b_conv.is_owned = ptr_is_owned(b);
36563 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36564 b_conv.is_owned = false;
36565 jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
36569 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
36570 LDKChannelPublicKeys obj_conv;
36571 obj_conv.inner = untag_ptr(obj);
36572 obj_conv.is_owned = ptr_is_owned(obj);
36573 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36574 obj_conv.is_owned = false;
36575 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
36576 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36577 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36578 CVec_u8Z_free(ret_var);
36582 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
36583 LDKu8slice ser_ref;
36584 ser_ref.datalen = ser->arr_len;
36585 ser_ref.data = ser->elems;
36586 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
36587 *ret_conv = ChannelPublicKeys_read(ser_ref);
36589 return tag_ptr(ret_conv, true);
36592 uint64_t __attribute__((export_name("TS_TxCreationKeys_derive_new"))) TS_TxCreationKeys_derive_new(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) {
36593 LDKPublicKey per_commitment_point_ref;
36594 CHECK(per_commitment_point->arr_len == 33);
36595 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
36596 LDKPublicKey broadcaster_delayed_payment_base_ref;
36597 CHECK(broadcaster_delayed_payment_base->arr_len == 33);
36598 memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base);
36599 LDKPublicKey broadcaster_htlc_base_ref;
36600 CHECK(broadcaster_htlc_base->arr_len == 33);
36601 memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base);
36602 LDKPublicKey countersignatory_revocation_base_ref;
36603 CHECK(countersignatory_revocation_base->arr_len == 33);
36604 memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base);
36605 LDKPublicKey countersignatory_htlc_base_ref;
36606 CHECK(countersignatory_htlc_base->arr_len == 33);
36607 memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
36608 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
36609 *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref);
36610 return tag_ptr(ret_conv, true);
36613 uint64_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys"))) TS_TxCreationKeys_from_channel_static_keys(int8_tArray per_commitment_point, uint64_t broadcaster_keys, uint64_t countersignatory_keys) {
36614 LDKPublicKey per_commitment_point_ref;
36615 CHECK(per_commitment_point->arr_len == 33);
36616 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
36617 LDKChannelPublicKeys broadcaster_keys_conv;
36618 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
36619 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
36620 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
36621 broadcaster_keys_conv.is_owned = false;
36622 LDKChannelPublicKeys countersignatory_keys_conv;
36623 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
36624 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
36625 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
36626 countersignatory_keys_conv.is_owned = false;
36627 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
36628 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
36629 return tag_ptr(ret_conv, true);
36632 int8_tArray __attribute__((export_name("TS_get_revokeable_redeemscript"))) TS_get_revokeable_redeemscript(int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) {
36633 LDKPublicKey revocation_key_ref;
36634 CHECK(revocation_key->arr_len == 33);
36635 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
36636 LDKPublicKey broadcaster_delayed_payment_key_ref;
36637 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
36638 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
36639 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
36640 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36641 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36642 CVec_u8Z_free(ret_var);
36646 void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) {
36647 LDKHTLCOutputInCommitment this_obj_conv;
36648 this_obj_conv.inner = untag_ptr(this_obj);
36649 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36651 HTLCOutputInCommitment_free(this_obj_conv);
36654 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) {
36655 LDKHTLCOutputInCommitment this_ptr_conv;
36656 this_ptr_conv.inner = untag_ptr(this_ptr);
36657 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36659 this_ptr_conv.is_owned = false;
36660 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
36664 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) {
36665 LDKHTLCOutputInCommitment this_ptr_conv;
36666 this_ptr_conv.inner = untag_ptr(this_ptr);
36667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36669 this_ptr_conv.is_owned = false;
36670 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
36673 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) {
36674 LDKHTLCOutputInCommitment this_ptr_conv;
36675 this_ptr_conv.inner = untag_ptr(this_ptr);
36676 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36678 this_ptr_conv.is_owned = false;
36679 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
36683 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) {
36684 LDKHTLCOutputInCommitment 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 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
36692 int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) {
36693 LDKHTLCOutputInCommitment this_ptr_conv;
36694 this_ptr_conv.inner = untag_ptr(this_ptr);
36695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36697 this_ptr_conv.is_owned = false;
36698 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
36702 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
36703 LDKHTLCOutputInCommitment 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 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
36711 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) {
36712 LDKHTLCOutputInCommitment this_ptr_conv;
36713 this_ptr_conv.inner = untag_ptr(this_ptr);
36714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36716 this_ptr_conv.is_owned = false;
36717 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
36718 memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32);
36722 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
36723 LDKHTLCOutputInCommitment this_ptr_conv;
36724 this_ptr_conv.inner = untag_ptr(this_ptr);
36725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36727 this_ptr_conv.is_owned = false;
36728 LDKThirtyTwoBytes val_ref;
36729 CHECK(val->arr_len == 32);
36730 memcpy(val_ref.data, val->elems, 32); FREE(val);
36731 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
36734 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) {
36735 LDKHTLCOutputInCommitment this_ptr_conv;
36736 this_ptr_conv.inner = untag_ptr(this_ptr);
36737 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36739 this_ptr_conv.is_owned = false;
36740 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
36741 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
36742 uint64_t ret_ref = tag_ptr(ret_copy, true);
36746 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) {
36747 LDKHTLCOutputInCommitment this_ptr_conv;
36748 this_ptr_conv.inner = untag_ptr(this_ptr);
36749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36751 this_ptr_conv.is_owned = false;
36752 void* val_ptr = untag_ptr(val);
36753 CHECK_ACCESS(val_ptr);
36754 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
36755 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
36756 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
36759 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_new"))) TS_HTLCOutputInCommitment_new(jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint64_t transaction_output_index_arg) {
36760 LDKThirtyTwoBytes payment_hash_arg_ref;
36761 CHECK(payment_hash_arg->arr_len == 32);
36762 memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg);
36763 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
36764 CHECK_ACCESS(transaction_output_index_arg_ptr);
36765 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
36766 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
36767 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
36768 uint64_t ret_ref = 0;
36769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36770 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36774 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
36775 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
36776 uint64_t ret_ref = 0;
36777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36781 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) {
36782 LDKHTLCOutputInCommitment arg_conv;
36783 arg_conv.inner = untag_ptr(arg);
36784 arg_conv.is_owned = ptr_is_owned(arg);
36785 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36786 arg_conv.is_owned = false;
36787 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
36791 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) {
36792 LDKHTLCOutputInCommitment orig_conv;
36793 orig_conv.inner = untag_ptr(orig);
36794 orig_conv.is_owned = ptr_is_owned(orig);
36795 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36796 orig_conv.is_owned = false;
36797 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
36798 uint64_t ret_ref = 0;
36799 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36800 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36804 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_eq"))) TS_HTLCOutputInCommitment_eq(uint64_t a, uint64_t b) {
36805 LDKHTLCOutputInCommitment a_conv;
36806 a_conv.inner = untag_ptr(a);
36807 a_conv.is_owned = ptr_is_owned(a);
36808 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36809 a_conv.is_owned = false;
36810 LDKHTLCOutputInCommitment b_conv;
36811 b_conv.inner = untag_ptr(b);
36812 b_conv.is_owned = ptr_is_owned(b);
36813 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36814 b_conv.is_owned = false;
36815 jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
36819 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
36820 LDKHTLCOutputInCommitment obj_conv;
36821 obj_conv.inner = untag_ptr(obj);
36822 obj_conv.is_owned = ptr_is_owned(obj);
36823 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36824 obj_conv.is_owned = false;
36825 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
36826 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36827 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36828 CVec_u8Z_free(ret_var);
36832 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
36833 LDKu8slice ser_ref;
36834 ser_ref.datalen = ser->arr_len;
36835 ser_ref.data = ser->elems;
36836 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
36837 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
36839 return tag_ptr(ret_conv, true);
36842 int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) {
36843 LDKHTLCOutputInCommitment htlc_conv;
36844 htlc_conv.inner = untag_ptr(htlc);
36845 htlc_conv.is_owned = ptr_is_owned(htlc);
36846 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
36847 htlc_conv.is_owned = false;
36848 LDKTxCreationKeys keys_conv;
36849 keys_conv.inner = untag_ptr(keys);
36850 keys_conv.is_owned = ptr_is_owned(keys);
36851 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
36852 keys_conv.is_owned = false;
36853 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
36854 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36855 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36856 CVec_u8Z_free(ret_var);
36860 int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
36861 LDKPublicKey broadcaster_ref;
36862 CHECK(broadcaster->arr_len == 33);
36863 memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster);
36864 LDKPublicKey countersignatory_ref;
36865 CHECK(countersignatory->arr_len == 33);
36866 memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory);
36867 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
36868 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36869 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36870 CVec_u8Z_free(ret_var);
36874 int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
36875 unsigned char commitment_txid_arr[32];
36876 CHECK(commitment_txid->arr_len == 32);
36877 memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
36878 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
36879 LDKHTLCOutputInCommitment htlc_conv;
36880 htlc_conv.inner = untag_ptr(htlc);
36881 htlc_conv.is_owned = ptr_is_owned(htlc);
36882 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
36883 htlc_conv.is_owned = false;
36884 LDKPublicKey broadcaster_delayed_payment_key_ref;
36885 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
36886 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
36887 LDKPublicKey revocation_key_ref;
36888 CHECK(revocation_key->arr_len == 33);
36889 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
36890 LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
36891 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36892 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36893 Transaction_free(ret_var);
36897 int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
36898 LDKPublicKey funding_pubkey_ref;
36899 CHECK(funding_pubkey->arr_len == 33);
36900 memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey);
36901 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
36902 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36903 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36904 CVec_u8Z_free(ret_var);
36908 void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
36909 LDKChannelTransactionParameters this_obj_conv;
36910 this_obj_conv.inner = untag_ptr(this_obj);
36911 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36913 ChannelTransactionParameters_free(this_obj_conv);
36916 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint64_t this_ptr) {
36917 LDKChannelTransactionParameters this_ptr_conv;
36918 this_ptr_conv.inner = untag_ptr(this_ptr);
36919 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36921 this_ptr_conv.is_owned = false;
36922 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
36923 uint64_t ret_ref = 0;
36924 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36925 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36929 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_t val) {
36930 LDKChannelTransactionParameters this_ptr_conv;
36931 this_ptr_conv.inner = untag_ptr(this_ptr);
36932 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36934 this_ptr_conv.is_owned = false;
36935 LDKChannelPublicKeys val_conv;
36936 val_conv.inner = untag_ptr(val);
36937 val_conv.is_owned = ptr_is_owned(val);
36938 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36939 val_conv = ChannelPublicKeys_clone(&val_conv);
36940 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
36943 int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(uint64_t this_ptr) {
36944 LDKChannelTransactionParameters this_ptr_conv;
36945 this_ptr_conv.inner = untag_ptr(this_ptr);
36946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36948 this_ptr_conv.is_owned = false;
36949 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
36953 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_set_holder_selected_contest_delay(uint64_t this_ptr, int16_t val) {
36954 LDKChannelTransactionParameters this_ptr_conv;
36955 this_ptr_conv.inner = untag_ptr(this_ptr);
36956 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36958 this_ptr_conv.is_owned = false;
36959 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
36962 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(uint64_t this_ptr) {
36963 LDKChannelTransactionParameters this_ptr_conv;
36964 this_ptr_conv.inner = untag_ptr(this_ptr);
36965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36967 this_ptr_conv.is_owned = false;
36968 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
36972 void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean val) {
36973 LDKChannelTransactionParameters this_ptr_conv;
36974 this_ptr_conv.inner = untag_ptr(this_ptr);
36975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36977 this_ptr_conv.is_owned = false;
36978 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
36981 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(uint64_t this_ptr) {
36982 LDKChannelTransactionParameters this_ptr_conv;
36983 this_ptr_conv.inner = untag_ptr(this_ptr);
36984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36986 this_ptr_conv.is_owned = false;
36987 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
36988 uint64_t ret_ref = 0;
36989 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36990 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36994 void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_t val) {
36995 LDKChannelTransactionParameters this_ptr_conv;
36996 this_ptr_conv.inner = untag_ptr(this_ptr);
36997 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36999 this_ptr_conv.is_owned = false;
37000 LDKCounterpartyChannelTransactionParameters val_conv;
37001 val_conv.inner = untag_ptr(val);
37002 val_conv.is_owned = ptr_is_owned(val);
37003 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37004 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
37005 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
37008 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(uint64_t this_ptr) {
37009 LDKChannelTransactionParameters this_ptr_conv;
37010 this_ptr_conv.inner = untag_ptr(this_ptr);
37011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37013 this_ptr_conv.is_owned = false;
37014 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
37015 uint64_t ret_ref = 0;
37016 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37017 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37021 void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_t val) {
37022 LDKChannelTransactionParameters this_ptr_conv;
37023 this_ptr_conv.inner = untag_ptr(this_ptr);
37024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37026 this_ptr_conv.is_owned = false;
37027 LDKOutPoint val_conv;
37028 val_conv.inner = untag_ptr(val);
37029 val_conv.is_owned = ptr_is_owned(val);
37030 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37031 val_conv = OutPoint_clone(&val_conv);
37032 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
37035 uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_anchors(uint64_t this_ptr) {
37036 LDKChannelTransactionParameters this_ptr_conv;
37037 this_ptr_conv.inner = untag_ptr(this_ptr);
37038 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37040 this_ptr_conv.is_owned = false;
37041 uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
37045 void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_anchors(uint64_t this_ptr, uint32_t val) {
37046 LDKChannelTransactionParameters this_ptr_conv;
37047 this_ptr_conv.inner = untag_ptr(this_ptr);
37048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37050 this_ptr_conv.is_owned = false;
37051 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
37052 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
37055 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS_ChannelTransactionParameters_new(uint64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint64_t counterparty_parameters_arg, uint64_t funding_outpoint_arg, uint32_t opt_anchors_arg) {
37056 LDKChannelPublicKeys holder_pubkeys_arg_conv;
37057 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
37058 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
37059 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
37060 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
37061 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
37062 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
37063 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
37064 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
37065 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
37066 LDKOutPoint funding_outpoint_arg_conv;
37067 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
37068 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
37069 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
37070 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
37071 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
37072 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);
37073 uint64_t ret_ref = 0;
37074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37079 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
37080 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
37081 uint64_t ret_ref = 0;
37082 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37083 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37086 int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) {
37087 LDKChannelTransactionParameters arg_conv;
37088 arg_conv.inner = untag_ptr(arg);
37089 arg_conv.is_owned = ptr_is_owned(arg);
37090 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37091 arg_conv.is_owned = false;
37092 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
37096 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) {
37097 LDKChannelTransactionParameters orig_conv;
37098 orig_conv.inner = untag_ptr(orig);
37099 orig_conv.is_owned = ptr_is_owned(orig);
37100 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37101 orig_conv.is_owned = false;
37102 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
37103 uint64_t ret_ref = 0;
37104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37109 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) {
37110 LDKCounterpartyChannelTransactionParameters this_obj_conv;
37111 this_obj_conv.inner = untag_ptr(this_obj);
37112 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37114 CounterpartyChannelTransactionParameters_free(this_obj_conv);
37117 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) {
37118 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
37119 this_ptr_conv.inner = untag_ptr(this_ptr);
37120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37122 this_ptr_conv.is_owned = false;
37123 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
37124 uint64_t ret_ref = 0;
37125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37130 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) {
37131 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
37132 this_ptr_conv.inner = untag_ptr(this_ptr);
37133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37135 this_ptr_conv.is_owned = false;
37136 LDKChannelPublicKeys val_conv;
37137 val_conv.inner = untag_ptr(val);
37138 val_conv.is_owned = ptr_is_owned(val);
37139 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37140 val_conv = ChannelPublicKeys_clone(&val_conv);
37141 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
37144 int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) {
37145 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
37146 this_ptr_conv.inner = untag_ptr(this_ptr);
37147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37149 this_ptr_conv.is_owned = false;
37150 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
37154 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) {
37155 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
37156 this_ptr_conv.inner = untag_ptr(this_ptr);
37157 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37159 this_ptr_conv.is_owned = false;
37160 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
37163 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
37164 LDKChannelPublicKeys pubkeys_arg_conv;
37165 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
37166 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
37167 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
37168 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
37169 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
37170 uint64_t ret_ref = 0;
37171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37176 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
37177 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
37178 uint64_t ret_ref = 0;
37179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37183 int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) {
37184 LDKCounterpartyChannelTransactionParameters arg_conv;
37185 arg_conv.inner = untag_ptr(arg);
37186 arg_conv.is_owned = ptr_is_owned(arg);
37187 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37188 arg_conv.is_owned = false;
37189 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
37193 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) {
37194 LDKCounterpartyChannelTransactionParameters orig_conv;
37195 orig_conv.inner = untag_ptr(orig);
37196 orig_conv.is_owned = ptr_is_owned(orig);
37197 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37198 orig_conv.is_owned = false;
37199 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
37200 uint64_t ret_ref = 0;
37201 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37202 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37206 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) {
37207 LDKChannelTransactionParameters this_arg_conv;
37208 this_arg_conv.inner = untag_ptr(this_arg);
37209 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37211 this_arg_conv.is_owned = false;
37212 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
37216 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) {
37217 LDKChannelTransactionParameters this_arg_conv;
37218 this_arg_conv.inner = untag_ptr(this_arg);
37219 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37220 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37221 this_arg_conv.is_owned = false;
37222 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
37223 uint64_t ret_ref = 0;
37224 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37225 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37229 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) {
37230 LDKChannelTransactionParameters this_arg_conv;
37231 this_arg_conv.inner = untag_ptr(this_arg);
37232 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37234 this_arg_conv.is_owned = false;
37235 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
37236 uint64_t ret_ref = 0;
37237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37242 int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) {
37243 LDKCounterpartyChannelTransactionParameters obj_conv;
37244 obj_conv.inner = untag_ptr(obj);
37245 obj_conv.is_owned = ptr_is_owned(obj);
37246 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37247 obj_conv.is_owned = false;
37248 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
37249 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37250 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37251 CVec_u8Z_free(ret_var);
37255 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
37256 LDKu8slice ser_ref;
37257 ser_ref.datalen = ser->arr_len;
37258 ser_ref.data = ser->elems;
37259 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
37260 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
37262 return tag_ptr(ret_conv, true);
37265 int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) {
37266 LDKChannelTransactionParameters obj_conv;
37267 obj_conv.inner = untag_ptr(obj);
37268 obj_conv.is_owned = ptr_is_owned(obj);
37269 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37270 obj_conv.is_owned = false;
37271 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
37272 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37273 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37274 CVec_u8Z_free(ret_var);
37278 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
37279 LDKu8slice ser_ref;
37280 ser_ref.datalen = ser->arr_len;
37281 ser_ref.data = ser->elems;
37282 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
37283 *ret_conv = ChannelTransactionParameters_read(ser_ref);
37285 return tag_ptr(ret_conv, true);
37288 void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) {
37289 LDKDirectedChannelTransactionParameters this_obj_conv;
37290 this_obj_conv.inner = untag_ptr(this_obj);
37291 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37293 DirectedChannelTransactionParameters_free(this_obj_conv);
37296 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) {
37297 LDKDirectedChannelTransactionParameters this_arg_conv;
37298 this_arg_conv.inner = untag_ptr(this_arg);
37299 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37301 this_arg_conv.is_owned = false;
37302 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
37303 uint64_t ret_ref = 0;
37304 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37305 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37309 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) {
37310 LDKDirectedChannelTransactionParameters this_arg_conv;
37311 this_arg_conv.inner = untag_ptr(this_arg);
37312 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37314 this_arg_conv.is_owned = false;
37315 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
37316 uint64_t ret_ref = 0;
37317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37322 int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) {
37323 LDKDirectedChannelTransactionParameters this_arg_conv;
37324 this_arg_conv.inner = untag_ptr(this_arg);
37325 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37327 this_arg_conv.is_owned = false;
37328 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
37332 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) {
37333 LDKDirectedChannelTransactionParameters this_arg_conv;
37334 this_arg_conv.inner = untag_ptr(this_arg);
37335 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37337 this_arg_conv.is_owned = false;
37338 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
37342 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) {
37343 LDKDirectedChannelTransactionParameters this_arg_conv;
37344 this_arg_conv.inner = untag_ptr(this_arg);
37345 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37347 this_arg_conv.is_owned = false;
37348 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
37349 uint64_t ret_ref = 0;
37350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37355 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) {
37356 LDKDirectedChannelTransactionParameters this_arg_conv;
37357 this_arg_conv.inner = untag_ptr(this_arg);
37358 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37360 this_arg_conv.is_owned = false;
37361 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
37365 void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) {
37366 LDKHolderCommitmentTransaction this_obj_conv;
37367 this_obj_conv.inner = untag_ptr(this_obj);
37368 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37370 HolderCommitmentTransaction_free(this_obj_conv);
37373 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) {
37374 LDKHolderCommitmentTransaction this_ptr_conv;
37375 this_ptr_conv.inner = untag_ptr(this_ptr);
37376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37378 this_ptr_conv.is_owned = false;
37379 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
37380 memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
37384 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) {
37385 LDKHolderCommitmentTransaction this_ptr_conv;
37386 this_ptr_conv.inner = untag_ptr(this_ptr);
37387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37389 this_ptr_conv.is_owned = false;
37390 LDKSignature val_ref;
37391 CHECK(val->arr_len == 64);
37392 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
37393 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
37396 ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) {
37397 LDKHolderCommitmentTransaction this_ptr_conv;
37398 this_ptr_conv.inner = untag_ptr(this_ptr);
37399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37401 this_ptr_conv.is_owned = false;
37402 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
37403 ptrArray ret_arr = NULL;
37404 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
37405 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
37406 for (size_t m = 0; m < ret_var.datalen; m++) {
37407 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
37408 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
37409 ret_arr_ptr[m] = ret_conv_12_arr;
37412 FREE(ret_var.data);
37416 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) {
37417 LDKHolderCommitmentTransaction this_ptr_conv;
37418 this_ptr_conv.inner = untag_ptr(this_ptr);
37419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37421 this_ptr_conv.is_owned = false;
37422 LDKCVec_SignatureZ val_constr;
37423 val_constr.datalen = val->arr_len;
37424 if (val_constr.datalen > 0)
37425 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37427 val_constr.data = NULL;
37428 int8_tArray* val_vals = (void*) val->elems;
37429 for (size_t m = 0; m < val_constr.datalen; m++) {
37430 int8_tArray val_conv_12 = val_vals[m];
37431 LDKSignature val_conv_12_ref;
37432 CHECK(val_conv_12->arr_len == 64);
37433 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
37434 val_constr.data[m] = val_conv_12_ref;
37437 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
37440 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
37441 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
37442 uint64_t ret_ref = 0;
37443 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37444 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37447 int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) {
37448 LDKHolderCommitmentTransaction arg_conv;
37449 arg_conv.inner = untag_ptr(arg);
37450 arg_conv.is_owned = ptr_is_owned(arg);
37451 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37452 arg_conv.is_owned = false;
37453 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
37457 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) {
37458 LDKHolderCommitmentTransaction orig_conv;
37459 orig_conv.inner = untag_ptr(orig);
37460 orig_conv.is_owned = ptr_is_owned(orig);
37461 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37462 orig_conv.is_owned = false;
37463 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
37464 uint64_t ret_ref = 0;
37465 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37466 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37470 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) {
37471 LDKHolderCommitmentTransaction obj_conv;
37472 obj_conv.inner = untag_ptr(obj);
37473 obj_conv.is_owned = ptr_is_owned(obj);
37474 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37475 obj_conv.is_owned = false;
37476 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
37477 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37478 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37479 CVec_u8Z_free(ret_var);
37483 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
37484 LDKu8slice ser_ref;
37485 ser_ref.datalen = ser->arr_len;
37486 ser_ref.data = ser->elems;
37487 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
37488 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
37490 return tag_ptr(ret_conv, true);
37493 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_HolderCommitmentTransaction_new(uint64_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) {
37494 LDKCommitmentTransaction commitment_tx_conv;
37495 commitment_tx_conv.inner = untag_ptr(commitment_tx);
37496 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
37497 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
37498 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
37499 LDKSignature counterparty_sig_ref;
37500 CHECK(counterparty_sig->arr_len == 64);
37501 memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig);
37502 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
37503 counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len;
37504 if (counterparty_htlc_sigs_constr.datalen > 0)
37505 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37507 counterparty_htlc_sigs_constr.data = NULL;
37508 int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
37509 for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
37510 int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
37511 LDKSignature counterparty_htlc_sigs_conv_12_ref;
37512 CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64);
37513 memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
37514 counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
37516 FREE(counterparty_htlc_sigs);
37517 LDKPublicKey holder_funding_key_ref;
37518 CHECK(holder_funding_key->arr_len == 33);
37519 memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
37520 LDKPublicKey counterparty_funding_key_ref;
37521 CHECK(counterparty_funding_key->arr_len == 33);
37522 memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key);
37523 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
37524 uint64_t ret_ref = 0;
37525 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37526 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37530 void __attribute__((export_name("TS_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) {
37531 LDKBuiltCommitmentTransaction this_obj_conv;
37532 this_obj_conv.inner = untag_ptr(this_obj);
37533 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37534 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37535 BuiltCommitmentTransaction_free(this_obj_conv);
37538 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) {
37539 LDKBuiltCommitmentTransaction this_ptr_conv;
37540 this_ptr_conv.inner = untag_ptr(this_ptr);
37541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37543 this_ptr_conv.is_owned = false;
37544 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
37545 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37546 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37547 Transaction_free(ret_var);
37551 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) {
37552 LDKBuiltCommitmentTransaction this_ptr_conv;
37553 this_ptr_conv.inner = untag_ptr(this_ptr);
37554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37556 this_ptr_conv.is_owned = false;
37557 LDKTransaction val_ref;
37558 val_ref.datalen = val->arr_len;
37559 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
37560 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
37561 val_ref.data_is_owned = true;
37562 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
37565 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) {
37566 LDKBuiltCommitmentTransaction 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 = init_int8_tArray(32, __LINE__);
37572 memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32);
37576 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) {
37577 LDKBuiltCommitmentTransaction 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(val->arr_len == 32);
37584 memcpy(val_ref.data, val->elems, 32); FREE(val);
37585 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
37588 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) {
37589 LDKTransaction transaction_arg_ref;
37590 transaction_arg_ref.datalen = transaction_arg->arr_len;
37591 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
37592 memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg);
37593 transaction_arg_ref.data_is_owned = true;
37594 LDKThirtyTwoBytes txid_arg_ref;
37595 CHECK(txid_arg->arr_len == 32);
37596 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
37597 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
37598 uint64_t ret_ref = 0;
37599 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37600 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37604 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
37605 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
37606 uint64_t ret_ref = 0;
37607 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37608 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37611 int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) {
37612 LDKBuiltCommitmentTransaction arg_conv;
37613 arg_conv.inner = untag_ptr(arg);
37614 arg_conv.is_owned = ptr_is_owned(arg);
37615 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37616 arg_conv.is_owned = false;
37617 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
37621 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) {
37622 LDKBuiltCommitmentTransaction orig_conv;
37623 orig_conv.inner = untag_ptr(orig);
37624 orig_conv.is_owned = ptr_is_owned(orig);
37625 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37626 orig_conv.is_owned = false;
37627 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
37628 uint64_t ret_ref = 0;
37629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37634 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) {
37635 LDKBuiltCommitmentTransaction obj_conv;
37636 obj_conv.inner = untag_ptr(obj);
37637 obj_conv.is_owned = ptr_is_owned(obj);
37638 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37639 obj_conv.is_owned = false;
37640 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
37641 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37642 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37643 CVec_u8Z_free(ret_var);
37647 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
37648 LDKu8slice ser_ref;
37649 ser_ref.datalen = ser->arr_len;
37650 ser_ref.data = ser->elems;
37651 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
37652 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
37654 return tag_ptr(ret_conv, true);
37657 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sighash_all"))) TS_BuiltCommitmentTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
37658 LDKBuiltCommitmentTransaction this_arg_conv;
37659 this_arg_conv.inner = untag_ptr(this_arg);
37660 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37662 this_arg_conv.is_owned = false;
37663 LDKu8slice funding_redeemscript_ref;
37664 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
37665 funding_redeemscript_ref.data = funding_redeemscript->elems;
37666 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
37667 memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
37668 FREE(funding_redeemscript);
37672 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign"))) TS_BuiltCommitmentTransaction_sign(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
37673 LDKBuiltCommitmentTransaction this_arg_conv;
37674 this_arg_conv.inner = untag_ptr(this_arg);
37675 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37676 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37677 this_arg_conv.is_owned = false;
37678 unsigned char funding_key_arr[32];
37679 CHECK(funding_key->arr_len == 32);
37680 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
37681 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
37682 LDKu8slice funding_redeemscript_ref;
37683 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
37684 funding_redeemscript_ref.data = funding_redeemscript->elems;
37685 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
37686 memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
37687 FREE(funding_redeemscript);
37691 void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) {
37692 LDKClosingTransaction this_obj_conv;
37693 this_obj_conv.inner = untag_ptr(this_obj);
37694 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37696 ClosingTransaction_free(this_obj_conv);
37699 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
37700 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
37701 uint64_t ret_ref = 0;
37702 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37703 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37706 int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) {
37707 LDKClosingTransaction arg_conv;
37708 arg_conv.inner = untag_ptr(arg);
37709 arg_conv.is_owned = ptr_is_owned(arg);
37710 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37711 arg_conv.is_owned = false;
37712 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
37716 uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) {
37717 LDKClosingTransaction orig_conv;
37718 orig_conv.inner = untag_ptr(orig);
37719 orig_conv.is_owned = ptr_is_owned(orig);
37720 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37721 orig_conv.is_owned = false;
37722 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
37723 uint64_t ret_ref = 0;
37724 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37725 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37729 int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) {
37730 LDKClosingTransaction o_conv;
37731 o_conv.inner = untag_ptr(o);
37732 o_conv.is_owned = ptr_is_owned(o);
37733 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
37734 o_conv.is_owned = false;
37735 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
37739 jboolean __attribute__((export_name("TS_ClosingTransaction_eq"))) TS_ClosingTransaction_eq(uint64_t a, uint64_t b) {
37740 LDKClosingTransaction a_conv;
37741 a_conv.inner = untag_ptr(a);
37742 a_conv.is_owned = ptr_is_owned(a);
37743 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37744 a_conv.is_owned = false;
37745 LDKClosingTransaction b_conv;
37746 b_conv.inner = untag_ptr(b);
37747 b_conv.is_owned = ptr_is_owned(b);
37748 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37749 b_conv.is_owned = false;
37750 jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
37754 uint64_t __attribute__((export_name("TS_ClosingTransaction_new"))) TS_ClosingTransaction_new(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint64_t funding_outpoint) {
37755 LDKCVec_u8Z to_holder_script_ref;
37756 to_holder_script_ref.datalen = to_holder_script->arr_len;
37757 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
37758 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
37759 LDKCVec_u8Z to_counterparty_script_ref;
37760 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
37761 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
37762 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
37763 LDKOutPoint funding_outpoint_conv;
37764 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
37765 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
37766 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
37767 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
37768 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
37769 uint64_t ret_ref = 0;
37770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37775 uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) {
37776 LDKClosingTransaction this_arg_conv;
37777 this_arg_conv.inner = untag_ptr(this_arg);
37778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37780 this_arg_conv.is_owned = false;
37781 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
37782 uint64_t ret_ref = 0;
37783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37788 uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) {
37789 LDKClosingTransaction this_arg_conv;
37790 this_arg_conv.inner = untag_ptr(this_arg);
37791 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37793 this_arg_conv.is_owned = false;
37794 LDKOutPoint funding_outpoint_conv;
37795 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
37796 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
37797 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
37798 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
37799 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
37800 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
37801 return tag_ptr(ret_conv, true);
37804 int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) {
37805 LDKClosingTransaction this_arg_conv;
37806 this_arg_conv.inner = untag_ptr(this_arg);
37807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37809 this_arg_conv.is_owned = false;
37810 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
37814 int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) {
37815 LDKClosingTransaction this_arg_conv;
37816 this_arg_conv.inner = untag_ptr(this_arg);
37817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37819 this_arg_conv.is_owned = false;
37820 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
37824 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) {
37825 LDKClosingTransaction this_arg_conv;
37826 this_arg_conv.inner = untag_ptr(this_arg);
37827 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37829 this_arg_conv.is_owned = false;
37830 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
37831 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37832 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37836 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) {
37837 LDKClosingTransaction this_arg_conv;
37838 this_arg_conv.inner = untag_ptr(this_arg);
37839 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37841 this_arg_conv.is_owned = false;
37842 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
37843 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37844 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37848 void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) {
37849 LDKTrustedClosingTransaction this_obj_conv;
37850 this_obj_conv.inner = untag_ptr(this_obj);
37851 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37853 TrustedClosingTransaction_free(this_obj_conv);
37856 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) {
37857 LDKTrustedClosingTransaction this_arg_conv;
37858 this_arg_conv.inner = untag_ptr(this_arg);
37859 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37861 this_arg_conv.is_owned = false;
37862 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
37863 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37864 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37865 Transaction_free(ret_var);
37869 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_get_sighash_all"))) TS_TrustedClosingTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
37870 LDKTrustedClosingTransaction this_arg_conv;
37871 this_arg_conv.inner = untag_ptr(this_arg);
37872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37874 this_arg_conv.is_owned = false;
37875 LDKu8slice funding_redeemscript_ref;
37876 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
37877 funding_redeemscript_ref.data = funding_redeemscript->elems;
37878 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
37879 memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
37880 FREE(funding_redeemscript);
37884 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_sign"))) TS_TrustedClosingTransaction_sign(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
37885 LDKTrustedClosingTransaction this_arg_conv;
37886 this_arg_conv.inner = untag_ptr(this_arg);
37887 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37889 this_arg_conv.is_owned = false;
37890 unsigned char funding_key_arr[32];
37891 CHECK(funding_key->arr_len == 32);
37892 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
37893 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
37894 LDKu8slice funding_redeemscript_ref;
37895 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
37896 funding_redeemscript_ref.data = funding_redeemscript->elems;
37897 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
37898 memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
37899 FREE(funding_redeemscript);
37903 void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) {
37904 LDKCommitmentTransaction this_obj_conv;
37905 this_obj_conv.inner = untag_ptr(this_obj);
37906 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37908 CommitmentTransaction_free(this_obj_conv);
37911 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
37912 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
37913 uint64_t ret_ref = 0;
37914 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37915 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37918 int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) {
37919 LDKCommitmentTransaction arg_conv;
37920 arg_conv.inner = untag_ptr(arg);
37921 arg_conv.is_owned = ptr_is_owned(arg);
37922 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37923 arg_conv.is_owned = false;
37924 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
37928 uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) {
37929 LDKCommitmentTransaction orig_conv;
37930 orig_conv.inner = untag_ptr(orig);
37931 orig_conv.is_owned = ptr_is_owned(orig);
37932 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37933 orig_conv.is_owned = false;
37934 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
37935 uint64_t ret_ref = 0;
37936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37941 int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) {
37942 LDKCommitmentTransaction obj_conv;
37943 obj_conv.inner = untag_ptr(obj);
37944 obj_conv.is_owned = ptr_is_owned(obj);
37945 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37946 obj_conv.is_owned = false;
37947 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
37948 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37949 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37950 CVec_u8Z_free(ret_var);
37954 uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
37955 LDKu8slice ser_ref;
37956 ser_ref.datalen = ser->arr_len;
37957 ser_ref.data = ser->elems;
37958 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
37959 *ret_conv = CommitmentTransaction_read(ser_ref);
37961 return tag_ptr(ret_conv, true);
37964 int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) {
37965 LDKCommitmentTransaction this_arg_conv;
37966 this_arg_conv.inner = untag_ptr(this_arg);
37967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37969 this_arg_conv.is_owned = false;
37970 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
37974 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) {
37975 LDKCommitmentTransaction this_arg_conv;
37976 this_arg_conv.inner = untag_ptr(this_arg);
37977 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37979 this_arg_conv.is_owned = false;
37980 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
37984 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) {
37985 LDKCommitmentTransaction this_arg_conv;
37986 this_arg_conv.inner = untag_ptr(this_arg);
37987 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37989 this_arg_conv.is_owned = false;
37990 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
37994 int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) {
37995 LDKCommitmentTransaction this_arg_conv;
37996 this_arg_conv.inner = untag_ptr(this_arg);
37997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37999 this_arg_conv.is_owned = false;
38000 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
38004 uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) {
38005 LDKCommitmentTransaction this_arg_conv;
38006 this_arg_conv.inner = untag_ptr(this_arg);
38007 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38009 this_arg_conv.is_owned = false;
38010 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
38011 uint64_t ret_ref = 0;
38012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38017 uint64_t __attribute__((export_name("TS_CommitmentTransaction_verify"))) TS_CommitmentTransaction_verify(uint64_t this_arg, uint64_t channel_parameters, uint64_t broadcaster_keys, uint64_t countersignatory_keys) {
38018 LDKCommitmentTransaction this_arg_conv;
38019 this_arg_conv.inner = untag_ptr(this_arg);
38020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38022 this_arg_conv.is_owned = false;
38023 LDKDirectedChannelTransactionParameters channel_parameters_conv;
38024 channel_parameters_conv.inner = untag_ptr(channel_parameters);
38025 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
38026 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
38027 channel_parameters_conv.is_owned = false;
38028 LDKChannelPublicKeys broadcaster_keys_conv;
38029 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
38030 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
38031 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
38032 broadcaster_keys_conv.is_owned = false;
38033 LDKChannelPublicKeys countersignatory_keys_conv;
38034 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
38035 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
38036 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
38037 countersignatory_keys_conv.is_owned = false;
38038 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
38039 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
38040 return tag_ptr(ret_conv, true);
38043 void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) {
38044 LDKTrustedCommitmentTransaction this_obj_conv;
38045 this_obj_conv.inner = untag_ptr(this_obj);
38046 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38048 TrustedCommitmentTransaction_free(this_obj_conv);
38051 int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) {
38052 LDKTrustedCommitmentTransaction this_arg_conv;
38053 this_arg_conv.inner = untag_ptr(this_arg);
38054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38056 this_arg_conv.is_owned = false;
38057 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
38058 memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
38062 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) {
38063 LDKTrustedCommitmentTransaction this_arg_conv;
38064 this_arg_conv.inner = untag_ptr(this_arg);
38065 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38067 this_arg_conv.is_owned = false;
38068 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
38069 uint64_t ret_ref = 0;
38070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38075 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) {
38076 LDKTrustedCommitmentTransaction this_arg_conv;
38077 this_arg_conv.inner = untag_ptr(this_arg);
38078 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38080 this_arg_conv.is_owned = false;
38081 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
38082 uint64_t ret_ref = 0;
38083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38088 jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) {
38089 LDKTrustedCommitmentTransaction this_arg_conv;
38090 this_arg_conv.inner = untag_ptr(this_arg);
38091 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38093 this_arg_conv.is_owned = false;
38094 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
38098 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_sigs"))) TS_TrustedCommitmentTransaction_get_htlc_sigs(uint64_t this_arg, int8_tArray htlc_base_key, uint64_t channel_parameters) {
38099 LDKTrustedCommitmentTransaction this_arg_conv;
38100 this_arg_conv.inner = untag_ptr(this_arg);
38101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38103 this_arg_conv.is_owned = false;
38104 unsigned char htlc_base_key_arr[32];
38105 CHECK(htlc_base_key->arr_len == 32);
38106 memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
38107 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
38108 LDKDirectedChannelTransactionParameters channel_parameters_conv;
38109 channel_parameters_conv.inner = untag_ptr(channel_parameters);
38110 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
38111 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
38112 channel_parameters_conv.is_owned = false;
38113 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
38114 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
38115 return tag_ptr(ret_conv, true);
38118 int64_t __attribute__((export_name("TS_get_commitment_transaction_number_obscure_factor"))) TS_get_commitment_transaction_number_obscure_factor(int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) {
38119 LDKPublicKey broadcaster_payment_basepoint_ref;
38120 CHECK(broadcaster_payment_basepoint->arr_len == 33);
38121 memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint);
38122 LDKPublicKey countersignatory_payment_basepoint_ref;
38123 CHECK(countersignatory_payment_basepoint->arr_len == 33);
38124 memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint);
38125 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
38129 jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) {
38130 LDKInitFeatures a_conv;
38131 a_conv.inner = untag_ptr(a);
38132 a_conv.is_owned = ptr_is_owned(a);
38133 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38134 a_conv.is_owned = false;
38135 LDKInitFeatures b_conv;
38136 b_conv.inner = untag_ptr(b);
38137 b_conv.is_owned = ptr_is_owned(b);
38138 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38139 b_conv.is_owned = false;
38140 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
38144 jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) {
38145 LDKNodeFeatures a_conv;
38146 a_conv.inner = untag_ptr(a);
38147 a_conv.is_owned = ptr_is_owned(a);
38148 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38149 a_conv.is_owned = false;
38150 LDKNodeFeatures b_conv;
38151 b_conv.inner = untag_ptr(b);
38152 b_conv.is_owned = ptr_is_owned(b);
38153 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38154 b_conv.is_owned = false;
38155 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
38159 jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) {
38160 LDKChannelFeatures a_conv;
38161 a_conv.inner = untag_ptr(a);
38162 a_conv.is_owned = ptr_is_owned(a);
38163 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38164 a_conv.is_owned = false;
38165 LDKChannelFeatures b_conv;
38166 b_conv.inner = untag_ptr(b);
38167 b_conv.is_owned = ptr_is_owned(b);
38168 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38169 b_conv.is_owned = false;
38170 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
38174 jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) {
38175 LDKInvoiceFeatures a_conv;
38176 a_conv.inner = untag_ptr(a);
38177 a_conv.is_owned = ptr_is_owned(a);
38178 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38179 a_conv.is_owned = false;
38180 LDKInvoiceFeatures b_conv;
38181 b_conv.inner = untag_ptr(b);
38182 b_conv.is_owned = ptr_is_owned(b);
38183 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38184 b_conv.is_owned = false;
38185 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
38189 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
38190 LDKChannelTypeFeatures a_conv;
38191 a_conv.inner = untag_ptr(a);
38192 a_conv.is_owned = ptr_is_owned(a);
38193 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38194 a_conv.is_owned = false;
38195 LDKChannelTypeFeatures b_conv;
38196 b_conv.inner = untag_ptr(b);
38197 b_conv.is_owned = ptr_is_owned(b);
38198 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38199 b_conv.is_owned = false;
38200 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
38204 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
38205 LDKInitFeatures ret_var = InitFeatures_clone(arg);
38206 uint64_t ret_ref = 0;
38207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38211 int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) {
38212 LDKInitFeatures arg_conv;
38213 arg_conv.inner = untag_ptr(arg);
38214 arg_conv.is_owned = ptr_is_owned(arg);
38215 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38216 arg_conv.is_owned = false;
38217 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
38221 uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) {
38222 LDKInitFeatures orig_conv;
38223 orig_conv.inner = untag_ptr(orig);
38224 orig_conv.is_owned = ptr_is_owned(orig);
38225 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38226 orig_conv.is_owned = false;
38227 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
38228 uint64_t ret_ref = 0;
38229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38234 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
38235 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
38236 uint64_t ret_ref = 0;
38237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38241 int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) {
38242 LDKNodeFeatures arg_conv;
38243 arg_conv.inner = untag_ptr(arg);
38244 arg_conv.is_owned = ptr_is_owned(arg);
38245 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38246 arg_conv.is_owned = false;
38247 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
38251 uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) {
38252 LDKNodeFeatures orig_conv;
38253 orig_conv.inner = untag_ptr(orig);
38254 orig_conv.is_owned = ptr_is_owned(orig);
38255 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38256 orig_conv.is_owned = false;
38257 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
38258 uint64_t ret_ref = 0;
38259 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38260 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38264 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
38265 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
38266 uint64_t ret_ref = 0;
38267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38271 int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) {
38272 LDKChannelFeatures arg_conv;
38273 arg_conv.inner = untag_ptr(arg);
38274 arg_conv.is_owned = ptr_is_owned(arg);
38275 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38276 arg_conv.is_owned = false;
38277 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
38281 uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) {
38282 LDKChannelFeatures orig_conv;
38283 orig_conv.inner = untag_ptr(orig);
38284 orig_conv.is_owned = ptr_is_owned(orig);
38285 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38286 orig_conv.is_owned = false;
38287 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
38288 uint64_t ret_ref = 0;
38289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38294 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
38295 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
38296 uint64_t ret_ref = 0;
38297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38301 int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) {
38302 LDKInvoiceFeatures arg_conv;
38303 arg_conv.inner = untag_ptr(arg);
38304 arg_conv.is_owned = ptr_is_owned(arg);
38305 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38306 arg_conv.is_owned = false;
38307 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
38311 uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) {
38312 LDKInvoiceFeatures orig_conv;
38313 orig_conv.inner = untag_ptr(orig);
38314 orig_conv.is_owned = ptr_is_owned(orig);
38315 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38316 orig_conv.is_owned = false;
38317 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
38318 uint64_t ret_ref = 0;
38319 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38320 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38324 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
38325 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
38326 uint64_t ret_ref = 0;
38327 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38328 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38331 int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) {
38332 LDKChannelTypeFeatures arg_conv;
38333 arg_conv.inner = untag_ptr(arg);
38334 arg_conv.is_owned = ptr_is_owned(arg);
38335 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38336 arg_conv.is_owned = false;
38337 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
38341 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) {
38342 LDKChannelTypeFeatures orig_conv;
38343 orig_conv.inner = untag_ptr(orig);
38344 orig_conv.is_owned = ptr_is_owned(orig);
38345 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38346 orig_conv.is_owned = false;
38347 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
38348 uint64_t ret_ref = 0;
38349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38354 void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) {
38355 LDKInitFeatures this_obj_conv;
38356 this_obj_conv.inner = untag_ptr(this_obj);
38357 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38359 InitFeatures_free(this_obj_conv);
38362 void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) {
38363 LDKNodeFeatures this_obj_conv;
38364 this_obj_conv.inner = untag_ptr(this_obj);
38365 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38367 NodeFeatures_free(this_obj_conv);
38370 void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) {
38371 LDKChannelFeatures this_obj_conv;
38372 this_obj_conv.inner = untag_ptr(this_obj);
38373 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38375 ChannelFeatures_free(this_obj_conv);
38378 void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) {
38379 LDKInvoiceFeatures this_obj_conv;
38380 this_obj_conv.inner = untag_ptr(this_obj);
38381 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38383 InvoiceFeatures_free(this_obj_conv);
38386 void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
38387 LDKChannelTypeFeatures this_obj_conv;
38388 this_obj_conv.inner = untag_ptr(this_obj);
38389 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38391 ChannelTypeFeatures_free(this_obj_conv);
38394 uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() {
38395 LDKInitFeatures ret_var = InitFeatures_empty();
38396 uint64_t ret_ref = 0;
38397 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38398 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38402 jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
38403 LDKInitFeatures this_arg_conv;
38404 this_arg_conv.inner = untag_ptr(this_arg);
38405 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38407 this_arg_conv.is_owned = false;
38408 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
38412 uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() {
38413 LDKNodeFeatures ret_var = NodeFeatures_empty();
38414 uint64_t ret_ref = 0;
38415 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38416 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38420 jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
38421 LDKNodeFeatures this_arg_conv;
38422 this_arg_conv.inner = untag_ptr(this_arg);
38423 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38425 this_arg_conv.is_owned = false;
38426 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
38430 uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
38431 LDKChannelFeatures ret_var = ChannelFeatures_empty();
38432 uint64_t ret_ref = 0;
38433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38434 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38438 jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
38439 LDKChannelFeatures this_arg_conv;
38440 this_arg_conv.inner = untag_ptr(this_arg);
38441 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38443 this_arg_conv.is_owned = false;
38444 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
38448 uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
38449 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
38450 uint64_t ret_ref = 0;
38451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38456 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
38457 LDKInvoiceFeatures this_arg_conv;
38458 this_arg_conv.inner = untag_ptr(this_arg);
38459 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38461 this_arg_conv.is_owned = false;
38462 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
38466 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
38467 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
38468 uint64_t ret_ref = 0;
38469 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38470 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38474 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) {
38475 LDKChannelTypeFeatures this_arg_conv;
38476 this_arg_conv.inner = untag_ptr(this_arg);
38477 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38479 this_arg_conv.is_owned = false;
38480 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
38484 int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) {
38485 LDKInitFeatures obj_conv;
38486 obj_conv.inner = untag_ptr(obj);
38487 obj_conv.is_owned = ptr_is_owned(obj);
38488 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38489 obj_conv.is_owned = false;
38490 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
38491 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38492 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38493 CVec_u8Z_free(ret_var);
38497 uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
38498 LDKu8slice ser_ref;
38499 ser_ref.datalen = ser->arr_len;
38500 ser_ref.data = ser->elems;
38501 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
38502 *ret_conv = InitFeatures_read(ser_ref);
38504 return tag_ptr(ret_conv, true);
38507 int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) {
38508 LDKChannelFeatures obj_conv;
38509 obj_conv.inner = untag_ptr(obj);
38510 obj_conv.is_owned = ptr_is_owned(obj);
38511 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38512 obj_conv.is_owned = false;
38513 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
38514 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38515 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38516 CVec_u8Z_free(ret_var);
38520 uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
38521 LDKu8slice ser_ref;
38522 ser_ref.datalen = ser->arr_len;
38523 ser_ref.data = ser->elems;
38524 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
38525 *ret_conv = ChannelFeatures_read(ser_ref);
38527 return tag_ptr(ret_conv, true);
38530 int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) {
38531 LDKNodeFeatures obj_conv;
38532 obj_conv.inner = untag_ptr(obj);
38533 obj_conv.is_owned = ptr_is_owned(obj);
38534 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38535 obj_conv.is_owned = false;
38536 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
38537 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38538 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38539 CVec_u8Z_free(ret_var);
38543 uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
38544 LDKu8slice ser_ref;
38545 ser_ref.datalen = ser->arr_len;
38546 ser_ref.data = ser->elems;
38547 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
38548 *ret_conv = NodeFeatures_read(ser_ref);
38550 return tag_ptr(ret_conv, true);
38553 int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) {
38554 LDKInvoiceFeatures obj_conv;
38555 obj_conv.inner = untag_ptr(obj);
38556 obj_conv.is_owned = ptr_is_owned(obj);
38557 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38558 obj_conv.is_owned = false;
38559 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
38560 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38561 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38562 CVec_u8Z_free(ret_var);
38566 uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
38567 LDKu8slice ser_ref;
38568 ser_ref.datalen = ser->arr_len;
38569 ser_ref.data = ser->elems;
38570 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
38571 *ret_conv = InvoiceFeatures_read(ser_ref);
38573 return tag_ptr(ret_conv, true);
38576 int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
38577 LDKChannelTypeFeatures obj_conv;
38578 obj_conv.inner = untag_ptr(obj);
38579 obj_conv.is_owned = ptr_is_owned(obj);
38580 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38581 obj_conv.is_owned = false;
38582 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
38583 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38584 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38585 CVec_u8Z_free(ret_var);
38589 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
38590 LDKu8slice ser_ref;
38591 ser_ref.datalen = ser->arr_len;
38592 ser_ref.data = ser->elems;
38593 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
38594 *ret_conv = ChannelTypeFeatures_read(ser_ref);
38596 return tag_ptr(ret_conv, true);
38599 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
38600 LDKInitFeatures this_arg_conv;
38601 this_arg_conv.inner = untag_ptr(this_arg);
38602 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38604 this_arg_conv.is_owned = false;
38605 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
38608 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_required(uint64_t this_arg) {
38609 LDKInitFeatures this_arg_conv;
38610 this_arg_conv.inner = untag_ptr(this_arg);
38611 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38613 this_arg_conv.is_owned = false;
38614 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
38617 jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(uint64_t this_arg) {
38618 LDKInitFeatures this_arg_conv;
38619 this_arg_conv.inner = untag_ptr(this_arg);
38620 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38622 this_arg_conv.is_owned = false;
38623 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
38627 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
38628 LDKNodeFeatures this_arg_conv;
38629 this_arg_conv.inner = untag_ptr(this_arg);
38630 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38632 this_arg_conv.is_owned = false;
38633 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
38636 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_required(uint64_t this_arg) {
38637 LDKNodeFeatures this_arg_conv;
38638 this_arg_conv.inner = untag_ptr(this_arg);
38639 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38641 this_arg_conv.is_owned = false;
38642 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
38645 jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(uint64_t this_arg) {
38646 LDKNodeFeatures this_arg_conv;
38647 this_arg_conv.inner = untag_ptr(this_arg);
38648 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38650 this_arg_conv.is_owned = false;
38651 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
38655 jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(uint64_t this_arg) {
38656 LDKInitFeatures this_arg_conv;
38657 this_arg_conv.inner = untag_ptr(this_arg);
38658 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38660 this_arg_conv.is_owned = false;
38661 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
38665 jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(uint64_t this_arg) {
38666 LDKNodeFeatures this_arg_conv;
38667 this_arg_conv.inner = untag_ptr(this_arg);
38668 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38670 this_arg_conv.is_owned = false;
38671 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
38675 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_optional(uint64_t this_arg) {
38676 LDKInitFeatures this_arg_conv;
38677 this_arg_conv.inner = untag_ptr(this_arg);
38678 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38680 this_arg_conv.is_owned = false;
38681 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
38684 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_required(uint64_t this_arg) {
38685 LDKInitFeatures this_arg_conv;
38686 this_arg_conv.inner = untag_ptr(this_arg);
38687 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38689 this_arg_conv.is_owned = false;
38690 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
38693 jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(uint64_t this_arg) {
38694 LDKInitFeatures this_arg_conv;
38695 this_arg_conv.inner = untag_ptr(this_arg);
38696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38698 this_arg_conv.is_owned = false;
38699 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
38703 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
38704 LDKInitFeatures this_arg_conv;
38705 this_arg_conv.inner = untag_ptr(this_arg);
38706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38708 this_arg_conv.is_owned = false;
38709 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
38712 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
38713 LDKInitFeatures this_arg_conv;
38714 this_arg_conv.inner = untag_ptr(this_arg);
38715 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38717 this_arg_conv.is_owned = false;
38718 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
38721 jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
38722 LDKInitFeatures this_arg_conv;
38723 this_arg_conv.inner = untag_ptr(this_arg);
38724 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38726 this_arg_conv.is_owned = false;
38727 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
38731 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
38732 LDKNodeFeatures this_arg_conv;
38733 this_arg_conv.inner = untag_ptr(this_arg);
38734 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38736 this_arg_conv.is_owned = false;
38737 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
38740 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
38741 LDKNodeFeatures this_arg_conv;
38742 this_arg_conv.inner = untag_ptr(this_arg);
38743 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38745 this_arg_conv.is_owned = false;
38746 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
38749 jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
38750 LDKNodeFeatures this_arg_conv;
38751 this_arg_conv.inner = untag_ptr(this_arg);
38752 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38754 this_arg_conv.is_owned = false;
38755 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
38759 jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
38760 LDKInitFeatures this_arg_conv;
38761 this_arg_conv.inner = untag_ptr(this_arg);
38762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38764 this_arg_conv.is_owned = false;
38765 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
38769 jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
38770 LDKNodeFeatures this_arg_conv;
38771 this_arg_conv.inner = untag_ptr(this_arg);
38772 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38774 this_arg_conv.is_owned = false;
38775 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
38779 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) {
38780 LDKInitFeatures this_arg_conv;
38781 this_arg_conv.inner = untag_ptr(this_arg);
38782 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38784 this_arg_conv.is_owned = false;
38785 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
38788 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) {
38789 LDKInitFeatures this_arg_conv;
38790 this_arg_conv.inner = untag_ptr(this_arg);
38791 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38793 this_arg_conv.is_owned = false;
38794 InitFeatures_set_gossip_queries_required(&this_arg_conv);
38797 jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) {
38798 LDKInitFeatures this_arg_conv;
38799 this_arg_conv.inner = untag_ptr(this_arg);
38800 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38802 this_arg_conv.is_owned = false;
38803 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
38807 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) {
38808 LDKNodeFeatures this_arg_conv;
38809 this_arg_conv.inner = untag_ptr(this_arg);
38810 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38812 this_arg_conv.is_owned = false;
38813 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
38816 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) {
38817 LDKNodeFeatures this_arg_conv;
38818 this_arg_conv.inner = untag_ptr(this_arg);
38819 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38821 this_arg_conv.is_owned = false;
38822 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
38825 jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) {
38826 LDKNodeFeatures this_arg_conv;
38827 this_arg_conv.inner = untag_ptr(this_arg);
38828 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38830 this_arg_conv.is_owned = false;
38831 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
38835 jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) {
38836 LDKInitFeatures this_arg_conv;
38837 this_arg_conv.inner = untag_ptr(this_arg);
38838 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38840 this_arg_conv.is_owned = false;
38841 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
38845 jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) {
38846 LDKNodeFeatures this_arg_conv;
38847 this_arg_conv.inner = untag_ptr(this_arg);
38848 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38850 this_arg_conv.is_owned = false;
38851 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
38855 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
38856 LDKInitFeatures this_arg_conv;
38857 this_arg_conv.inner = untag_ptr(this_arg);
38858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38860 this_arg_conv.is_owned = false;
38861 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
38864 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) {
38865 LDKInitFeatures this_arg_conv;
38866 this_arg_conv.inner = untag_ptr(this_arg);
38867 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38869 this_arg_conv.is_owned = false;
38870 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
38873 jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) {
38874 LDKInitFeatures this_arg_conv;
38875 this_arg_conv.inner = untag_ptr(this_arg);
38876 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38878 this_arg_conv.is_owned = false;
38879 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
38883 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
38884 LDKNodeFeatures this_arg_conv;
38885 this_arg_conv.inner = untag_ptr(this_arg);
38886 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38888 this_arg_conv.is_owned = false;
38889 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
38892 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) {
38893 LDKNodeFeatures this_arg_conv;
38894 this_arg_conv.inner = untag_ptr(this_arg);
38895 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38897 this_arg_conv.is_owned = false;
38898 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
38901 jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) {
38902 LDKNodeFeatures this_arg_conv;
38903 this_arg_conv.inner = untag_ptr(this_arg);
38904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38906 this_arg_conv.is_owned = false;
38907 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
38911 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
38912 LDKInvoiceFeatures this_arg_conv;
38913 this_arg_conv.inner = untag_ptr(this_arg);
38914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38916 this_arg_conv.is_owned = false;
38917 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
38920 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) {
38921 LDKInvoiceFeatures this_arg_conv;
38922 this_arg_conv.inner = untag_ptr(this_arg);
38923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38925 this_arg_conv.is_owned = false;
38926 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
38929 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) {
38930 LDKInvoiceFeatures this_arg_conv;
38931 this_arg_conv.inner = untag_ptr(this_arg);
38932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38934 this_arg_conv.is_owned = false;
38935 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
38939 jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) {
38940 LDKInitFeatures this_arg_conv;
38941 this_arg_conv.inner = untag_ptr(this_arg);
38942 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38944 this_arg_conv.is_owned = false;
38945 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
38949 jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) {
38950 LDKNodeFeatures this_arg_conv;
38951 this_arg_conv.inner = untag_ptr(this_arg);
38952 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38954 this_arg_conv.is_owned = false;
38955 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
38959 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) {
38960 LDKInvoiceFeatures this_arg_conv;
38961 this_arg_conv.inner = untag_ptr(this_arg);
38962 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38964 this_arg_conv.is_owned = false;
38965 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
38969 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) {
38970 LDKInitFeatures this_arg_conv;
38971 this_arg_conv.inner = untag_ptr(this_arg);
38972 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38974 this_arg_conv.is_owned = false;
38975 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
38978 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) {
38979 LDKInitFeatures this_arg_conv;
38980 this_arg_conv.inner = untag_ptr(this_arg);
38981 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38983 this_arg_conv.is_owned = false;
38984 InitFeatures_set_static_remote_key_required(&this_arg_conv);
38987 jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) {
38988 LDKInitFeatures this_arg_conv;
38989 this_arg_conv.inner = untag_ptr(this_arg);
38990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38992 this_arg_conv.is_owned = false;
38993 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
38997 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
38998 LDKNodeFeatures this_arg_conv;
38999 this_arg_conv.inner = untag_ptr(this_arg);
39000 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39002 this_arg_conv.is_owned = false;
39003 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
39006 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) {
39007 LDKNodeFeatures this_arg_conv;
39008 this_arg_conv.inner = untag_ptr(this_arg);
39009 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39011 this_arg_conv.is_owned = false;
39012 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
39015 jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) {
39016 LDKNodeFeatures this_arg_conv;
39017 this_arg_conv.inner = untag_ptr(this_arg);
39018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39020 this_arg_conv.is_owned = false;
39021 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
39025 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
39026 LDKChannelTypeFeatures this_arg_conv;
39027 this_arg_conv.inner = untag_ptr(this_arg);
39028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39030 this_arg_conv.is_owned = false;
39031 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
39034 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) {
39035 LDKChannelTypeFeatures this_arg_conv;
39036 this_arg_conv.inner = untag_ptr(this_arg);
39037 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39039 this_arg_conv.is_owned = false;
39040 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
39043 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) {
39044 LDKChannelTypeFeatures this_arg_conv;
39045 this_arg_conv.inner = untag_ptr(this_arg);
39046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39048 this_arg_conv.is_owned = false;
39049 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
39053 jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) {
39054 LDKInitFeatures this_arg_conv;
39055 this_arg_conv.inner = untag_ptr(this_arg);
39056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39058 this_arg_conv.is_owned = false;
39059 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
39063 jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(uint64_t this_arg) {
39064 LDKNodeFeatures this_arg_conv;
39065 this_arg_conv.inner = untag_ptr(this_arg);
39066 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39068 this_arg_conv.is_owned = false;
39069 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
39073 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(uint64_t this_arg) {
39074 LDKChannelTypeFeatures this_arg_conv;
39075 this_arg_conv.inner = untag_ptr(this_arg);
39076 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39078 this_arg_conv.is_owned = false;
39079 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
39083 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_optional(uint64_t this_arg) {
39084 LDKInitFeatures this_arg_conv;
39085 this_arg_conv.inner = untag_ptr(this_arg);
39086 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39088 this_arg_conv.is_owned = false;
39089 InitFeatures_set_payment_secret_optional(&this_arg_conv);
39092 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) {
39093 LDKInitFeatures this_arg_conv;
39094 this_arg_conv.inner = untag_ptr(this_arg);
39095 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39097 this_arg_conv.is_owned = false;
39098 InitFeatures_set_payment_secret_required(&this_arg_conv);
39101 jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) {
39102 LDKInitFeatures this_arg_conv;
39103 this_arg_conv.inner = untag_ptr(this_arg);
39104 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39106 this_arg_conv.is_owned = false;
39107 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
39111 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_optional(uint64_t this_arg) {
39112 LDKNodeFeatures this_arg_conv;
39113 this_arg_conv.inner = untag_ptr(this_arg);
39114 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39116 this_arg_conv.is_owned = false;
39117 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
39120 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) {
39121 LDKNodeFeatures this_arg_conv;
39122 this_arg_conv.inner = untag_ptr(this_arg);
39123 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39125 this_arg_conv.is_owned = false;
39126 NodeFeatures_set_payment_secret_required(&this_arg_conv);
39129 jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) {
39130 LDKNodeFeatures this_arg_conv;
39131 this_arg_conv.inner = untag_ptr(this_arg);
39132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39134 this_arg_conv.is_owned = false;
39135 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
39139 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(uint64_t this_arg) {
39140 LDKInvoiceFeatures this_arg_conv;
39141 this_arg_conv.inner = untag_ptr(this_arg);
39142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39144 this_arg_conv.is_owned = false;
39145 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
39148 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(uint64_t this_arg) {
39149 LDKInvoiceFeatures this_arg_conv;
39150 this_arg_conv.inner = untag_ptr(this_arg);
39151 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39153 this_arg_conv.is_owned = false;
39154 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
39157 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(uint64_t this_arg) {
39158 LDKInvoiceFeatures this_arg_conv;
39159 this_arg_conv.inner = untag_ptr(this_arg);
39160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39162 this_arg_conv.is_owned = false;
39163 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
39167 jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(uint64_t this_arg) {
39168 LDKInitFeatures this_arg_conv;
39169 this_arg_conv.inner = untag_ptr(this_arg);
39170 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39172 this_arg_conv.is_owned = false;
39173 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
39177 jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(uint64_t this_arg) {
39178 LDKNodeFeatures this_arg_conv;
39179 this_arg_conv.inner = untag_ptr(this_arg);
39180 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39182 this_arg_conv.is_owned = false;
39183 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
39187 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(uint64_t this_arg) {
39188 LDKInvoiceFeatures this_arg_conv;
39189 this_arg_conv.inner = untag_ptr(this_arg);
39190 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39192 this_arg_conv.is_owned = false;
39193 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
39197 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_optional(uint64_t this_arg) {
39198 LDKInitFeatures this_arg_conv;
39199 this_arg_conv.inner = untag_ptr(this_arg);
39200 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39202 this_arg_conv.is_owned = false;
39203 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
39206 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_required(uint64_t this_arg) {
39207 LDKInitFeatures this_arg_conv;
39208 this_arg_conv.inner = untag_ptr(this_arg);
39209 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39211 this_arg_conv.is_owned = false;
39212 InitFeatures_set_basic_mpp_required(&this_arg_conv);
39215 jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(uint64_t this_arg) {
39216 LDKInitFeatures this_arg_conv;
39217 this_arg_conv.inner = untag_ptr(this_arg);
39218 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39220 this_arg_conv.is_owned = false;
39221 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
39225 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_optional(uint64_t this_arg) {
39226 LDKNodeFeatures this_arg_conv;
39227 this_arg_conv.inner = untag_ptr(this_arg);
39228 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39230 this_arg_conv.is_owned = false;
39231 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
39234 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_required(uint64_t this_arg) {
39235 LDKNodeFeatures this_arg_conv;
39236 this_arg_conv.inner = untag_ptr(this_arg);
39237 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39239 this_arg_conv.is_owned = false;
39240 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
39243 jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(uint64_t this_arg) {
39244 LDKNodeFeatures this_arg_conv;
39245 this_arg_conv.inner = untag_ptr(this_arg);
39246 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39248 this_arg_conv.is_owned = false;
39249 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
39253 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
39254 LDKInvoiceFeatures this_arg_conv;
39255 this_arg_conv.inner = untag_ptr(this_arg);
39256 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39258 this_arg_conv.is_owned = false;
39259 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
39262 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
39263 LDKInvoiceFeatures this_arg_conv;
39264 this_arg_conv.inner = untag_ptr(this_arg);
39265 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39267 this_arg_conv.is_owned = false;
39268 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
39271 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
39272 LDKInvoiceFeatures this_arg_conv;
39273 this_arg_conv.inner = untag_ptr(this_arg);
39274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39276 this_arg_conv.is_owned = false;
39277 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
39281 jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
39282 LDKInitFeatures this_arg_conv;
39283 this_arg_conv.inner = untag_ptr(this_arg);
39284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39286 this_arg_conv.is_owned = false;
39287 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
39291 jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(uint64_t this_arg) {
39292 LDKNodeFeatures this_arg_conv;
39293 this_arg_conv.inner = untag_ptr(this_arg);
39294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39296 this_arg_conv.is_owned = false;
39297 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
39301 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
39302 LDKInvoiceFeatures this_arg_conv;
39303 this_arg_conv.inner = untag_ptr(this_arg);
39304 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39306 this_arg_conv.is_owned = false;
39307 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
39311 void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
39312 LDKInitFeatures this_arg_conv;
39313 this_arg_conv.inner = untag_ptr(this_arg);
39314 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39316 this_arg_conv.is_owned = false;
39317 InitFeatures_set_wumbo_optional(&this_arg_conv);
39320 void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_required(uint64_t this_arg) {
39321 LDKInitFeatures this_arg_conv;
39322 this_arg_conv.inner = untag_ptr(this_arg);
39323 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39325 this_arg_conv.is_owned = false;
39326 InitFeatures_set_wumbo_required(&this_arg_conv);
39329 jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(uint64_t this_arg) {
39330 LDKInitFeatures this_arg_conv;
39331 this_arg_conv.inner = untag_ptr(this_arg);
39332 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39334 this_arg_conv.is_owned = false;
39335 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
39339 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_optional(uint64_t this_arg) {
39340 LDKNodeFeatures this_arg_conv;
39341 this_arg_conv.inner = untag_ptr(this_arg);
39342 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39344 this_arg_conv.is_owned = false;
39345 NodeFeatures_set_wumbo_optional(&this_arg_conv);
39348 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_required(uint64_t this_arg) {
39349 LDKNodeFeatures this_arg_conv;
39350 this_arg_conv.inner = untag_ptr(this_arg);
39351 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39353 this_arg_conv.is_owned = false;
39354 NodeFeatures_set_wumbo_required(&this_arg_conv);
39357 jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(uint64_t this_arg) {
39358 LDKNodeFeatures this_arg_conv;
39359 this_arg_conv.inner = untag_ptr(this_arg);
39360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39362 this_arg_conv.is_owned = false;
39363 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
39367 jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(uint64_t this_arg) {
39368 LDKInitFeatures this_arg_conv;
39369 this_arg_conv.inner = untag_ptr(this_arg);
39370 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39372 this_arg_conv.is_owned = false;
39373 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
39377 jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(uint64_t this_arg) {
39378 LDKNodeFeatures this_arg_conv;
39379 this_arg_conv.inner = untag_ptr(this_arg);
39380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39382 this_arg_conv.is_owned = false;
39383 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
39387 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
39388 LDKInitFeatures this_arg_conv;
39389 this_arg_conv.inner = untag_ptr(this_arg);
39390 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39392 this_arg_conv.is_owned = false;
39393 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
39396 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
39397 LDKInitFeatures this_arg_conv;
39398 this_arg_conv.inner = untag_ptr(this_arg);
39399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39401 this_arg_conv.is_owned = false;
39402 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
39405 jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
39406 LDKInitFeatures this_arg_conv;
39407 this_arg_conv.inner = untag_ptr(this_arg);
39408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39410 this_arg_conv.is_owned = false;
39411 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
39415 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
39416 LDKNodeFeatures this_arg_conv;
39417 this_arg_conv.inner = untag_ptr(this_arg);
39418 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39420 this_arg_conv.is_owned = false;
39421 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
39424 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
39425 LDKNodeFeatures this_arg_conv;
39426 this_arg_conv.inner = untag_ptr(this_arg);
39427 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39429 this_arg_conv.is_owned = false;
39430 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
39433 jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
39434 LDKNodeFeatures this_arg_conv;
39435 this_arg_conv.inner = untag_ptr(this_arg);
39436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39438 this_arg_conv.is_owned = false;
39439 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
39443 jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
39444 LDKInitFeatures this_arg_conv;
39445 this_arg_conv.inner = untag_ptr(this_arg);
39446 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39448 this_arg_conv.is_owned = false;
39449 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
39453 jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
39454 LDKNodeFeatures this_arg_conv;
39455 this_arg_conv.inner = untag_ptr(this_arg);
39456 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39458 this_arg_conv.is_owned = false;
39459 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
39463 void __attribute__((export_name("TS_InitFeatures_set_onion_messages_optional"))) TS_InitFeatures_set_onion_messages_optional(uint64_t this_arg) {
39464 LDKInitFeatures this_arg_conv;
39465 this_arg_conv.inner = untag_ptr(this_arg);
39466 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39468 this_arg_conv.is_owned = false;
39469 InitFeatures_set_onion_messages_optional(&this_arg_conv);
39472 void __attribute__((export_name("TS_InitFeatures_set_onion_messages_required"))) TS_InitFeatures_set_onion_messages_required(uint64_t this_arg) {
39473 LDKInitFeatures this_arg_conv;
39474 this_arg_conv.inner = untag_ptr(this_arg);
39475 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39477 this_arg_conv.is_owned = false;
39478 InitFeatures_set_onion_messages_required(&this_arg_conv);
39481 jboolean __attribute__((export_name("TS_InitFeatures_supports_onion_messages"))) TS_InitFeatures_supports_onion_messages(uint64_t this_arg) {
39482 LDKInitFeatures this_arg_conv;
39483 this_arg_conv.inner = untag_ptr(this_arg);
39484 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39486 this_arg_conv.is_owned = false;
39487 jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
39491 void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_optional"))) TS_NodeFeatures_set_onion_messages_optional(uint64_t this_arg) {
39492 LDKNodeFeatures this_arg_conv;
39493 this_arg_conv.inner = untag_ptr(this_arg);
39494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39496 this_arg_conv.is_owned = false;
39497 NodeFeatures_set_onion_messages_optional(&this_arg_conv);
39500 void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_required"))) TS_NodeFeatures_set_onion_messages_required(uint64_t this_arg) {
39501 LDKNodeFeatures this_arg_conv;
39502 this_arg_conv.inner = untag_ptr(this_arg);
39503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39505 this_arg_conv.is_owned = false;
39506 NodeFeatures_set_onion_messages_required(&this_arg_conv);
39509 jboolean __attribute__((export_name("TS_NodeFeatures_supports_onion_messages"))) TS_NodeFeatures_supports_onion_messages(uint64_t this_arg) {
39510 LDKNodeFeatures this_arg_conv;
39511 this_arg_conv.inner = untag_ptr(this_arg);
39512 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39514 this_arg_conv.is_owned = false;
39515 jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
39519 jboolean __attribute__((export_name("TS_InitFeatures_requires_onion_messages"))) TS_InitFeatures_requires_onion_messages(uint64_t this_arg) {
39520 LDKInitFeatures this_arg_conv;
39521 this_arg_conv.inner = untag_ptr(this_arg);
39522 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39524 this_arg_conv.is_owned = false;
39525 jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
39529 jboolean __attribute__((export_name("TS_NodeFeatures_requires_onion_messages"))) TS_NodeFeatures_requires_onion_messages(uint64_t this_arg) {
39530 LDKNodeFeatures this_arg_conv;
39531 this_arg_conv.inner = untag_ptr(this_arg);
39532 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39534 this_arg_conv.is_owned = false;
39535 jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
39539 void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
39540 LDKInitFeatures this_arg_conv;
39541 this_arg_conv.inner = untag_ptr(this_arg);
39542 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39544 this_arg_conv.is_owned = false;
39545 InitFeatures_set_channel_type_optional(&this_arg_conv);
39548 void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_required(uint64_t this_arg) {
39549 LDKInitFeatures this_arg_conv;
39550 this_arg_conv.inner = untag_ptr(this_arg);
39551 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39553 this_arg_conv.is_owned = false;
39554 InitFeatures_set_channel_type_required(&this_arg_conv);
39557 jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(uint64_t this_arg) {
39558 LDKInitFeatures this_arg_conv;
39559 this_arg_conv.inner = untag_ptr(this_arg);
39560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39562 this_arg_conv.is_owned = false;
39563 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
39567 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_optional(uint64_t this_arg) {
39568 LDKNodeFeatures this_arg_conv;
39569 this_arg_conv.inner = untag_ptr(this_arg);
39570 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39572 this_arg_conv.is_owned = false;
39573 NodeFeatures_set_channel_type_optional(&this_arg_conv);
39576 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_required(uint64_t this_arg) {
39577 LDKNodeFeatures this_arg_conv;
39578 this_arg_conv.inner = untag_ptr(this_arg);
39579 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39581 this_arg_conv.is_owned = false;
39582 NodeFeatures_set_channel_type_required(&this_arg_conv);
39585 jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) {
39586 LDKNodeFeatures this_arg_conv;
39587 this_arg_conv.inner = untag_ptr(this_arg);
39588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39590 this_arg_conv.is_owned = false;
39591 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
39595 jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) {
39596 LDKInitFeatures this_arg_conv;
39597 this_arg_conv.inner = untag_ptr(this_arg);
39598 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39600 this_arg_conv.is_owned = false;
39601 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
39605 jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) {
39606 LDKNodeFeatures this_arg_conv;
39607 this_arg_conv.inner = untag_ptr(this_arg);
39608 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39610 this_arg_conv.is_owned = false;
39611 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
39615 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_optional(uint64_t this_arg) {
39616 LDKInitFeatures this_arg_conv;
39617 this_arg_conv.inner = untag_ptr(this_arg);
39618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39620 this_arg_conv.is_owned = false;
39621 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
39624 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_required(uint64_t this_arg) {
39625 LDKInitFeatures this_arg_conv;
39626 this_arg_conv.inner = untag_ptr(this_arg);
39627 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39629 this_arg_conv.is_owned = false;
39630 InitFeatures_set_scid_privacy_required(&this_arg_conv);
39633 jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(uint64_t this_arg) {
39634 LDKInitFeatures this_arg_conv;
39635 this_arg_conv.inner = untag_ptr(this_arg);
39636 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39638 this_arg_conv.is_owned = false;
39639 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
39643 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
39644 LDKNodeFeatures this_arg_conv;
39645 this_arg_conv.inner = untag_ptr(this_arg);
39646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39648 this_arg_conv.is_owned = false;
39649 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
39652 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_required(uint64_t this_arg) {
39653 LDKNodeFeatures this_arg_conv;
39654 this_arg_conv.inner = untag_ptr(this_arg);
39655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39657 this_arg_conv.is_owned = false;
39658 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
39661 jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(uint64_t this_arg) {
39662 LDKNodeFeatures this_arg_conv;
39663 this_arg_conv.inner = untag_ptr(this_arg);
39664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39666 this_arg_conv.is_owned = false;
39667 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
39671 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
39672 LDKChannelTypeFeatures this_arg_conv;
39673 this_arg_conv.inner = untag_ptr(this_arg);
39674 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39676 this_arg_conv.is_owned = false;
39677 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
39680 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_required(uint64_t this_arg) {
39681 LDKChannelTypeFeatures this_arg_conv;
39682 this_arg_conv.inner = untag_ptr(this_arg);
39683 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39685 this_arg_conv.is_owned = false;
39686 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
39689 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(uint64_t this_arg) {
39690 LDKChannelTypeFeatures this_arg_conv;
39691 this_arg_conv.inner = untag_ptr(this_arg);
39692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39694 this_arg_conv.is_owned = false;
39695 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
39699 jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(uint64_t this_arg) {
39700 LDKInitFeatures this_arg_conv;
39701 this_arg_conv.inner = untag_ptr(this_arg);
39702 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39704 this_arg_conv.is_owned = false;
39705 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
39709 jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(uint64_t this_arg) {
39710 LDKNodeFeatures this_arg_conv;
39711 this_arg_conv.inner = untag_ptr(this_arg);
39712 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39714 this_arg_conv.is_owned = false;
39715 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
39719 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(uint64_t this_arg) {
39720 LDKChannelTypeFeatures this_arg_conv;
39721 this_arg_conv.inner = untag_ptr(this_arg);
39722 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39724 this_arg_conv.is_owned = false;
39725 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
39729 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_optional(uint64_t this_arg) {
39730 LDKInitFeatures this_arg_conv;
39731 this_arg_conv.inner = untag_ptr(this_arg);
39732 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39734 this_arg_conv.is_owned = false;
39735 InitFeatures_set_zero_conf_optional(&this_arg_conv);
39738 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_required(uint64_t this_arg) {
39739 LDKInitFeatures this_arg_conv;
39740 this_arg_conv.inner = untag_ptr(this_arg);
39741 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39743 this_arg_conv.is_owned = false;
39744 InitFeatures_set_zero_conf_required(&this_arg_conv);
39747 jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) {
39748 LDKInitFeatures this_arg_conv;
39749 this_arg_conv.inner = untag_ptr(this_arg);
39750 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39752 this_arg_conv.is_owned = false;
39753 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
39757 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_optional(uint64_t this_arg) {
39758 LDKNodeFeatures this_arg_conv;
39759 this_arg_conv.inner = untag_ptr(this_arg);
39760 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39762 this_arg_conv.is_owned = false;
39763 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
39766 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_required(uint64_t this_arg) {
39767 LDKNodeFeatures this_arg_conv;
39768 this_arg_conv.inner = untag_ptr(this_arg);
39769 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39771 this_arg_conv.is_owned = false;
39772 NodeFeatures_set_zero_conf_required(&this_arg_conv);
39775 jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) {
39776 LDKNodeFeatures this_arg_conv;
39777 this_arg_conv.inner = untag_ptr(this_arg);
39778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39780 this_arg_conv.is_owned = false;
39781 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
39785 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_optional(uint64_t this_arg) {
39786 LDKChannelTypeFeatures this_arg_conv;
39787 this_arg_conv.inner = untag_ptr(this_arg);
39788 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39790 this_arg_conv.is_owned = false;
39791 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
39794 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_required(uint64_t this_arg) {
39795 LDKChannelTypeFeatures this_arg_conv;
39796 this_arg_conv.inner = untag_ptr(this_arg);
39797 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39799 this_arg_conv.is_owned = false;
39800 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
39803 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) {
39804 LDKChannelTypeFeatures this_arg_conv;
39805 this_arg_conv.inner = untag_ptr(this_arg);
39806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39808 this_arg_conv.is_owned = false;
39809 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
39813 jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) {
39814 LDKInitFeatures this_arg_conv;
39815 this_arg_conv.inner = untag_ptr(this_arg);
39816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39818 this_arg_conv.is_owned = false;
39819 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
39823 jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) {
39824 LDKNodeFeatures this_arg_conv;
39825 this_arg_conv.inner = untag_ptr(this_arg);
39826 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39828 this_arg_conv.is_owned = false;
39829 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
39833 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) {
39834 LDKChannelTypeFeatures this_arg_conv;
39835 this_arg_conv.inner = untag_ptr(this_arg);
39836 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39838 this_arg_conv.is_owned = false;
39839 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
39843 void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_optional(uint64_t this_arg) {
39844 LDKNodeFeatures this_arg_conv;
39845 this_arg_conv.inner = untag_ptr(this_arg);
39846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39848 this_arg_conv.is_owned = false;
39849 NodeFeatures_set_keysend_optional(&this_arg_conv);
39852 void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_required(uint64_t this_arg) {
39853 LDKNodeFeatures this_arg_conv;
39854 this_arg_conv.inner = untag_ptr(this_arg);
39855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39857 this_arg_conv.is_owned = false;
39858 NodeFeatures_set_keysend_required(&this_arg_conv);
39861 jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(uint64_t this_arg) {
39862 LDKNodeFeatures this_arg_conv;
39863 this_arg_conv.inner = untag_ptr(this_arg);
39864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39866 this_arg_conv.is_owned = false;
39867 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
39871 jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(uint64_t this_arg) {
39872 LDKNodeFeatures this_arg_conv;
39873 this_arg_conv.inner = untag_ptr(this_arg);
39874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39876 this_arg_conv.is_owned = false;
39877 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
39881 void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) {
39882 LDKShutdownScript this_obj_conv;
39883 this_obj_conv.inner = untag_ptr(this_obj);
39884 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39886 ShutdownScript_free(this_obj_conv);
39889 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
39890 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
39891 uint64_t ret_ref = 0;
39892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39896 int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) {
39897 LDKShutdownScript arg_conv;
39898 arg_conv.inner = untag_ptr(arg);
39899 arg_conv.is_owned = ptr_is_owned(arg);
39900 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39901 arg_conv.is_owned = false;
39902 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
39906 uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) {
39907 LDKShutdownScript orig_conv;
39908 orig_conv.inner = untag_ptr(orig);
39909 orig_conv.is_owned = ptr_is_owned(orig);
39910 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39911 orig_conv.is_owned = false;
39912 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
39913 uint64_t ret_ref = 0;
39914 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39915 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39919 jboolean __attribute__((export_name("TS_ShutdownScript_eq"))) TS_ShutdownScript_eq(uint64_t a, uint64_t b) {
39920 LDKShutdownScript a_conv;
39921 a_conv.inner = untag_ptr(a);
39922 a_conv.is_owned = ptr_is_owned(a);
39923 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39924 a_conv.is_owned = false;
39925 LDKShutdownScript b_conv;
39926 b_conv.inner = untag_ptr(b);
39927 b_conv.is_owned = ptr_is_owned(b);
39928 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39929 b_conv.is_owned = false;
39930 jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
39934 void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
39935 LDKInvalidShutdownScript this_obj_conv;
39936 this_obj_conv.inner = untag_ptr(this_obj);
39937 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39939 InvalidShutdownScript_free(this_obj_conv);
39942 int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) {
39943 LDKInvalidShutdownScript this_ptr_conv;
39944 this_ptr_conv.inner = untag_ptr(this_ptr);
39945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39947 this_ptr_conv.is_owned = false;
39948 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
39949 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39950 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39954 void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) {
39955 LDKInvalidShutdownScript this_ptr_conv;
39956 this_ptr_conv.inner = untag_ptr(this_ptr);
39957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39959 this_ptr_conv.is_owned = false;
39960 LDKCVec_u8Z val_ref;
39961 val_ref.datalen = val->arr_len;
39962 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
39963 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
39964 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
39967 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
39968 LDKCVec_u8Z script_arg_ref;
39969 script_arg_ref.datalen = script_arg->arr_len;
39970 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
39971 memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg);
39972 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
39973 uint64_t ret_ref = 0;
39974 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39975 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39979 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
39980 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
39981 uint64_t ret_ref = 0;
39982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39986 int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) {
39987 LDKInvalidShutdownScript arg_conv;
39988 arg_conv.inner = untag_ptr(arg);
39989 arg_conv.is_owned = ptr_is_owned(arg);
39990 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39991 arg_conv.is_owned = false;
39992 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
39996 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) {
39997 LDKInvalidShutdownScript orig_conv;
39998 orig_conv.inner = untag_ptr(orig);
39999 orig_conv.is_owned = ptr_is_owned(orig);
40000 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40001 orig_conv.is_owned = false;
40002 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
40003 uint64_t ret_ref = 0;
40004 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40005 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40009 int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) {
40010 LDKShutdownScript obj_conv;
40011 obj_conv.inner = untag_ptr(obj);
40012 obj_conv.is_owned = ptr_is_owned(obj);
40013 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40014 obj_conv.is_owned = false;
40015 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
40016 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40017 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40018 CVec_u8Z_free(ret_var);
40022 uint64_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
40023 LDKu8slice ser_ref;
40024 ser_ref.datalen = ser->arr_len;
40025 ser_ref.data = ser->elems;
40026 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
40027 *ret_conv = ShutdownScript_read(ser_ref);
40029 return tag_ptr(ret_conv, true);
40032 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
40033 unsigned char pubkey_hash_arr[20];
40034 CHECK(pubkey_hash->arr_len == 20);
40035 memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
40036 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
40037 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
40038 uint64_t ret_ref = 0;
40039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40044 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
40045 unsigned char script_hash_arr[32];
40046 CHECK(script_hash->arr_len == 32);
40047 memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
40048 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
40049 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
40050 uint64_t ret_ref = 0;
40051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40056 uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
40058 LDKu8slice program_ref;
40059 program_ref.datalen = program->arr_len;
40060 program_ref.data = program->elems;
40061 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
40062 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
40064 return tag_ptr(ret_conv, true);
40067 int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) {
40068 LDKShutdownScript this_arg_conv;
40069 this_arg_conv.inner = untag_ptr(this_arg);
40070 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40072 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
40073 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
40074 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40075 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40076 CVec_u8Z_free(ret_var);
40080 int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) {
40081 LDKShutdownScript this_arg_conv;
40082 this_arg_conv.inner = untag_ptr(this_arg);
40083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40085 this_arg_conv.is_owned = false;
40086 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40087 memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
40091 jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) {
40092 LDKShutdownScript this_arg_conv;
40093 this_arg_conv.inner = untag_ptr(this_arg);
40094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40096 this_arg_conv.is_owned = false;
40097 LDKInitFeatures features_conv;
40098 features_conv.inner = untag_ptr(features);
40099 features_conv.is_owned = ptr_is_owned(features);
40100 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
40101 features_conv.is_owned = false;
40102 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
40106 void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
40107 if (!ptr_is_owned(this_ptr)) return;
40108 void* this_ptr_ptr = untag_ptr(this_ptr);
40109 CHECK_ACCESS(this_ptr_ptr);
40110 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
40111 FREE(untag_ptr(this_ptr));
40112 CustomMessageReader_free(this_ptr_conv);
40115 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
40116 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
40117 *ret_ret = Type_clone(arg);
40118 return tag_ptr(ret_ret, true);
40120 int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) {
40121 void* arg_ptr = untag_ptr(arg);
40122 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
40123 LDKType* arg_conv = (LDKType*)arg_ptr;
40124 int64_t ret_conv = Type_clone_ptr(arg_conv);
40128 uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) {
40129 void* orig_ptr = untag_ptr(orig);
40130 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
40131 LDKType* orig_conv = (LDKType*)orig_ptr;
40132 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
40133 *ret_ret = Type_clone(orig_conv);
40134 return tag_ptr(ret_ret, true);
40137 void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_ptr) {
40138 if (!ptr_is_owned(this_ptr)) return;
40139 void* this_ptr_ptr = untag_ptr(this_ptr);
40140 CHECK_ACCESS(this_ptr_ptr);
40141 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
40142 FREE(untag_ptr(this_ptr));
40143 Type_free(this_ptr_conv);
40146 void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
40147 LDKNodeId this_obj_conv;
40148 this_obj_conv.inner = untag_ptr(this_obj);
40149 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40151 NodeId_free(this_obj_conv);
40154 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
40155 LDKNodeId ret_var = NodeId_clone(arg);
40156 uint64_t ret_ref = 0;
40157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40161 int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) {
40162 LDKNodeId arg_conv;
40163 arg_conv.inner = untag_ptr(arg);
40164 arg_conv.is_owned = ptr_is_owned(arg);
40165 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40166 arg_conv.is_owned = false;
40167 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
40171 uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) {
40172 LDKNodeId orig_conv;
40173 orig_conv.inner = untag_ptr(orig);
40174 orig_conv.is_owned = ptr_is_owned(orig);
40175 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40176 orig_conv.is_owned = false;
40177 LDKNodeId ret_var = NodeId_clone(&orig_conv);
40178 uint64_t ret_ref = 0;
40179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40184 uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) {
40185 LDKPublicKey pubkey_ref;
40186 CHECK(pubkey->arr_len == 33);
40187 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
40188 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
40189 uint64_t ret_ref = 0;
40190 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40191 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40195 int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) {
40196 LDKNodeId this_arg_conv;
40197 this_arg_conv.inner = untag_ptr(this_arg);
40198 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40200 this_arg_conv.is_owned = false;
40201 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
40202 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40203 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40207 int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) {
40209 o_conv.inner = untag_ptr(o);
40210 o_conv.is_owned = ptr_is_owned(o);
40211 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40212 o_conv.is_owned = false;
40213 int64_t ret_conv = NodeId_hash(&o_conv);
40217 int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) {
40218 LDKNodeId obj_conv;
40219 obj_conv.inner = untag_ptr(obj);
40220 obj_conv.is_owned = ptr_is_owned(obj);
40221 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40222 obj_conv.is_owned = false;
40223 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
40224 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40225 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40226 CVec_u8Z_free(ret_var);
40230 uint64_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
40231 LDKu8slice ser_ref;
40232 ser_ref.datalen = ser->arr_len;
40233 ser_ref.data = ser->elems;
40234 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
40235 *ret_conv = NodeId_read(ser_ref);
40237 return tag_ptr(ret_conv, true);
40240 void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) {
40241 LDKNetworkGraph this_obj_conv;
40242 this_obj_conv.inner = untag_ptr(this_obj);
40243 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40245 NetworkGraph_free(this_obj_conv);
40248 void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) {
40249 LDKReadOnlyNetworkGraph this_obj_conv;
40250 this_obj_conv.inner = untag_ptr(this_obj);
40251 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40253 ReadOnlyNetworkGraph_free(this_obj_conv);
40256 void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint64_t this_ptr) {
40257 if (!ptr_is_owned(this_ptr)) return;
40258 void* this_ptr_ptr = untag_ptr(this_ptr);
40259 CHECK_ACCESS(this_ptr_ptr);
40260 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
40261 FREE(untag_ptr(this_ptr));
40262 NetworkUpdate_free(this_ptr_conv);
40265 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
40266 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
40267 *ret_copy = NetworkUpdate_clone(arg);
40268 uint64_t ret_ref = tag_ptr(ret_copy, true);
40271 int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) {
40272 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
40273 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
40277 uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) {
40278 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
40279 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
40280 *ret_copy = NetworkUpdate_clone(orig_conv);
40281 uint64_t ret_ref = tag_ptr(ret_copy, true);
40285 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) {
40286 LDKChannelUpdate msg_conv;
40287 msg_conv.inner = untag_ptr(msg);
40288 msg_conv.is_owned = ptr_is_owned(msg);
40289 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40290 msg_conv = ChannelUpdate_clone(&msg_conv);
40291 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
40292 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
40293 uint64_t ret_ref = tag_ptr(ret_copy, true);
40297 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) {
40298 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
40299 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
40300 uint64_t ret_ref = tag_ptr(ret_copy, true);
40304 uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
40305 LDKPublicKey node_id_ref;
40306 CHECK(node_id->arr_len == 33);
40307 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
40308 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
40309 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
40310 uint64_t ret_ref = tag_ptr(ret_copy, true);
40314 jboolean __attribute__((export_name("TS_NetworkUpdate_eq"))) TS_NetworkUpdate_eq(uint64_t a, uint64_t b) {
40315 LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
40316 LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
40317 jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
40321 int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
40322 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
40323 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
40324 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40325 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40326 CVec_u8Z_free(ret_var);
40330 uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
40331 LDKu8slice ser_ref;
40332 ser_ref.datalen = ser->arr_len;
40333 ser_ref.data = ser->elems;
40334 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
40335 *ret_conv = NetworkUpdate_read(ser_ref);
40337 return tag_ptr(ret_conv, true);
40340 void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) {
40341 LDKP2PGossipSync this_obj_conv;
40342 this_obj_conv.inner = untag_ptr(this_obj);
40343 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40345 P2PGossipSync_free(this_obj_conv);
40348 uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
40349 LDKNetworkGraph network_graph_conv;
40350 network_graph_conv.inner = untag_ptr(network_graph);
40351 network_graph_conv.is_owned = ptr_is_owned(network_graph);
40352 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
40353 network_graph_conv.is_owned = false;
40354 void* chain_access_ptr = untag_ptr(chain_access);
40355 CHECK_ACCESS(chain_access_ptr);
40356 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
40357 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
40358 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
40359 // Manually implement clone for Java trait instances
40360 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
40361 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40362 LDKAccess_JCalls_cloned(&chain_access_conv.some);
40365 void* logger_ptr = untag_ptr(logger);
40366 CHECK_ACCESS(logger_ptr);
40367 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
40368 if (logger_conv.free == LDKLogger_JCalls_free) {
40369 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40370 LDKLogger_JCalls_cloned(&logger_conv);
40372 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
40373 uint64_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);
40379 void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
40380 LDKP2PGossipSync this_arg_conv;
40381 this_arg_conv.inner = untag_ptr(this_arg);
40382 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40384 this_arg_conv.is_owned = false;
40385 void* chain_access_ptr = untag_ptr(chain_access);
40386 CHECK_ACCESS(chain_access_ptr);
40387 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
40388 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
40389 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
40390 // Manually implement clone for Java trait instances
40391 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
40392 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40393 LDKAccess_JCalls_cloned(&chain_access_conv.some);
40396 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
40399 uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
40400 LDKNetworkGraph this_arg_conv;
40401 this_arg_conv.inner = untag_ptr(this_arg);
40402 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40404 this_arg_conv.is_owned = false;
40405 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
40406 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
40407 return tag_ptr(ret_ret, true);
40410 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
40411 LDKP2PGossipSync this_arg_conv;
40412 this_arg_conv.inner = untag_ptr(this_arg);
40413 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40415 this_arg_conv.is_owned = false;
40416 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
40417 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
40418 return tag_ptr(ret_ret, true);
40421 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) {
40422 LDKP2PGossipSync this_arg_conv;
40423 this_arg_conv.inner = untag_ptr(this_arg);
40424 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40426 this_arg_conv.is_owned = false;
40427 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
40428 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
40429 return tag_ptr(ret_ret, true);
40432 void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) {
40433 LDKChannelUpdateInfo this_obj_conv;
40434 this_obj_conv.inner = untag_ptr(this_obj);
40435 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40437 ChannelUpdateInfo_free(this_obj_conv);
40440 int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) {
40441 LDKChannelUpdateInfo this_ptr_conv;
40442 this_ptr_conv.inner = untag_ptr(this_ptr);
40443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40445 this_ptr_conv.is_owned = false;
40446 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
40450 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) {
40451 LDKChannelUpdateInfo this_ptr_conv;
40452 this_ptr_conv.inner = untag_ptr(this_ptr);
40453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40455 this_ptr_conv.is_owned = false;
40456 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
40459 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) {
40460 LDKChannelUpdateInfo this_ptr_conv;
40461 this_ptr_conv.inner = untag_ptr(this_ptr);
40462 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40464 this_ptr_conv.is_owned = false;
40465 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
40469 void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) {
40470 LDKChannelUpdateInfo this_ptr_conv;
40471 this_ptr_conv.inner = untag_ptr(this_ptr);
40472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40474 this_ptr_conv.is_owned = false;
40475 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
40478 int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
40479 LDKChannelUpdateInfo this_ptr_conv;
40480 this_ptr_conv.inner = untag_ptr(this_ptr);
40481 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40483 this_ptr_conv.is_owned = false;
40484 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
40488 void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
40489 LDKChannelUpdateInfo this_ptr_conv;
40490 this_ptr_conv.inner = untag_ptr(this_ptr);
40491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40493 this_ptr_conv.is_owned = false;
40494 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
40497 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) {
40498 LDKChannelUpdateInfo this_ptr_conv;
40499 this_ptr_conv.inner = untag_ptr(this_ptr);
40500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40502 this_ptr_conv.is_owned = false;
40503 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
40507 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
40508 LDKChannelUpdateInfo this_ptr_conv;
40509 this_ptr_conv.inner = untag_ptr(this_ptr);
40510 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40512 this_ptr_conv.is_owned = false;
40513 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
40516 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) {
40517 LDKChannelUpdateInfo this_ptr_conv;
40518 this_ptr_conv.inner = untag_ptr(this_ptr);
40519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40521 this_ptr_conv.is_owned = false;
40522 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
40526 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
40527 LDKChannelUpdateInfo this_ptr_conv;
40528 this_ptr_conv.inner = untag_ptr(this_ptr);
40529 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40531 this_ptr_conv.is_owned = false;
40532 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
40535 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) {
40536 LDKChannelUpdateInfo this_ptr_conv;
40537 this_ptr_conv.inner = untag_ptr(this_ptr);
40538 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40540 this_ptr_conv.is_owned = false;
40541 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
40542 uint64_t ret_ref = 0;
40543 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40544 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40548 void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) {
40549 LDKChannelUpdateInfo this_ptr_conv;
40550 this_ptr_conv.inner = untag_ptr(this_ptr);
40551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40553 this_ptr_conv.is_owned = false;
40554 LDKRoutingFees val_conv;
40555 val_conv.inner = untag_ptr(val);
40556 val_conv.is_owned = ptr_is_owned(val);
40557 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40558 val_conv = RoutingFees_clone(&val_conv);
40559 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
40562 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) {
40563 LDKChannelUpdateInfo this_ptr_conv;
40564 this_ptr_conv.inner = untag_ptr(this_ptr);
40565 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40567 this_ptr_conv.is_owned = false;
40568 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
40569 uint64_t ret_ref = 0;
40570 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40571 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40575 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) {
40576 LDKChannelUpdateInfo 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 LDKChannelUpdate val_conv;
40582 val_conv.inner = untag_ptr(val);
40583 val_conv.is_owned = ptr_is_owned(val);
40584 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40585 val_conv = ChannelUpdate_clone(&val_conv);
40586 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
40589 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_new"))) TS_ChannelUpdateInfo_new(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, uint64_t fees_arg, uint64_t last_update_message_arg) {
40590 LDKRoutingFees fees_arg_conv;
40591 fees_arg_conv.inner = untag_ptr(fees_arg);
40592 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
40593 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
40594 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
40595 LDKChannelUpdate last_update_message_arg_conv;
40596 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
40597 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
40598 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
40599 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
40600 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);
40601 uint64_t ret_ref = 0;
40602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40607 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
40608 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
40609 uint64_t ret_ref = 0;
40610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40614 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) {
40615 LDKChannelUpdateInfo arg_conv;
40616 arg_conv.inner = untag_ptr(arg);
40617 arg_conv.is_owned = ptr_is_owned(arg);
40618 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40619 arg_conv.is_owned = false;
40620 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
40624 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) {
40625 LDKChannelUpdateInfo orig_conv;
40626 orig_conv.inner = untag_ptr(orig);
40627 orig_conv.is_owned = ptr_is_owned(orig);
40628 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40629 orig_conv.is_owned = false;
40630 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
40631 uint64_t ret_ref = 0;
40632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40637 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_eq"))) TS_ChannelUpdateInfo_eq(uint64_t a, uint64_t b) {
40638 LDKChannelUpdateInfo a_conv;
40639 a_conv.inner = untag_ptr(a);
40640 a_conv.is_owned = ptr_is_owned(a);
40641 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40642 a_conv.is_owned = false;
40643 LDKChannelUpdateInfo b_conv;
40644 b_conv.inner = untag_ptr(b);
40645 b_conv.is_owned = ptr_is_owned(b);
40646 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40647 b_conv.is_owned = false;
40648 jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
40652 int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
40653 LDKChannelUpdateInfo obj_conv;
40654 obj_conv.inner = untag_ptr(obj);
40655 obj_conv.is_owned = ptr_is_owned(obj);
40656 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40657 obj_conv.is_owned = false;
40658 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
40659 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40660 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40661 CVec_u8Z_free(ret_var);
40665 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
40666 LDKu8slice ser_ref;
40667 ser_ref.datalen = ser->arr_len;
40668 ser_ref.data = ser->elems;
40669 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
40670 *ret_conv = ChannelUpdateInfo_read(ser_ref);
40672 return tag_ptr(ret_conv, true);
40675 void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) {
40676 LDKChannelInfo this_obj_conv;
40677 this_obj_conv.inner = untag_ptr(this_obj);
40678 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40680 ChannelInfo_free(this_obj_conv);
40683 uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) {
40684 LDKChannelInfo this_ptr_conv;
40685 this_ptr_conv.inner = untag_ptr(this_ptr);
40686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40688 this_ptr_conv.is_owned = false;
40689 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
40690 uint64_t ret_ref = 0;
40691 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40692 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40696 void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) {
40697 LDKChannelInfo this_ptr_conv;
40698 this_ptr_conv.inner = untag_ptr(this_ptr);
40699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40701 this_ptr_conv.is_owned = false;
40702 LDKChannelFeatures val_conv;
40703 val_conv.inner = untag_ptr(val);
40704 val_conv.is_owned = ptr_is_owned(val);
40705 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40706 val_conv = ChannelFeatures_clone(&val_conv);
40707 ChannelInfo_set_features(&this_ptr_conv, val_conv);
40710 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) {
40711 LDKChannelInfo this_ptr_conv;
40712 this_ptr_conv.inner = untag_ptr(this_ptr);
40713 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40715 this_ptr_conv.is_owned = false;
40716 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
40717 uint64_t ret_ref = 0;
40718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40723 void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) {
40724 LDKChannelInfo this_ptr_conv;
40725 this_ptr_conv.inner = untag_ptr(this_ptr);
40726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40728 this_ptr_conv.is_owned = false;
40729 LDKNodeId val_conv;
40730 val_conv.inner = untag_ptr(val);
40731 val_conv.is_owned = ptr_is_owned(val);
40732 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40733 val_conv = NodeId_clone(&val_conv);
40734 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
40737 uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) {
40738 LDKChannelInfo this_ptr_conv;
40739 this_ptr_conv.inner = untag_ptr(this_ptr);
40740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40742 this_ptr_conv.is_owned = false;
40743 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
40744 uint64_t ret_ref = 0;
40745 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40746 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40750 void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) {
40751 LDKChannelInfo this_ptr_conv;
40752 this_ptr_conv.inner = untag_ptr(this_ptr);
40753 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40755 this_ptr_conv.is_owned = false;
40756 LDKChannelUpdateInfo val_conv;
40757 val_conv.inner = untag_ptr(val);
40758 val_conv.is_owned = ptr_is_owned(val);
40759 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40760 val_conv = ChannelUpdateInfo_clone(&val_conv);
40761 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
40764 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) {
40765 LDKChannelInfo this_ptr_conv;
40766 this_ptr_conv.inner = untag_ptr(this_ptr);
40767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40769 this_ptr_conv.is_owned = false;
40770 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
40771 uint64_t ret_ref = 0;
40772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40777 void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) {
40778 LDKChannelInfo this_ptr_conv;
40779 this_ptr_conv.inner = untag_ptr(this_ptr);
40780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40782 this_ptr_conv.is_owned = false;
40783 LDKNodeId val_conv;
40784 val_conv.inner = untag_ptr(val);
40785 val_conv.is_owned = ptr_is_owned(val);
40786 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40787 val_conv = NodeId_clone(&val_conv);
40788 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
40791 uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) {
40792 LDKChannelInfo this_ptr_conv;
40793 this_ptr_conv.inner = untag_ptr(this_ptr);
40794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40796 this_ptr_conv.is_owned = false;
40797 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
40798 uint64_t ret_ref = 0;
40799 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40800 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40804 void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) {
40805 LDKChannelInfo this_ptr_conv;
40806 this_ptr_conv.inner = untag_ptr(this_ptr);
40807 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40809 this_ptr_conv.is_owned = false;
40810 LDKChannelUpdateInfo val_conv;
40811 val_conv.inner = untag_ptr(val);
40812 val_conv.is_owned = ptr_is_owned(val);
40813 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40814 val_conv = ChannelUpdateInfo_clone(&val_conv);
40815 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
40818 uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) {
40819 LDKChannelInfo this_ptr_conv;
40820 this_ptr_conv.inner = untag_ptr(this_ptr);
40821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40823 this_ptr_conv.is_owned = false;
40824 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40825 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
40826 uint64_t ret_ref = tag_ptr(ret_copy, true);
40830 void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) {
40831 LDKChannelInfo this_ptr_conv;
40832 this_ptr_conv.inner = untag_ptr(this_ptr);
40833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40835 this_ptr_conv.is_owned = false;
40836 void* val_ptr = untag_ptr(val);
40837 CHECK_ACCESS(val_ptr);
40838 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40839 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40840 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
40843 uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) {
40844 LDKChannelInfo this_ptr_conv;
40845 this_ptr_conv.inner = untag_ptr(this_ptr);
40846 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40848 this_ptr_conv.is_owned = false;
40849 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
40850 uint64_t ret_ref = 0;
40851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40856 void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
40857 LDKChannelInfo this_ptr_conv;
40858 this_ptr_conv.inner = untag_ptr(this_ptr);
40859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40861 this_ptr_conv.is_owned = false;
40862 LDKChannelAnnouncement val_conv;
40863 val_conv.inner = untag_ptr(val);
40864 val_conv.is_owned = ptr_is_owned(val);
40865 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40866 val_conv = ChannelAnnouncement_clone(&val_conv);
40867 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
40870 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
40871 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
40872 uint64_t ret_ref = 0;
40873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40877 int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) {
40878 LDKChannelInfo arg_conv;
40879 arg_conv.inner = untag_ptr(arg);
40880 arg_conv.is_owned = ptr_is_owned(arg);
40881 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40882 arg_conv.is_owned = false;
40883 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
40887 uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) {
40888 LDKChannelInfo orig_conv;
40889 orig_conv.inner = untag_ptr(orig);
40890 orig_conv.is_owned = ptr_is_owned(orig);
40891 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40892 orig_conv.is_owned = false;
40893 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
40894 uint64_t ret_ref = 0;
40895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40900 jboolean __attribute__((export_name("TS_ChannelInfo_eq"))) TS_ChannelInfo_eq(uint64_t a, uint64_t b) {
40901 LDKChannelInfo a_conv;
40902 a_conv.inner = untag_ptr(a);
40903 a_conv.is_owned = ptr_is_owned(a);
40904 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40905 a_conv.is_owned = false;
40906 LDKChannelInfo b_conv;
40907 b_conv.inner = untag_ptr(b);
40908 b_conv.is_owned = ptr_is_owned(b);
40909 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40910 b_conv.is_owned = false;
40911 jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
40915 uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
40916 LDKChannelInfo this_arg_conv;
40917 this_arg_conv.inner = untag_ptr(this_arg);
40918 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40920 this_arg_conv.is_owned = false;
40921 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
40922 uint64_t ret_ref = 0;
40923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40928 int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) {
40929 LDKChannelInfo 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 = ChannelInfo_write(&obj_conv);
40935 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40936 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40937 CVec_u8Z_free(ret_var);
40941 uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
40942 LDKu8slice ser_ref;
40943 ser_ref.datalen = ser->arr_len;
40944 ser_ref.data = ser->elems;
40945 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
40946 *ret_conv = ChannelInfo_read(ser_ref);
40948 return tag_ptr(ret_conv, true);
40951 void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) {
40952 LDKDirectedChannelInfo this_obj_conv;
40953 this_obj_conv.inner = untag_ptr(this_obj);
40954 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40956 DirectedChannelInfo_free(this_obj_conv);
40959 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
40960 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
40961 uint64_t ret_ref = 0;
40962 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40963 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40966 int64_t __attribute__((export_name("TS_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) {
40967 LDKDirectedChannelInfo arg_conv;
40968 arg_conv.inner = untag_ptr(arg);
40969 arg_conv.is_owned = ptr_is_owned(arg);
40970 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40971 arg_conv.is_owned = false;
40972 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
40976 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) {
40977 LDKDirectedChannelInfo orig_conv;
40978 orig_conv.inner = untag_ptr(orig);
40979 orig_conv.is_owned = ptr_is_owned(orig);
40980 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40981 orig_conv.is_owned = false;
40982 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
40983 uint64_t ret_ref = 0;
40984 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40985 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40989 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(uint64_t this_arg) {
40990 LDKDirectedChannelInfo this_arg_conv;
40991 this_arg_conv.inner = untag_ptr(this_arg);
40992 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40994 this_arg_conv.is_owned = false;
40995 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
40996 uint64_t ret_ref = 0;
40997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41002 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
41003 LDKDirectedChannelInfo this_arg_conv;
41004 this_arg_conv.inner = untag_ptr(this_arg);
41005 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41007 this_arg_conv.is_owned = false;
41008 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
41009 uint64_t ret_ref = 0;
41010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41015 int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
41016 LDKDirectedChannelInfo this_arg_conv;
41017 this_arg_conv.inner = untag_ptr(this_arg);
41018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41020 this_arg_conv.is_owned = false;
41021 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
41025 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(uint64_t this_arg) {
41026 LDKDirectedChannelInfo this_arg_conv;
41027 this_arg_conv.inner = untag_ptr(this_arg);
41028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41030 this_arg_conv.is_owned = false;
41031 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41032 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
41033 uint64_t ret_ref = tag_ptr(ret_copy, true);
41037 void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) {
41038 if (!ptr_is_owned(this_ptr)) return;
41039 void* this_ptr_ptr = untag_ptr(this_ptr);
41040 CHECK_ACCESS(this_ptr_ptr);
41041 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
41042 FREE(untag_ptr(this_ptr));
41043 EffectiveCapacity_free(this_ptr_conv);
41046 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
41047 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41048 *ret_copy = EffectiveCapacity_clone(arg);
41049 uint64_t ret_ref = tag_ptr(ret_copy, true);
41052 int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) {
41053 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
41054 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
41058 uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) {
41059 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
41060 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41061 *ret_copy = EffectiveCapacity_clone(orig_conv);
41062 uint64_t ret_ref = tag_ptr(ret_copy, true);
41066 uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) {
41067 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41068 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
41069 uint64_t ret_ref = tag_ptr(ret_copy, true);
41073 uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) {
41074 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41075 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
41076 uint64_t ret_ref = tag_ptr(ret_copy, true);
41080 uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
41081 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
41082 CHECK_ACCESS(htlc_maximum_msat_ptr);
41083 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
41084 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
41085 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41086 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
41087 uint64_t ret_ref = tag_ptr(ret_copy, true);
41091 uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() {
41092 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41093 *ret_copy = EffectiveCapacity_infinite();
41094 uint64_t ret_ref = tag_ptr(ret_copy, true);
41098 uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() {
41099 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41100 *ret_copy = EffectiveCapacity_unknown();
41101 uint64_t ret_ref = tag_ptr(ret_copy, true);
41105 int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) {
41106 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
41107 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
41111 void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) {
41112 LDKRoutingFees this_obj_conv;
41113 this_obj_conv.inner = untag_ptr(this_obj);
41114 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41116 RoutingFees_free(this_obj_conv);
41119 int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) {
41120 LDKRoutingFees this_ptr_conv;
41121 this_ptr_conv.inner = untag_ptr(this_ptr);
41122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41124 this_ptr_conv.is_owned = false;
41125 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
41129 void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) {
41130 LDKRoutingFees this_ptr_conv;
41131 this_ptr_conv.inner = untag_ptr(this_ptr);
41132 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41134 this_ptr_conv.is_owned = false;
41135 RoutingFees_set_base_msat(&this_ptr_conv, val);
41138 int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) {
41139 LDKRoutingFees this_ptr_conv;
41140 this_ptr_conv.inner = untag_ptr(this_ptr);
41141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41143 this_ptr_conv.is_owned = false;
41144 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
41148 void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) {
41149 LDKRoutingFees this_ptr_conv;
41150 this_ptr_conv.inner = untag_ptr(this_ptr);
41151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41153 this_ptr_conv.is_owned = false;
41154 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
41157 uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
41158 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
41159 uint64_t ret_ref = 0;
41160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41165 jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) {
41166 LDKRoutingFees a_conv;
41167 a_conv.inner = untag_ptr(a);
41168 a_conv.is_owned = ptr_is_owned(a);
41169 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41170 a_conv.is_owned = false;
41171 LDKRoutingFees b_conv;
41172 b_conv.inner = untag_ptr(b);
41173 b_conv.is_owned = ptr_is_owned(b);
41174 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41175 b_conv.is_owned = false;
41176 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
41180 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
41181 LDKRoutingFees ret_var = RoutingFees_clone(arg);
41182 uint64_t ret_ref = 0;
41183 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41184 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41187 int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) {
41188 LDKRoutingFees arg_conv;
41189 arg_conv.inner = untag_ptr(arg);
41190 arg_conv.is_owned = ptr_is_owned(arg);
41191 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41192 arg_conv.is_owned = false;
41193 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
41197 uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) {
41198 LDKRoutingFees orig_conv;
41199 orig_conv.inner = untag_ptr(orig);
41200 orig_conv.is_owned = ptr_is_owned(orig);
41201 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41202 orig_conv.is_owned = false;
41203 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
41204 uint64_t ret_ref = 0;
41205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41210 int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) {
41211 LDKRoutingFees o_conv;
41212 o_conv.inner = untag_ptr(o);
41213 o_conv.is_owned = ptr_is_owned(o);
41214 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41215 o_conv.is_owned = false;
41216 int64_t ret_conv = RoutingFees_hash(&o_conv);
41220 int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) {
41221 LDKRoutingFees obj_conv;
41222 obj_conv.inner = untag_ptr(obj);
41223 obj_conv.is_owned = ptr_is_owned(obj);
41224 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41225 obj_conv.is_owned = false;
41226 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
41227 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41228 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41229 CVec_u8Z_free(ret_var);
41233 uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
41234 LDKu8slice ser_ref;
41235 ser_ref.datalen = ser->arr_len;
41236 ser_ref.data = ser->elems;
41237 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
41238 *ret_conv = RoutingFees_read(ser_ref);
41240 return tag_ptr(ret_conv, true);
41243 void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) {
41244 LDKNodeAnnouncementInfo this_obj_conv;
41245 this_obj_conv.inner = untag_ptr(this_obj);
41246 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41248 NodeAnnouncementInfo_free(this_obj_conv);
41251 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) {
41252 LDKNodeAnnouncementInfo this_ptr_conv;
41253 this_ptr_conv.inner = untag_ptr(this_ptr);
41254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41256 this_ptr_conv.is_owned = false;
41257 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
41258 uint64_t ret_ref = 0;
41259 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41260 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41264 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) {
41265 LDKNodeAnnouncementInfo this_ptr_conv;
41266 this_ptr_conv.inner = untag_ptr(this_ptr);
41267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41269 this_ptr_conv.is_owned = false;
41270 LDKNodeFeatures val_conv;
41271 val_conv.inner = untag_ptr(val);
41272 val_conv.is_owned = ptr_is_owned(val);
41273 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41274 val_conv = NodeFeatures_clone(&val_conv);
41275 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
41278 int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) {
41279 LDKNodeAnnouncementInfo this_ptr_conv;
41280 this_ptr_conv.inner = untag_ptr(this_ptr);
41281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41283 this_ptr_conv.is_owned = false;
41284 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
41288 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) {
41289 LDKNodeAnnouncementInfo this_ptr_conv;
41290 this_ptr_conv.inner = untag_ptr(this_ptr);
41291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41293 this_ptr_conv.is_owned = false;
41294 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
41297 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) {
41298 LDKNodeAnnouncementInfo this_ptr_conv;
41299 this_ptr_conv.inner = untag_ptr(this_ptr);
41300 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41302 this_ptr_conv.is_owned = false;
41303 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
41304 memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
41308 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) {
41309 LDKNodeAnnouncementInfo this_ptr_conv;
41310 this_ptr_conv.inner = untag_ptr(this_ptr);
41311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41313 this_ptr_conv.is_owned = false;
41314 LDKThreeBytes val_ref;
41315 CHECK(val->arr_len == 3);
41316 memcpy(val_ref.data, val->elems, 3); FREE(val);
41317 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
41320 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) {
41321 LDKNodeAnnouncementInfo this_ptr_conv;
41322 this_ptr_conv.inner = untag_ptr(this_ptr);
41323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41325 this_ptr_conv.is_owned = false;
41326 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
41327 uint64_t ret_ref = 0;
41328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41333 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) {
41334 LDKNodeAnnouncementInfo this_ptr_conv;
41335 this_ptr_conv.inner = untag_ptr(this_ptr);
41336 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41338 this_ptr_conv.is_owned = false;
41339 LDKNodeAlias val_conv;
41340 val_conv.inner = untag_ptr(val);
41341 val_conv.is_owned = ptr_is_owned(val);
41342 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41343 val_conv = NodeAlias_clone(&val_conv);
41344 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
41347 uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) {
41348 LDKNodeAnnouncementInfo this_ptr_conv;
41349 this_ptr_conv.inner = untag_ptr(this_ptr);
41350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41352 this_ptr_conv.is_owned = false;
41353 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
41354 uint64_tArray ret_arr = NULL;
41355 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
41356 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
41357 for (size_t m = 0; m < ret_var.datalen; m++) {
41358 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
41359 *ret_conv_12_copy = ret_var.data[m];
41360 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
41361 ret_arr_ptr[m] = ret_conv_12_ref;
41364 FREE(ret_var.data);
41368 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) {
41369 LDKNodeAnnouncementInfo this_ptr_conv;
41370 this_ptr_conv.inner = untag_ptr(this_ptr);
41371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41373 this_ptr_conv.is_owned = false;
41374 LDKCVec_NetAddressZ val_constr;
41375 val_constr.datalen = val->arr_len;
41376 if (val_constr.datalen > 0)
41377 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
41379 val_constr.data = NULL;
41380 uint64_t* val_vals = val->elems;
41381 for (size_t m = 0; m < val_constr.datalen; m++) {
41382 uint64_t val_conv_12 = val_vals[m];
41383 void* val_conv_12_ptr = untag_ptr(val_conv_12);
41384 CHECK_ACCESS(val_conv_12_ptr);
41385 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
41386 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
41387 val_constr.data[m] = val_conv_12_conv;
41390 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
41393 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) {
41394 LDKNodeAnnouncementInfo this_ptr_conv;
41395 this_ptr_conv.inner = untag_ptr(this_ptr);
41396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41398 this_ptr_conv.is_owned = false;
41399 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
41400 uint64_t ret_ref = 0;
41401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41406 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
41407 LDKNodeAnnouncementInfo this_ptr_conv;
41408 this_ptr_conv.inner = untag_ptr(this_ptr);
41409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41411 this_ptr_conv.is_owned = false;
41412 LDKNodeAnnouncement val_conv;
41413 val_conv.inner = untag_ptr(val);
41414 val_conv.is_owned = ptr_is_owned(val);
41415 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41416 val_conv = NodeAnnouncement_clone(&val_conv);
41417 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
41420 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnnouncementInfo_new(uint64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, uint64_t alias_arg, uint64_tArray addresses_arg, uint64_t announcement_message_arg) {
41421 LDKNodeFeatures features_arg_conv;
41422 features_arg_conv.inner = untag_ptr(features_arg);
41423 features_arg_conv.is_owned = ptr_is_owned(features_arg);
41424 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
41425 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
41426 LDKThreeBytes rgb_arg_ref;
41427 CHECK(rgb_arg->arr_len == 3);
41428 memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg);
41429 LDKNodeAlias alias_arg_conv;
41430 alias_arg_conv.inner = untag_ptr(alias_arg);
41431 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
41432 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
41433 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
41434 LDKCVec_NetAddressZ addresses_arg_constr;
41435 addresses_arg_constr.datalen = addresses_arg->arr_len;
41436 if (addresses_arg_constr.datalen > 0)
41437 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
41439 addresses_arg_constr.data = NULL;
41440 uint64_t* addresses_arg_vals = addresses_arg->elems;
41441 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
41442 uint64_t addresses_arg_conv_12 = addresses_arg_vals[m];
41443 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
41444 CHECK_ACCESS(addresses_arg_conv_12_ptr);
41445 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
41446 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
41448 FREE(addresses_arg);
41449 LDKNodeAnnouncement announcement_message_arg_conv;
41450 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
41451 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
41452 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
41453 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
41454 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
41455 uint64_t ret_ref = 0;
41456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41457 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41461 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
41462 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
41463 uint64_t ret_ref = 0;
41464 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41465 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41468 int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) {
41469 LDKNodeAnnouncementInfo arg_conv;
41470 arg_conv.inner = untag_ptr(arg);
41471 arg_conv.is_owned = ptr_is_owned(arg);
41472 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41473 arg_conv.is_owned = false;
41474 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
41478 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) {
41479 LDKNodeAnnouncementInfo orig_conv;
41480 orig_conv.inner = untag_ptr(orig);
41481 orig_conv.is_owned = ptr_is_owned(orig);
41482 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41483 orig_conv.is_owned = false;
41484 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
41485 uint64_t ret_ref = 0;
41486 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41487 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41491 jboolean __attribute__((export_name("TS_NodeAnnouncementInfo_eq"))) TS_NodeAnnouncementInfo_eq(uint64_t a, uint64_t b) {
41492 LDKNodeAnnouncementInfo a_conv;
41493 a_conv.inner = untag_ptr(a);
41494 a_conv.is_owned = ptr_is_owned(a);
41495 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41496 a_conv.is_owned = false;
41497 LDKNodeAnnouncementInfo b_conv;
41498 b_conv.inner = untag_ptr(b);
41499 b_conv.is_owned = ptr_is_owned(b);
41500 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41501 b_conv.is_owned = false;
41502 jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
41506 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
41507 LDKNodeAnnouncementInfo obj_conv;
41508 obj_conv.inner = untag_ptr(obj);
41509 obj_conv.is_owned = ptr_is_owned(obj);
41510 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41511 obj_conv.is_owned = false;
41512 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
41513 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41514 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41515 CVec_u8Z_free(ret_var);
41519 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
41520 LDKu8slice ser_ref;
41521 ser_ref.datalen = ser->arr_len;
41522 ser_ref.data = ser->elems;
41523 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
41524 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
41526 return tag_ptr(ret_conv, true);
41529 void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) {
41530 LDKNodeAlias this_obj_conv;
41531 this_obj_conv.inner = untag_ptr(this_obj);
41532 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41534 NodeAlias_free(this_obj_conv);
41537 int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) {
41538 LDKNodeAlias this_ptr_conv;
41539 this_ptr_conv.inner = untag_ptr(this_ptr);
41540 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41542 this_ptr_conv.is_owned = false;
41543 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
41544 memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32);
41548 void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) {
41549 LDKNodeAlias this_ptr_conv;
41550 this_ptr_conv.inner = untag_ptr(this_ptr);
41551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41553 this_ptr_conv.is_owned = false;
41554 LDKThirtyTwoBytes val_ref;
41555 CHECK(val->arr_len == 32);
41556 memcpy(val_ref.data, val->elems, 32); FREE(val);
41557 NodeAlias_set_a(&this_ptr_conv, val_ref);
41560 uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) {
41561 LDKThirtyTwoBytes a_arg_ref;
41562 CHECK(a_arg->arr_len == 32);
41563 memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg);
41564 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
41565 uint64_t ret_ref = 0;
41566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41571 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
41572 LDKNodeAlias ret_var = NodeAlias_clone(arg);
41573 uint64_t ret_ref = 0;
41574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41578 int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) {
41579 LDKNodeAlias arg_conv;
41580 arg_conv.inner = untag_ptr(arg);
41581 arg_conv.is_owned = ptr_is_owned(arg);
41582 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41583 arg_conv.is_owned = false;
41584 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
41588 uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) {
41589 LDKNodeAlias orig_conv;
41590 orig_conv.inner = untag_ptr(orig);
41591 orig_conv.is_owned = ptr_is_owned(orig);
41592 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41593 orig_conv.is_owned = false;
41594 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
41595 uint64_t ret_ref = 0;
41596 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41597 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41601 jboolean __attribute__((export_name("TS_NodeAlias_eq"))) TS_NodeAlias_eq(uint64_t a, uint64_t b) {
41602 LDKNodeAlias a_conv;
41603 a_conv.inner = untag_ptr(a);
41604 a_conv.is_owned = ptr_is_owned(a);
41605 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41606 a_conv.is_owned = false;
41607 LDKNodeAlias b_conv;
41608 b_conv.inner = untag_ptr(b);
41609 b_conv.is_owned = ptr_is_owned(b);
41610 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41611 b_conv.is_owned = false;
41612 jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
41616 int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
41617 LDKNodeAlias obj_conv;
41618 obj_conv.inner = untag_ptr(obj);
41619 obj_conv.is_owned = ptr_is_owned(obj);
41620 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41621 obj_conv.is_owned = false;
41622 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
41623 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41624 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41625 CVec_u8Z_free(ret_var);
41629 uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) {
41630 LDKu8slice ser_ref;
41631 ser_ref.datalen = ser->arr_len;
41632 ser_ref.data = ser->elems;
41633 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
41634 *ret_conv = NodeAlias_read(ser_ref);
41636 return tag_ptr(ret_conv, true);
41639 void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) {
41640 LDKNodeInfo this_obj_conv;
41641 this_obj_conv.inner = untag_ptr(this_obj);
41642 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41644 NodeInfo_free(this_obj_conv);
41647 int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) {
41648 LDKNodeInfo this_ptr_conv;
41649 this_ptr_conv.inner = untag_ptr(this_ptr);
41650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41652 this_ptr_conv.is_owned = false;
41653 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
41654 int64_tArray ret_arr = NULL;
41655 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
41656 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
41657 for (size_t i = 0; i < ret_var.datalen; i++) {
41658 int64_t ret_conv_8_conv = ret_var.data[i];
41659 ret_arr_ptr[i] = ret_conv_8_conv;
41662 FREE(ret_var.data);
41666 void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) {
41667 LDKNodeInfo this_ptr_conv;
41668 this_ptr_conv.inner = untag_ptr(this_ptr);
41669 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41671 this_ptr_conv.is_owned = false;
41672 LDKCVec_u64Z val_constr;
41673 val_constr.datalen = val->arr_len;
41674 if (val_constr.datalen > 0)
41675 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
41677 val_constr.data = NULL;
41678 int64_t* val_vals = val->elems;
41679 for (size_t i = 0; i < val_constr.datalen; i++) {
41680 int64_t val_conv_8 = val_vals[i];
41681 val_constr.data[i] = val_conv_8;
41684 NodeInfo_set_channels(&this_ptr_conv, val_constr);
41687 uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
41688 LDKNodeInfo this_ptr_conv;
41689 this_ptr_conv.inner = untag_ptr(this_ptr);
41690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41692 this_ptr_conv.is_owned = false;
41693 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
41694 uint64_t ret_ref = 0;
41695 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41696 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41700 void __attribute__((export_name("TS_NodeInfo_set_lowest_inbound_channel_fees"))) TS_NodeInfo_set_lowest_inbound_channel_fees(uint64_t this_ptr, uint64_t val) {
41701 LDKNodeInfo this_ptr_conv;
41702 this_ptr_conv.inner = untag_ptr(this_ptr);
41703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41705 this_ptr_conv.is_owned = false;
41706 LDKRoutingFees val_conv;
41707 val_conv.inner = untag_ptr(val);
41708 val_conv.is_owned = ptr_is_owned(val);
41709 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41710 val_conv = RoutingFees_clone(&val_conv);
41711 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
41714 uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
41715 LDKNodeInfo this_ptr_conv;
41716 this_ptr_conv.inner = untag_ptr(this_ptr);
41717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41719 this_ptr_conv.is_owned = false;
41720 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
41721 uint64_t ret_ref = 0;
41722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41727 void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(uint64_t this_ptr, uint64_t val) {
41728 LDKNodeInfo this_ptr_conv;
41729 this_ptr_conv.inner = untag_ptr(this_ptr);
41730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41732 this_ptr_conv.is_owned = false;
41733 LDKNodeAnnouncementInfo val_conv;
41734 val_conv.inner = untag_ptr(val);
41735 val_conv.is_owned = ptr_is_owned(val);
41736 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41737 val_conv = NodeAnnouncementInfo_clone(&val_conv);
41738 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
41741 uint64_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_tArray channels_arg, uint64_t lowest_inbound_channel_fees_arg, uint64_t announcement_info_arg) {
41742 LDKCVec_u64Z channels_arg_constr;
41743 channels_arg_constr.datalen = channels_arg->arr_len;
41744 if (channels_arg_constr.datalen > 0)
41745 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
41747 channels_arg_constr.data = NULL;
41748 int64_t* channels_arg_vals = channels_arg->elems;
41749 for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
41750 int64_t channels_arg_conv_8 = channels_arg_vals[i];
41751 channels_arg_constr.data[i] = channels_arg_conv_8;
41753 FREE(channels_arg);
41754 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
41755 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
41756 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
41757 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
41758 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
41759 LDKNodeAnnouncementInfo announcement_info_arg_conv;
41760 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
41761 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
41762 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
41763 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
41764 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
41765 uint64_t ret_ref = 0;
41766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41771 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
41772 LDKNodeInfo ret_var = NodeInfo_clone(arg);
41773 uint64_t ret_ref = 0;
41774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41778 int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) {
41779 LDKNodeInfo arg_conv;
41780 arg_conv.inner = untag_ptr(arg);
41781 arg_conv.is_owned = ptr_is_owned(arg);
41782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41783 arg_conv.is_owned = false;
41784 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
41788 uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) {
41789 LDKNodeInfo orig_conv;
41790 orig_conv.inner = untag_ptr(orig);
41791 orig_conv.is_owned = ptr_is_owned(orig);
41792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41793 orig_conv.is_owned = false;
41794 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
41795 uint64_t ret_ref = 0;
41796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41801 jboolean __attribute__((export_name("TS_NodeInfo_eq"))) TS_NodeInfo_eq(uint64_t a, uint64_t b) {
41802 LDKNodeInfo a_conv;
41803 a_conv.inner = untag_ptr(a);
41804 a_conv.is_owned = ptr_is_owned(a);
41805 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41806 a_conv.is_owned = false;
41807 LDKNodeInfo b_conv;
41808 b_conv.inner = untag_ptr(b);
41809 b_conv.is_owned = ptr_is_owned(b);
41810 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41811 b_conv.is_owned = false;
41812 jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
41816 int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
41817 LDKNodeInfo obj_conv;
41818 obj_conv.inner = untag_ptr(obj);
41819 obj_conv.is_owned = ptr_is_owned(obj);
41820 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41821 obj_conv.is_owned = false;
41822 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
41823 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41824 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41825 CVec_u8Z_free(ret_var);
41829 uint64_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
41830 LDKu8slice ser_ref;
41831 ser_ref.datalen = ser->arr_len;
41832 ser_ref.data = ser->elems;
41833 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
41834 *ret_conv = NodeInfo_read(ser_ref);
41836 return tag_ptr(ret_conv, true);
41839 int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) {
41840 LDKNetworkGraph obj_conv;
41841 obj_conv.inner = untag_ptr(obj);
41842 obj_conv.is_owned = ptr_is_owned(obj);
41843 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41844 obj_conv.is_owned = false;
41845 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
41846 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41847 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41848 CVec_u8Z_free(ret_var);
41852 uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) {
41853 LDKu8slice ser_ref;
41854 ser_ref.datalen = ser->arr_len;
41855 ser_ref.data = ser->elems;
41856 void* arg_ptr = untag_ptr(arg);
41857 CHECK_ACCESS(arg_ptr);
41858 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
41859 if (arg_conv.free == LDKLogger_JCalls_free) {
41860 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41861 LDKLogger_JCalls_cloned(&arg_conv);
41863 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
41864 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
41866 return tag_ptr(ret_conv, true);
41869 uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
41870 LDKThirtyTwoBytes genesis_hash_ref;
41871 CHECK(genesis_hash->arr_len == 32);
41872 memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
41873 void* logger_ptr = untag_ptr(logger);
41874 CHECK_ACCESS(logger_ptr);
41875 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41876 if (logger_conv.free == LDKLogger_JCalls_free) {
41877 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41878 LDKLogger_JCalls_cloned(&logger_conv);
41880 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
41881 uint64_t ret_ref = 0;
41882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41887 uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) {
41888 LDKNetworkGraph this_arg_conv;
41889 this_arg_conv.inner = untag_ptr(this_arg);
41890 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41892 this_arg_conv.is_owned = false;
41893 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
41894 uint64_t ret_ref = 0;
41895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41900 uint64_t __attribute__((export_name("TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp(uint64_t this_arg) {
41901 LDKNetworkGraph this_arg_conv;
41902 this_arg_conv.inner = untag_ptr(this_arg);
41903 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41905 this_arg_conv.is_owned = false;
41906 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
41907 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
41908 uint64_t ret_ref = tag_ptr(ret_copy, true);
41912 void __attribute__((export_name("TS_NetworkGraph_set_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_set_last_rapid_gossip_sync_timestamp(uint64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) {
41913 LDKNetworkGraph this_arg_conv;
41914 this_arg_conv.inner = untag_ptr(this_arg);
41915 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41917 this_arg_conv.is_owned = false;
41918 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
41921 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) {
41922 LDKNetworkGraph this_arg_conv;
41923 this_arg_conv.inner = untag_ptr(this_arg);
41924 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41926 this_arg_conv.is_owned = false;
41927 LDKNodeAnnouncement msg_conv;
41928 msg_conv.inner = untag_ptr(msg);
41929 msg_conv.is_owned = ptr_is_owned(msg);
41930 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41931 msg_conv.is_owned = false;
41932 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
41933 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
41934 return tag_ptr(ret_conv, true);
41937 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_announcement"))) TS_NetworkGraph_update_node_from_unsigned_announcement(uint64_t this_arg, uint64_t msg) {
41938 LDKNetworkGraph this_arg_conv;
41939 this_arg_conv.inner = untag_ptr(this_arg);
41940 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41942 this_arg_conv.is_owned = false;
41943 LDKUnsignedNodeAnnouncement msg_conv;
41944 msg_conv.inner = untag_ptr(msg);
41945 msg_conv.is_owned = ptr_is_owned(msg);
41946 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41947 msg_conv.is_owned = false;
41948 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
41949 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
41950 return tag_ptr(ret_conv, true);
41953 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announcement"))) TS_NetworkGraph_update_channel_from_announcement(uint64_t this_arg, uint64_t msg, uint64_t chain_access) {
41954 LDKNetworkGraph this_arg_conv;
41955 this_arg_conv.inner = untag_ptr(this_arg);
41956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41958 this_arg_conv.is_owned = false;
41959 LDKChannelAnnouncement msg_conv;
41960 msg_conv.inner = untag_ptr(msg);
41961 msg_conv.is_owned = ptr_is_owned(msg);
41962 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41963 msg_conv.is_owned = false;
41964 void* chain_access_ptr = untag_ptr(chain_access);
41965 CHECK_ACCESS(chain_access_ptr);
41966 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
41967 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
41968 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
41969 // Manually implement clone for Java trait instances
41970 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
41971 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41972 LDKAccess_JCalls_cloned(&chain_access_conv.some);
41975 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
41976 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
41977 return tag_ptr(ret_conv, true);
41980 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsigned_announcement"))) TS_NetworkGraph_update_channel_from_unsigned_announcement(uint64_t this_arg, uint64_t msg, uint64_t chain_access) {
41981 LDKNetworkGraph this_arg_conv;
41982 this_arg_conv.inner = untag_ptr(this_arg);
41983 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41985 this_arg_conv.is_owned = false;
41986 LDKUnsignedChannelAnnouncement msg_conv;
41987 msg_conv.inner = untag_ptr(msg);
41988 msg_conv.is_owned = ptr_is_owned(msg);
41989 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41990 msg_conv.is_owned = false;
41991 void* chain_access_ptr = untag_ptr(chain_access);
41992 CHECK_ACCESS(chain_access_ptr);
41993 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
41994 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
41995 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
41996 // Manually implement clone for Java trait instances
41997 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
41998 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41999 LDKAccess_JCalls_cloned(&chain_access_conv.some);
42002 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42003 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
42004 return tag_ptr(ret_conv, true);
42007 uint64_t __attribute__((export_name("TS_NetworkGraph_add_channel_from_partial_announcement"))) TS_NetworkGraph_add_channel_from_partial_announcement(uint64_t this_arg, int64_t short_channel_id, int64_t timestamp, uint64_t features, int8_tArray node_id_1, int8_tArray node_id_2) {
42008 LDKNetworkGraph 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 LDKChannelFeatures features_conv;
42014 features_conv.inner = untag_ptr(features);
42015 features_conv.is_owned = ptr_is_owned(features);
42016 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
42017 features_conv = ChannelFeatures_clone(&features_conv);
42018 LDKPublicKey node_id_1_ref;
42019 CHECK(node_id_1->arr_len == 33);
42020 memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1);
42021 LDKPublicKey node_id_2_ref;
42022 CHECK(node_id_2->arr_len == 33);
42023 memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2);
42024 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42025 *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);
42026 return tag_ptr(ret_conv, true);
42029 void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
42030 LDKNetworkGraph this_arg_conv;
42031 this_arg_conv.inner = untag_ptr(this_arg);
42032 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42034 this_arg_conv.is_owned = false;
42035 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
42038 void __attribute__((export_name("TS_NetworkGraph_node_failed_permanent"))) TS_NetworkGraph_node_failed_permanent(uint64_t this_arg, int8_tArray node_id) {
42039 LDKNetworkGraph this_arg_conv;
42040 this_arg_conv.inner = untag_ptr(this_arg);
42041 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42043 this_arg_conv.is_owned = false;
42044 LDKPublicKey node_id_ref;
42045 CHECK(node_id->arr_len == 33);
42046 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
42047 NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
42050 void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_and_tracking_with_time"))) TS_NetworkGraph_remove_stale_channels_and_tracking_with_time(uint64_t this_arg, int64_t current_time_unix) {
42051 LDKNetworkGraph this_arg_conv;
42052 this_arg_conv.inner = untag_ptr(this_arg);
42053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42055 this_arg_conv.is_owned = false;
42056 NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
42059 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
42060 LDKNetworkGraph this_arg_conv;
42061 this_arg_conv.inner = untag_ptr(this_arg);
42062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42064 this_arg_conv.is_owned = false;
42065 LDKChannelUpdate msg_conv;
42066 msg_conv.inner = untag_ptr(msg);
42067 msg_conv.is_owned = ptr_is_owned(msg);
42068 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42069 msg_conv.is_owned = false;
42070 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42071 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
42072 return tag_ptr(ret_conv, true);
42075 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) {
42076 LDKNetworkGraph this_arg_conv;
42077 this_arg_conv.inner = untag_ptr(this_arg);
42078 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42080 this_arg_conv.is_owned = false;
42081 LDKUnsignedChannelUpdate msg_conv;
42082 msg_conv.inner = untag_ptr(msg);
42083 msg_conv.is_owned = ptr_is_owned(msg);
42084 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42085 msg_conv.is_owned = false;
42086 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42087 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
42088 return tag_ptr(ret_conv, true);
42091 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) {
42092 LDKReadOnlyNetworkGraph this_arg_conv;
42093 this_arg_conv.inner = untag_ptr(this_arg);
42094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42096 this_arg_conv.is_owned = false;
42097 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
42098 uint64_t ret_ref = 0;
42099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42104 int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) {
42105 LDKReadOnlyNetworkGraph this_arg_conv;
42106 this_arg_conv.inner = untag_ptr(this_arg);
42107 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42109 this_arg_conv.is_owned = false;
42110 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
42111 int64_tArray ret_arr = NULL;
42112 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
42113 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
42114 for (size_t i = 0; i < ret_var.datalen; i++) {
42115 int64_t ret_conv_8_conv = ret_var.data[i];
42116 ret_arr_ptr[i] = ret_conv_8_conv;
42119 FREE(ret_var.data);
42123 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) {
42124 LDKReadOnlyNetworkGraph this_arg_conv;
42125 this_arg_conv.inner = untag_ptr(this_arg);
42126 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42128 this_arg_conv.is_owned = false;
42129 LDKNodeId node_id_conv;
42130 node_id_conv.inner = untag_ptr(node_id);
42131 node_id_conv.is_owned = ptr_is_owned(node_id);
42132 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
42133 node_id_conv.is_owned = false;
42134 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
42135 uint64_t ret_ref = 0;
42136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42141 uint64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) {
42142 LDKReadOnlyNetworkGraph this_arg_conv;
42143 this_arg_conv.inner = untag_ptr(this_arg);
42144 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42146 this_arg_conv.is_owned = false;
42147 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
42148 uint64_tArray ret_arr = NULL;
42149 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
42150 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
42151 for (size_t i = 0; i < ret_var.datalen; i++) {
42152 LDKNodeId ret_conv_8_var = ret_var.data[i];
42153 uint64_t ret_conv_8_ref = 0;
42154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
42155 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
42156 ret_arr_ptr[i] = ret_conv_8_ref;
42159 FREE(ret_var.data);
42163 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) {
42164 LDKReadOnlyNetworkGraph this_arg_conv;
42165 this_arg_conv.inner = untag_ptr(this_arg);
42166 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42168 this_arg_conv.is_owned = false;
42169 LDKPublicKey pubkey_ref;
42170 CHECK(pubkey->arr_len == 33);
42171 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
42172 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
42173 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
42174 uint64_t ret_ref = tag_ptr(ret_copy, true);
42178 void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
42179 LDKRouteHop this_obj_conv;
42180 this_obj_conv.inner = untag_ptr(this_obj);
42181 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42183 RouteHop_free(this_obj_conv);
42186 int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) {
42187 LDKRouteHop this_ptr_conv;
42188 this_ptr_conv.inner = untag_ptr(this_ptr);
42189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42191 this_ptr_conv.is_owned = false;
42192 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42193 memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
42197 void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) {
42198 LDKRouteHop this_ptr_conv;
42199 this_ptr_conv.inner = untag_ptr(this_ptr);
42200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42202 this_ptr_conv.is_owned = false;
42203 LDKPublicKey val_ref;
42204 CHECK(val->arr_len == 33);
42205 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42206 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
42209 uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) {
42210 LDKRouteHop this_ptr_conv;
42211 this_ptr_conv.inner = untag_ptr(this_ptr);
42212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42214 this_ptr_conv.is_owned = false;
42215 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
42216 uint64_t ret_ref = 0;
42217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42222 void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) {
42223 LDKRouteHop this_ptr_conv;
42224 this_ptr_conv.inner = untag_ptr(this_ptr);
42225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42227 this_ptr_conv.is_owned = false;
42228 LDKNodeFeatures val_conv;
42229 val_conv.inner = untag_ptr(val);
42230 val_conv.is_owned = ptr_is_owned(val);
42231 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42232 val_conv = NodeFeatures_clone(&val_conv);
42233 RouteHop_set_node_features(&this_ptr_conv, val_conv);
42236 int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) {
42237 LDKRouteHop this_ptr_conv;
42238 this_ptr_conv.inner = untag_ptr(this_ptr);
42239 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42241 this_ptr_conv.is_owned = false;
42242 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
42246 void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
42247 LDKRouteHop this_ptr_conv;
42248 this_ptr_conv.inner = untag_ptr(this_ptr);
42249 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42251 this_ptr_conv.is_owned = false;
42252 RouteHop_set_short_channel_id(&this_ptr_conv, val);
42255 uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) {
42256 LDKRouteHop this_ptr_conv;
42257 this_ptr_conv.inner = untag_ptr(this_ptr);
42258 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42260 this_ptr_conv.is_owned = false;
42261 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
42262 uint64_t ret_ref = 0;
42263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42268 void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) {
42269 LDKRouteHop this_ptr_conv;
42270 this_ptr_conv.inner = untag_ptr(this_ptr);
42271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42273 this_ptr_conv.is_owned = false;
42274 LDKChannelFeatures val_conv;
42275 val_conv.inner = untag_ptr(val);
42276 val_conv.is_owned = ptr_is_owned(val);
42277 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42278 val_conv = ChannelFeatures_clone(&val_conv);
42279 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
42282 int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) {
42283 LDKRouteHop this_ptr_conv;
42284 this_ptr_conv.inner = untag_ptr(this_ptr);
42285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42287 this_ptr_conv.is_owned = false;
42288 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
42292 void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) {
42293 LDKRouteHop this_ptr_conv;
42294 this_ptr_conv.inner = untag_ptr(this_ptr);
42295 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42297 this_ptr_conv.is_owned = false;
42298 RouteHop_set_fee_msat(&this_ptr_conv, val);
42301 int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) {
42302 LDKRouteHop this_ptr_conv;
42303 this_ptr_conv.inner = untag_ptr(this_ptr);
42304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42306 this_ptr_conv.is_owned = false;
42307 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
42311 void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
42312 LDKRouteHop this_ptr_conv;
42313 this_ptr_conv.inner = untag_ptr(this_ptr);
42314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42316 this_ptr_conv.is_owned = false;
42317 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
42320 uint64_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_tArray pubkey_arg, uint64_t node_features_arg, int64_t short_channel_id_arg, uint64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) {
42321 LDKPublicKey pubkey_arg_ref;
42322 CHECK(pubkey_arg->arr_len == 33);
42323 memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg);
42324 LDKNodeFeatures node_features_arg_conv;
42325 node_features_arg_conv.inner = untag_ptr(node_features_arg);
42326 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
42327 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
42328 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
42329 LDKChannelFeatures channel_features_arg_conv;
42330 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
42331 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
42332 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
42333 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
42334 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);
42335 uint64_t ret_ref = 0;
42336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42341 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
42342 LDKRouteHop ret_var = RouteHop_clone(arg);
42343 uint64_t ret_ref = 0;
42344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42348 int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) {
42349 LDKRouteHop arg_conv;
42350 arg_conv.inner = untag_ptr(arg);
42351 arg_conv.is_owned = ptr_is_owned(arg);
42352 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42353 arg_conv.is_owned = false;
42354 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
42358 uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) {
42359 LDKRouteHop orig_conv;
42360 orig_conv.inner = untag_ptr(orig);
42361 orig_conv.is_owned = ptr_is_owned(orig);
42362 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42363 orig_conv.is_owned = false;
42364 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
42365 uint64_t ret_ref = 0;
42366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42371 int64_t __attribute__((export_name("TS_RouteHop_hash"))) TS_RouteHop_hash(uint64_t o) {
42372 LDKRouteHop o_conv;
42373 o_conv.inner = untag_ptr(o);
42374 o_conv.is_owned = ptr_is_owned(o);
42375 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42376 o_conv.is_owned = false;
42377 int64_t ret_conv = RouteHop_hash(&o_conv);
42381 jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) {
42382 LDKRouteHop a_conv;
42383 a_conv.inner = untag_ptr(a);
42384 a_conv.is_owned = ptr_is_owned(a);
42385 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42386 a_conv.is_owned = false;
42387 LDKRouteHop b_conv;
42388 b_conv.inner = untag_ptr(b);
42389 b_conv.is_owned = ptr_is_owned(b);
42390 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42391 b_conv.is_owned = false;
42392 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
42396 int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) {
42397 LDKRouteHop obj_conv;
42398 obj_conv.inner = untag_ptr(obj);
42399 obj_conv.is_owned = ptr_is_owned(obj);
42400 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42401 obj_conv.is_owned = false;
42402 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
42403 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42404 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42405 CVec_u8Z_free(ret_var);
42409 uint64_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
42410 LDKu8slice ser_ref;
42411 ser_ref.datalen = ser->arr_len;
42412 ser_ref.data = ser->elems;
42413 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
42414 *ret_conv = RouteHop_read(ser_ref);
42416 return tag_ptr(ret_conv, true);
42419 void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) {
42420 LDKRoute this_obj_conv;
42421 this_obj_conv.inner = untag_ptr(this_obj);
42422 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42424 Route_free(this_obj_conv);
42427 ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) {
42428 LDKRoute this_ptr_conv;
42429 this_ptr_conv.inner = untag_ptr(this_ptr);
42430 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42432 this_ptr_conv.is_owned = false;
42433 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
42434 ptrArray ret_arr = NULL;
42435 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
42436 uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8);
42437 for (size_t m = 0; m < ret_var.datalen; m++) {
42438 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
42439 uint64_tArray ret_conv_12_arr = NULL;
42440 ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__);
42441 uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8);
42442 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
42443 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
42444 uint64_t ret_conv_12_conv_10_ref = 0;
42445 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
42446 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
42447 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
42450 FREE(ret_conv_12_var.data);
42451 ret_arr_ptr[m] = ret_conv_12_arr;
42454 FREE(ret_var.data);
42458 void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) {
42459 LDKRoute this_ptr_conv;
42460 this_ptr_conv.inner = untag_ptr(this_ptr);
42461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42463 this_ptr_conv.is_owned = false;
42464 LDKCVec_CVec_RouteHopZZ val_constr;
42465 val_constr.datalen = val->arr_len;
42466 if (val_constr.datalen > 0)
42467 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
42469 val_constr.data = NULL;
42470 uint64_tArray* val_vals = (void*) val->elems;
42471 for (size_t m = 0; m < val_constr.datalen; m++) {
42472 uint64_tArray val_conv_12 = val_vals[m];
42473 LDKCVec_RouteHopZ val_conv_12_constr;
42474 val_conv_12_constr.datalen = val_conv_12->arr_len;
42475 if (val_conv_12_constr.datalen > 0)
42476 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
42478 val_conv_12_constr.data = NULL;
42479 uint64_t* val_conv_12_vals = val_conv_12->elems;
42480 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
42481 uint64_t val_conv_12_conv_10 = val_conv_12_vals[k];
42482 LDKRouteHop val_conv_12_conv_10_conv;
42483 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
42484 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
42485 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
42486 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
42487 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
42490 val_constr.data[m] = val_conv_12_constr;
42493 Route_set_paths(&this_ptr_conv, val_constr);
42496 uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) {
42497 LDKRoute this_ptr_conv;
42498 this_ptr_conv.inner = untag_ptr(this_ptr);
42499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42501 this_ptr_conv.is_owned = false;
42502 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
42503 uint64_t ret_ref = 0;
42504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42509 void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) {
42510 LDKRoute this_ptr_conv;
42511 this_ptr_conv.inner = untag_ptr(this_ptr);
42512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42514 this_ptr_conv.is_owned = false;
42515 LDKPaymentParameters val_conv;
42516 val_conv.inner = untag_ptr(val);
42517 val_conv.is_owned = ptr_is_owned(val);
42518 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42519 val_conv = PaymentParameters_clone(&val_conv);
42520 Route_set_payment_params(&this_ptr_conv, val_conv);
42523 uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) {
42524 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
42525 paths_arg_constr.datalen = paths_arg->arr_len;
42526 if (paths_arg_constr.datalen > 0)
42527 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
42529 paths_arg_constr.data = NULL;
42530 uint64_tArray* paths_arg_vals = (void*) paths_arg->elems;
42531 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
42532 uint64_tArray paths_arg_conv_12 = paths_arg_vals[m];
42533 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
42534 paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len;
42535 if (paths_arg_conv_12_constr.datalen > 0)
42536 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
42538 paths_arg_conv_12_constr.data = NULL;
42539 uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
42540 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
42541 uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
42542 LDKRouteHop paths_arg_conv_12_conv_10_conv;
42543 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
42544 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
42545 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
42546 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
42547 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
42549 FREE(paths_arg_conv_12);
42550 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
42553 LDKPaymentParameters payment_params_arg_conv;
42554 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
42555 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
42556 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
42557 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
42558 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
42559 uint64_t ret_ref = 0;
42560 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42561 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42565 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
42566 LDKRoute ret_var = Route_clone(arg);
42567 uint64_t ret_ref = 0;
42568 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42569 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42572 int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) {
42574 arg_conv.inner = untag_ptr(arg);
42575 arg_conv.is_owned = ptr_is_owned(arg);
42576 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42577 arg_conv.is_owned = false;
42578 int64_t ret_conv = Route_clone_ptr(&arg_conv);
42582 uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) {
42583 LDKRoute orig_conv;
42584 orig_conv.inner = untag_ptr(orig);
42585 orig_conv.is_owned = ptr_is_owned(orig);
42586 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42587 orig_conv.is_owned = false;
42588 LDKRoute ret_var = Route_clone(&orig_conv);
42589 uint64_t ret_ref = 0;
42590 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42591 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42595 int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(uint64_t o) {
42597 o_conv.inner = untag_ptr(o);
42598 o_conv.is_owned = ptr_is_owned(o);
42599 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42600 o_conv.is_owned = false;
42601 int64_t ret_conv = Route_hash(&o_conv);
42605 jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) {
42607 a_conv.inner = untag_ptr(a);
42608 a_conv.is_owned = ptr_is_owned(a);
42609 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42610 a_conv.is_owned = false;
42612 b_conv.inner = untag_ptr(b);
42613 b_conv.is_owned = ptr_is_owned(b);
42614 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42615 b_conv.is_owned = false;
42616 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
42620 int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) {
42621 LDKRoute this_arg_conv;
42622 this_arg_conv.inner = untag_ptr(this_arg);
42623 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42625 this_arg_conv.is_owned = false;
42626 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
42630 int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) {
42631 LDKRoute this_arg_conv;
42632 this_arg_conv.inner = untag_ptr(this_arg);
42633 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42635 this_arg_conv.is_owned = false;
42636 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
42640 int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) {
42642 obj_conv.inner = untag_ptr(obj);
42643 obj_conv.is_owned = ptr_is_owned(obj);
42644 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42645 obj_conv.is_owned = false;
42646 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
42647 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42648 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42649 CVec_u8Z_free(ret_var);
42653 uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
42654 LDKu8slice ser_ref;
42655 ser_ref.datalen = ser->arr_len;
42656 ser_ref.data = ser->elems;
42657 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
42658 *ret_conv = Route_read(ser_ref);
42660 return tag_ptr(ret_conv, true);
42663 void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) {
42664 LDKRouteParameters this_obj_conv;
42665 this_obj_conv.inner = untag_ptr(this_obj);
42666 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42668 RouteParameters_free(this_obj_conv);
42671 uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(uint64_t this_ptr) {
42672 LDKRouteParameters this_ptr_conv;
42673 this_ptr_conv.inner = untag_ptr(this_ptr);
42674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42676 this_ptr_conv.is_owned = false;
42677 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
42678 uint64_t ret_ref = 0;
42679 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42680 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42684 void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_t val) {
42685 LDKRouteParameters this_ptr_conv;
42686 this_ptr_conv.inner = untag_ptr(this_ptr);
42687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42689 this_ptr_conv.is_owned = false;
42690 LDKPaymentParameters val_conv;
42691 val_conv.inner = untag_ptr(val);
42692 val_conv.is_owned = ptr_is_owned(val);
42693 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42694 val_conv = PaymentParameters_clone(&val_conv);
42695 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
42698 int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(uint64_t this_ptr) {
42699 LDKRouteParameters this_ptr_conv;
42700 this_ptr_conv.inner = untag_ptr(this_ptr);
42701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42703 this_ptr_conv.is_owned = false;
42704 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
42708 void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_t val) {
42709 LDKRouteParameters this_ptr_conv;
42710 this_ptr_conv.inner = untag_ptr(this_ptr);
42711 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42713 this_ptr_conv.is_owned = false;
42714 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
42717 int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
42718 LDKRouteParameters this_ptr_conv;
42719 this_ptr_conv.inner = untag_ptr(this_ptr);
42720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42722 this_ptr_conv.is_owned = false;
42723 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
42727 void __attribute__((export_name("TS_RouteParameters_set_final_cltv_expiry_delta"))) TS_RouteParameters_set_final_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
42728 LDKRouteParameters this_ptr_conv;
42729 this_ptr_conv.inner = untag_ptr(this_ptr);
42730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42732 this_ptr_conv.is_owned = false;
42733 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
42736 uint64_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParameters_new(uint64_t payment_params_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
42737 LDKPaymentParameters payment_params_arg_conv;
42738 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
42739 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
42740 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
42741 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
42742 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
42743 uint64_t ret_ref = 0;
42744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42749 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
42750 LDKRouteParameters ret_var = RouteParameters_clone(arg);
42751 uint64_t ret_ref = 0;
42752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42756 int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) {
42757 LDKRouteParameters arg_conv;
42758 arg_conv.inner = untag_ptr(arg);
42759 arg_conv.is_owned = ptr_is_owned(arg);
42760 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42761 arg_conv.is_owned = false;
42762 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
42766 uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) {
42767 LDKRouteParameters orig_conv;
42768 orig_conv.inner = untag_ptr(orig);
42769 orig_conv.is_owned = ptr_is_owned(orig);
42770 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42771 orig_conv.is_owned = false;
42772 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
42773 uint64_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);
42779 int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
42780 LDKRouteParameters obj_conv;
42781 obj_conv.inner = untag_ptr(obj);
42782 obj_conv.is_owned = ptr_is_owned(obj);
42783 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42784 obj_conv.is_owned = false;
42785 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
42786 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42787 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42788 CVec_u8Z_free(ret_var);
42792 uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
42793 LDKu8slice ser_ref;
42794 ser_ref.datalen = ser->arr_len;
42795 ser_ref.data = ser->elems;
42796 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
42797 *ret_conv = RouteParameters_read(ser_ref);
42799 return tag_ptr(ret_conv, true);
42802 void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) {
42803 LDKPaymentParameters this_obj_conv;
42804 this_obj_conv.inner = untag_ptr(this_obj);
42805 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42807 PaymentParameters_free(this_obj_conv);
42810 int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(uint64_t this_ptr) {
42811 LDKPaymentParameters this_ptr_conv;
42812 this_ptr_conv.inner = untag_ptr(this_ptr);
42813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42815 this_ptr_conv.is_owned = false;
42816 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42817 memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33);
42821 void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray val) {
42822 LDKPaymentParameters this_ptr_conv;
42823 this_ptr_conv.inner = untag_ptr(this_ptr);
42824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42826 this_ptr_conv.is_owned = false;
42827 LDKPublicKey val_ref;
42828 CHECK(val->arr_len == 33);
42829 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42830 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
42833 uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(uint64_t this_ptr) {
42834 LDKPaymentParameters this_ptr_conv;
42835 this_ptr_conv.inner = untag_ptr(this_ptr);
42836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42838 this_ptr_conv.is_owned = false;
42839 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
42840 uint64_t ret_ref = 0;
42841 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42842 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42846 void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_t val) {
42847 LDKPaymentParameters this_ptr_conv;
42848 this_ptr_conv.inner = untag_ptr(this_ptr);
42849 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42851 this_ptr_conv.is_owned = false;
42852 LDKInvoiceFeatures val_conv;
42853 val_conv.inner = untag_ptr(val);
42854 val_conv.is_owned = ptr_is_owned(val);
42855 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42856 val_conv = InvoiceFeatures_clone(&val_conv);
42857 PaymentParameters_set_features(&this_ptr_conv, val_conv);
42860 uint64_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(uint64_t this_ptr) {
42861 LDKPaymentParameters this_ptr_conv;
42862 this_ptr_conv.inner = untag_ptr(this_ptr);
42863 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42865 this_ptr_conv.is_owned = false;
42866 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
42867 uint64_tArray ret_arr = NULL;
42868 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
42869 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
42870 for (size_t l = 0; l < ret_var.datalen; l++) {
42871 LDKRouteHint ret_conv_11_var = ret_var.data[l];
42872 uint64_t ret_conv_11_ref = 0;
42873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
42874 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
42875 ret_arr_ptr[l] = ret_conv_11_ref;
42878 FREE(ret_var.data);
42882 void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray val) {
42883 LDKPaymentParameters this_ptr_conv;
42884 this_ptr_conv.inner = untag_ptr(this_ptr);
42885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42887 this_ptr_conv.is_owned = false;
42888 LDKCVec_RouteHintZ val_constr;
42889 val_constr.datalen = val->arr_len;
42890 if (val_constr.datalen > 0)
42891 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
42893 val_constr.data = NULL;
42894 uint64_t* val_vals = val->elems;
42895 for (size_t l = 0; l < val_constr.datalen; l++) {
42896 uint64_t val_conv_11 = val_vals[l];
42897 LDKRouteHint val_conv_11_conv;
42898 val_conv_11_conv.inner = untag_ptr(val_conv_11);
42899 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
42900 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
42901 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
42902 val_constr.data[l] = val_conv_11_conv;
42905 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
42908 uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(uint64_t this_ptr) {
42909 LDKPaymentParameters this_ptr_conv;
42910 this_ptr_conv.inner = untag_ptr(this_ptr);
42911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42913 this_ptr_conv.is_owned = false;
42914 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
42915 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
42916 uint64_t ret_ref = tag_ptr(ret_copy, true);
42920 void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_t val) {
42921 LDKPaymentParameters this_ptr_conv;
42922 this_ptr_conv.inner = untag_ptr(this_ptr);
42923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42925 this_ptr_conv.is_owned = false;
42926 void* val_ptr = untag_ptr(val);
42927 CHECK_ACCESS(val_ptr);
42928 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
42929 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
42930 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
42933 int32_t __attribute__((export_name("TS_PaymentParameters_get_max_total_cltv_expiry_delta"))) TS_PaymentParameters_get_max_total_cltv_expiry_delta(uint64_t this_ptr) {
42934 LDKPaymentParameters this_ptr_conv;
42935 this_ptr_conv.inner = untag_ptr(this_ptr);
42936 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42938 this_ptr_conv.is_owned = false;
42939 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
42943 void __attribute__((export_name("TS_PaymentParameters_set_max_total_cltv_expiry_delta"))) TS_PaymentParameters_set_max_total_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
42944 LDKPaymentParameters 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 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
42952 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(uint64_t this_ptr) {
42953 LDKPaymentParameters this_ptr_conv;
42954 this_ptr_conv.inner = untag_ptr(this_ptr);
42955 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42956 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42957 this_ptr_conv.is_owned = false;
42958 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
42962 void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_t val) {
42963 LDKPaymentParameters 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 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
42971 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_channel_saturation_power_of_half"))) TS_PaymentParameters_get_max_channel_saturation_power_of_half(uint64_t this_ptr) {
42972 LDKPaymentParameters this_ptr_conv;
42973 this_ptr_conv.inner = untag_ptr(this_ptr);
42974 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42975 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42976 this_ptr_conv.is_owned = false;
42977 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
42981 void __attribute__((export_name("TS_PaymentParameters_set_max_channel_saturation_power_of_half"))) TS_PaymentParameters_set_max_channel_saturation_power_of_half(uint64_t this_ptr, int8_t val) {
42982 LDKPaymentParameters this_ptr_conv;
42983 this_ptr_conv.inner = untag_ptr(this_ptr);
42984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42986 this_ptr_conv.is_owned = false;
42987 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
42990 int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(uint64_t this_ptr) {
42991 LDKPaymentParameters this_ptr_conv;
42992 this_ptr_conv.inner = untag_ptr(this_ptr);
42993 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42995 this_ptr_conv.is_owned = false;
42996 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
42997 int64_tArray ret_arr = NULL;
42998 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
42999 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
43000 for (size_t i = 0; i < ret_var.datalen; i++) {
43001 int64_t ret_conv_8_conv = ret_var.data[i];
43002 ret_arr_ptr[i] = ret_conv_8_conv;
43005 FREE(ret_var.data);
43009 void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray val) {
43010 LDKPaymentParameters this_ptr_conv;
43011 this_ptr_conv.inner = untag_ptr(this_ptr);
43012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43014 this_ptr_conv.is_owned = false;
43015 LDKCVec_u64Z val_constr;
43016 val_constr.datalen = val->arr_len;
43017 if (val_constr.datalen > 0)
43018 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
43020 val_constr.data = NULL;
43021 int64_t* val_vals = val->elems;
43022 for (size_t i = 0; i < val_constr.datalen; i++) {
43023 int64_t val_conv_8 = val_vals[i];
43024 val_constr.data[i] = val_conv_8;
43027 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
43030 uint64_t __attribute__((export_name("TS_PaymentParameters_new"))) TS_PaymentParameters_new(int8_tArray payee_pubkey_arg, uint64_t features_arg, uint64_tArray route_hints_arg, uint64_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) {
43031 LDKPublicKey payee_pubkey_arg_ref;
43032 CHECK(payee_pubkey_arg->arr_len == 33);
43033 memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
43034 LDKInvoiceFeatures features_arg_conv;
43035 features_arg_conv.inner = untag_ptr(features_arg);
43036 features_arg_conv.is_owned = ptr_is_owned(features_arg);
43037 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
43038 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
43039 LDKCVec_RouteHintZ route_hints_arg_constr;
43040 route_hints_arg_constr.datalen = route_hints_arg->arr_len;
43041 if (route_hints_arg_constr.datalen > 0)
43042 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
43044 route_hints_arg_constr.data = NULL;
43045 uint64_t* route_hints_arg_vals = route_hints_arg->elems;
43046 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
43047 uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
43048 LDKRouteHint route_hints_arg_conv_11_conv;
43049 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
43050 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
43051 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
43052 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
43053 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
43055 FREE(route_hints_arg);
43056 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
43057 CHECK_ACCESS(expiry_time_arg_ptr);
43058 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
43059 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
43060 LDKCVec_u64Z previously_failed_channels_arg_constr;
43061 previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len;
43062 if (previously_failed_channels_arg_constr.datalen > 0)
43063 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
43065 previously_failed_channels_arg_constr.data = NULL;
43066 int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems;
43067 for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) {
43068 int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i];
43069 previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
43071 FREE(previously_failed_channels_arg);
43072 LDKPaymentParameters ret_var = PaymentParameters_new(payee_pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr);
43073 uint64_t ret_ref = 0;
43074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43079 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
43080 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
43081 uint64_t ret_ref = 0;
43082 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43083 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43086 int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) {
43087 LDKPaymentParameters arg_conv;
43088 arg_conv.inner = untag_ptr(arg);
43089 arg_conv.is_owned = ptr_is_owned(arg);
43090 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43091 arg_conv.is_owned = false;
43092 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
43096 uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) {
43097 LDKPaymentParameters orig_conv;
43098 orig_conv.inner = untag_ptr(orig);
43099 orig_conv.is_owned = ptr_is_owned(orig);
43100 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43101 orig_conv.is_owned = false;
43102 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
43103 uint64_t ret_ref = 0;
43104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43109 int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) {
43110 LDKPaymentParameters o_conv;
43111 o_conv.inner = untag_ptr(o);
43112 o_conv.is_owned = ptr_is_owned(o);
43113 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43114 o_conv.is_owned = false;
43115 int64_t ret_conv = PaymentParameters_hash(&o_conv);
43119 jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) {
43120 LDKPaymentParameters a_conv;
43121 a_conv.inner = untag_ptr(a);
43122 a_conv.is_owned = ptr_is_owned(a);
43123 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43124 a_conv.is_owned = false;
43125 LDKPaymentParameters b_conv;
43126 b_conv.inner = untag_ptr(b);
43127 b_conv.is_owned = ptr_is_owned(b);
43128 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43129 b_conv.is_owned = false;
43130 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
43134 int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) {
43135 LDKPaymentParameters obj_conv;
43136 obj_conv.inner = untag_ptr(obj);
43137 obj_conv.is_owned = ptr_is_owned(obj);
43138 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43139 obj_conv.is_owned = false;
43140 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
43141 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43142 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43143 CVec_u8Z_free(ret_var);
43147 uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
43148 LDKu8slice ser_ref;
43149 ser_ref.datalen = ser->arr_len;
43150 ser_ref.data = ser->elems;
43151 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
43152 *ret_conv = PaymentParameters_read(ser_ref);
43154 return tag_ptr(ret_conv, true);
43157 uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
43158 LDKPublicKey payee_pubkey_ref;
43159 CHECK(payee_pubkey->arr_len == 33);
43160 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
43161 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
43162 uint64_t ret_ref = 0;
43163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43168 uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
43169 LDKPublicKey payee_pubkey_ref;
43170 CHECK(payee_pubkey->arr_len == 33);
43171 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
43172 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
43173 uint64_t ret_ref = 0;
43174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43179 void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) {
43180 LDKRouteHint this_obj_conv;
43181 this_obj_conv.inner = untag_ptr(this_obj);
43182 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43184 RouteHint_free(this_obj_conv);
43187 uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) {
43188 LDKRouteHint this_ptr_conv;
43189 this_ptr_conv.inner = untag_ptr(this_ptr);
43190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43192 this_ptr_conv.is_owned = false;
43193 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
43194 uint64_tArray ret_arr = NULL;
43195 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43196 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43197 for (size_t o = 0; o < ret_var.datalen; o++) {
43198 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
43199 uint64_t ret_conv_14_ref = 0;
43200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43201 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43202 ret_arr_ptr[o] = ret_conv_14_ref;
43205 FREE(ret_var.data);
43209 void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) {
43210 LDKRouteHint this_ptr_conv;
43211 this_ptr_conv.inner = untag_ptr(this_ptr);
43212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43214 this_ptr_conv.is_owned = false;
43215 LDKCVec_RouteHintHopZ val_constr;
43216 val_constr.datalen = val->arr_len;
43217 if (val_constr.datalen > 0)
43218 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
43220 val_constr.data = NULL;
43221 uint64_t* val_vals = val->elems;
43222 for (size_t o = 0; o < val_constr.datalen; o++) {
43223 uint64_t val_conv_14 = val_vals[o];
43224 LDKRouteHintHop val_conv_14_conv;
43225 val_conv_14_conv.inner = untag_ptr(val_conv_14);
43226 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
43227 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
43228 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
43229 val_constr.data[o] = val_conv_14_conv;
43232 RouteHint_set_a(&this_ptr_conv, val_constr);
43235 uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) {
43236 LDKCVec_RouteHintHopZ a_arg_constr;
43237 a_arg_constr.datalen = a_arg->arr_len;
43238 if (a_arg_constr.datalen > 0)
43239 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
43241 a_arg_constr.data = NULL;
43242 uint64_t* a_arg_vals = a_arg->elems;
43243 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
43244 uint64_t a_arg_conv_14 = a_arg_vals[o];
43245 LDKRouteHintHop a_arg_conv_14_conv;
43246 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
43247 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
43248 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
43249 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
43250 a_arg_constr.data[o] = a_arg_conv_14_conv;
43253 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
43254 uint64_t ret_ref = 0;
43255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43260 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
43261 LDKRouteHint ret_var = RouteHint_clone(arg);
43262 uint64_t ret_ref = 0;
43263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43267 int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) {
43268 LDKRouteHint arg_conv;
43269 arg_conv.inner = untag_ptr(arg);
43270 arg_conv.is_owned = ptr_is_owned(arg);
43271 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43272 arg_conv.is_owned = false;
43273 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
43277 uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) {
43278 LDKRouteHint orig_conv;
43279 orig_conv.inner = untag_ptr(orig);
43280 orig_conv.is_owned = ptr_is_owned(orig);
43281 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43282 orig_conv.is_owned = false;
43283 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
43284 uint64_t ret_ref = 0;
43285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43290 int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) {
43291 LDKRouteHint o_conv;
43292 o_conv.inner = untag_ptr(o);
43293 o_conv.is_owned = ptr_is_owned(o);
43294 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43295 o_conv.is_owned = false;
43296 int64_t ret_conv = RouteHint_hash(&o_conv);
43300 jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) {
43301 LDKRouteHint a_conv;
43302 a_conv.inner = untag_ptr(a);
43303 a_conv.is_owned = ptr_is_owned(a);
43304 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43305 a_conv.is_owned = false;
43306 LDKRouteHint b_conv;
43307 b_conv.inner = untag_ptr(b);
43308 b_conv.is_owned = ptr_is_owned(b);
43309 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43310 b_conv.is_owned = false;
43311 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
43315 int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) {
43316 LDKRouteHint obj_conv;
43317 obj_conv.inner = untag_ptr(obj);
43318 obj_conv.is_owned = ptr_is_owned(obj);
43319 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43320 obj_conv.is_owned = false;
43321 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
43322 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43323 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43324 CVec_u8Z_free(ret_var);
43328 uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
43329 LDKu8slice ser_ref;
43330 ser_ref.datalen = ser->arr_len;
43331 ser_ref.data = ser->elems;
43332 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
43333 *ret_conv = RouteHint_read(ser_ref);
43335 return tag_ptr(ret_conv, true);
43338 void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) {
43339 LDKRouteHintHop this_obj_conv;
43340 this_obj_conv.inner = untag_ptr(this_obj);
43341 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43343 RouteHintHop_free(this_obj_conv);
43346 int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) {
43347 LDKRouteHintHop this_ptr_conv;
43348 this_ptr_conv.inner = untag_ptr(this_ptr);
43349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43351 this_ptr_conv.is_owned = false;
43352 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43353 memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33);
43357 void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) {
43358 LDKRouteHintHop this_ptr_conv;
43359 this_ptr_conv.inner = untag_ptr(this_ptr);
43360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43362 this_ptr_conv.is_owned = false;
43363 LDKPublicKey val_ref;
43364 CHECK(val->arr_len == 33);
43365 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
43366 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
43369 int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) {
43370 LDKRouteHintHop this_ptr_conv;
43371 this_ptr_conv.inner = untag_ptr(this_ptr);
43372 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43374 this_ptr_conv.is_owned = false;
43375 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
43379 void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
43380 LDKRouteHintHop this_ptr_conv;
43381 this_ptr_conv.inner = untag_ptr(this_ptr);
43382 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43384 this_ptr_conv.is_owned = false;
43385 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
43388 uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) {
43389 LDKRouteHintHop this_ptr_conv;
43390 this_ptr_conv.inner = untag_ptr(this_ptr);
43391 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43393 this_ptr_conv.is_owned = false;
43394 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
43395 uint64_t ret_ref = 0;
43396 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43397 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43401 void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) {
43402 LDKRouteHintHop this_ptr_conv;
43403 this_ptr_conv.inner = untag_ptr(this_ptr);
43404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43406 this_ptr_conv.is_owned = false;
43407 LDKRoutingFees val_conv;
43408 val_conv.inner = untag_ptr(val);
43409 val_conv.is_owned = ptr_is_owned(val);
43410 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43411 val_conv = RoutingFees_clone(&val_conv);
43412 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
43415 int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) {
43416 LDKRouteHintHop this_ptr_conv;
43417 this_ptr_conv.inner = untag_ptr(this_ptr);
43418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43420 this_ptr_conv.is_owned = false;
43421 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
43425 void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
43426 LDKRouteHintHop this_ptr_conv;
43427 this_ptr_conv.inner = untag_ptr(this_ptr);
43428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43430 this_ptr_conv.is_owned = false;
43431 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
43434 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) {
43435 LDKRouteHintHop this_ptr_conv;
43436 this_ptr_conv.inner = untag_ptr(this_ptr);
43437 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43439 this_ptr_conv.is_owned = false;
43440 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43441 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
43442 uint64_t ret_ref = tag_ptr(ret_copy, true);
43446 void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
43447 LDKRouteHintHop this_ptr_conv;
43448 this_ptr_conv.inner = untag_ptr(this_ptr);
43449 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43450 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43451 this_ptr_conv.is_owned = false;
43452 void* val_ptr = untag_ptr(val);
43453 CHECK_ACCESS(val_ptr);
43454 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
43455 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
43456 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
43459 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) {
43460 LDKRouteHintHop this_ptr_conv;
43461 this_ptr_conv.inner = untag_ptr(this_ptr);
43462 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43464 this_ptr_conv.is_owned = false;
43465 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43466 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
43467 uint64_t ret_ref = tag_ptr(ret_copy, true);
43471 void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
43472 LDKRouteHintHop this_ptr_conv;
43473 this_ptr_conv.inner = untag_ptr(this_ptr);
43474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43476 this_ptr_conv.is_owned = false;
43477 void* val_ptr = untag_ptr(val);
43478 CHECK_ACCESS(val_ptr);
43479 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
43480 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
43481 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
43484 uint64_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint64_t fees_arg, int16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg) {
43485 LDKPublicKey src_node_id_arg_ref;
43486 CHECK(src_node_id_arg->arr_len == 33);
43487 memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg);
43488 LDKRoutingFees fees_arg_conv;
43489 fees_arg_conv.inner = untag_ptr(fees_arg);
43490 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
43491 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
43492 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
43493 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
43494 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
43495 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
43496 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
43497 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
43498 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
43499 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
43500 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
43501 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);
43502 uint64_t ret_ref = 0;
43503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43508 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
43509 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
43510 uint64_t ret_ref = 0;
43511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43515 int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) {
43516 LDKRouteHintHop arg_conv;
43517 arg_conv.inner = untag_ptr(arg);
43518 arg_conv.is_owned = ptr_is_owned(arg);
43519 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43520 arg_conv.is_owned = false;
43521 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
43525 uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) {
43526 LDKRouteHintHop orig_conv;
43527 orig_conv.inner = untag_ptr(orig);
43528 orig_conv.is_owned = ptr_is_owned(orig);
43529 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43530 orig_conv.is_owned = false;
43531 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
43532 uint64_t ret_ref = 0;
43533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43538 int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) {
43539 LDKRouteHintHop o_conv;
43540 o_conv.inner = untag_ptr(o);
43541 o_conv.is_owned = ptr_is_owned(o);
43542 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43543 o_conv.is_owned = false;
43544 int64_t ret_conv = RouteHintHop_hash(&o_conv);
43548 jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) {
43549 LDKRouteHintHop a_conv;
43550 a_conv.inner = untag_ptr(a);
43551 a_conv.is_owned = ptr_is_owned(a);
43552 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43553 a_conv.is_owned = false;
43554 LDKRouteHintHop b_conv;
43555 b_conv.inner = untag_ptr(b);
43556 b_conv.is_owned = ptr_is_owned(b);
43557 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43558 b_conv.is_owned = false;
43559 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
43563 int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) {
43564 LDKRouteHintHop obj_conv;
43565 obj_conv.inner = untag_ptr(obj);
43566 obj_conv.is_owned = ptr_is_owned(obj);
43567 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43568 obj_conv.is_owned = false;
43569 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
43570 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43571 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43572 CVec_u8Z_free(ret_var);
43576 uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
43577 LDKu8slice ser_ref;
43578 ser_ref.datalen = ser->arr_len;
43579 ser_ref.data = ser->elems;
43580 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
43581 *ret_conv = RouteHintHop_read(ser_ref);
43583 return tag_ptr(ret_conv, true);
43586 uint64_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArray our_node_pubkey, uint64_t route_params, uint64_t network_graph, uint64_tArray first_hops, uint64_t logger, uint64_t scorer, int8_tArray random_seed_bytes) {
43587 LDKPublicKey our_node_pubkey_ref;
43588 CHECK(our_node_pubkey->arr_len == 33);
43589 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
43590 LDKRouteParameters route_params_conv;
43591 route_params_conv.inner = untag_ptr(route_params);
43592 route_params_conv.is_owned = ptr_is_owned(route_params);
43593 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
43594 route_params_conv.is_owned = false;
43595 LDKNetworkGraph network_graph_conv;
43596 network_graph_conv.inner = untag_ptr(network_graph);
43597 network_graph_conv.is_owned = ptr_is_owned(network_graph);
43598 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
43599 network_graph_conv.is_owned = false;
43600 LDKCVec_ChannelDetailsZ first_hops_constr;
43601 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
43602 if (first_hops != 0) {
43603 first_hops_constr.datalen = first_hops->arr_len;
43604 if (first_hops_constr.datalen > 0)
43605 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
43607 first_hops_constr.data = NULL;
43608 uint64_t* first_hops_vals = first_hops->elems;
43609 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
43610 uint64_t first_hops_conv_16 = first_hops_vals[q];
43611 LDKChannelDetails first_hops_conv_16_conv;
43612 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
43613 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
43614 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
43615 first_hops_conv_16_conv.is_owned = false;
43616 first_hops_constr.data[q] = first_hops_conv_16_conv;
43619 first_hops_ptr = &first_hops_constr;
43621 void* logger_ptr = untag_ptr(logger);
43622 CHECK_ACCESS(logger_ptr);
43623 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43624 if (logger_conv.free == LDKLogger_JCalls_free) {
43625 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43626 LDKLogger_JCalls_cloned(&logger_conv);
43628 void* scorer_ptr = untag_ptr(scorer);
43629 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
43630 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
43631 unsigned char random_seed_bytes_arr[32];
43632 CHECK(random_seed_bytes->arr_len == 32);
43633 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
43634 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
43635 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
43636 *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);
43637 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
43638 return tag_ptr(ret_conv, true);
43641 uint64_t __attribute__((export_name("TS_build_route_from_hops"))) TS_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, uint64_t route_params, uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) {
43642 LDKPublicKey our_node_pubkey_ref;
43643 CHECK(our_node_pubkey->arr_len == 33);
43644 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
43645 LDKCVec_PublicKeyZ hops_constr;
43646 hops_constr.datalen = hops->arr_len;
43647 if (hops_constr.datalen > 0)
43648 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
43650 hops_constr.data = NULL;
43651 int8_tArray* hops_vals = (void*) hops->elems;
43652 for (size_t m = 0; m < hops_constr.datalen; m++) {
43653 int8_tArray hops_conv_12 = hops_vals[m];
43654 LDKPublicKey hops_conv_12_ref;
43655 CHECK(hops_conv_12->arr_len == 33);
43656 memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
43657 hops_constr.data[m] = hops_conv_12_ref;
43660 LDKRouteParameters route_params_conv;
43661 route_params_conv.inner = untag_ptr(route_params);
43662 route_params_conv.is_owned = ptr_is_owned(route_params);
43663 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
43664 route_params_conv.is_owned = false;
43665 LDKNetworkGraph network_graph_conv;
43666 network_graph_conv.inner = untag_ptr(network_graph);
43667 network_graph_conv.is_owned = ptr_is_owned(network_graph);
43668 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
43669 network_graph_conv.is_owned = false;
43670 void* logger_ptr = untag_ptr(logger);
43671 CHECK_ACCESS(logger_ptr);
43672 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43673 if (logger_conv.free == LDKLogger_JCalls_free) {
43674 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43675 LDKLogger_JCalls_cloned(&logger_conv);
43677 unsigned char random_seed_bytes_arr[32];
43678 CHECK(random_seed_bytes->arr_len == 32);
43679 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
43680 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
43681 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
43682 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
43683 return tag_ptr(ret_conv, true);
43686 void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint64_t this_ptr) {
43687 if (!ptr_is_owned(this_ptr)) return;
43688 void* this_ptr_ptr = untag_ptr(this_ptr);
43689 CHECK_ACCESS(this_ptr_ptr);
43690 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
43691 FREE(untag_ptr(this_ptr));
43692 Score_free(this_ptr_conv);
43695 void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint64_t this_ptr) {
43696 if (!ptr_is_owned(this_ptr)) return;
43697 void* this_ptr_ptr = untag_ptr(this_ptr);
43698 CHECK_ACCESS(this_ptr_ptr);
43699 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
43700 FREE(untag_ptr(this_ptr));
43701 LockableScore_free(this_ptr_conv);
43704 void __attribute__((export_name("TS_WriteableScore_free"))) TS_WriteableScore_free(uint64_t this_ptr) {
43705 if (!ptr_is_owned(this_ptr)) return;
43706 void* this_ptr_ptr = untag_ptr(this_ptr);
43707 CHECK_ACCESS(this_ptr_ptr);
43708 LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
43709 FREE(untag_ptr(this_ptr));
43710 WriteableScore_free(this_ptr_conv);
43713 void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
43714 LDKMultiThreadedLockableScore 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 MultiThreadedLockableScore_free(this_obj_conv);
43721 void __attribute__((export_name("TS_MultiThreadedScoreLock_free"))) TS_MultiThreadedScoreLock_free(uint64_t this_obj) {
43722 LDKMultiThreadedScoreLock this_obj_conv;
43723 this_obj_conv.inner = untag_ptr(this_obj);
43724 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43726 MultiThreadedScoreLock_free(this_obj_conv);
43729 uint64_t __attribute__((export_name("TS_MultiThreadedScoreLock_as_Score"))) TS_MultiThreadedScoreLock_as_Score(uint64_t this_arg) {
43730 LDKMultiThreadedScoreLock this_arg_conv;
43731 this_arg_conv.inner = untag_ptr(this_arg);
43732 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43734 this_arg_conv.is_owned = false;
43735 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
43736 *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
43737 return tag_ptr(ret_ret, true);
43740 int8_tArray __attribute__((export_name("TS_MultiThreadedScoreLock_write"))) TS_MultiThreadedScoreLock_write(uint64_t obj) {
43741 LDKMultiThreadedScoreLock obj_conv;
43742 obj_conv.inner = untag_ptr(obj);
43743 obj_conv.is_owned = ptr_is_owned(obj);
43744 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43745 obj_conv.is_owned = false;
43746 LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
43747 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43748 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43749 CVec_u8Z_free(ret_var);
43753 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_LockableScore"))) TS_MultiThreadedLockableScore_as_LockableScore(uint64_t this_arg) {
43754 LDKMultiThreadedLockableScore this_arg_conv;
43755 this_arg_conv.inner = untag_ptr(this_arg);
43756 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43758 this_arg_conv.is_owned = false;
43759 LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
43760 *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
43761 return tag_ptr(ret_ret, true);
43764 int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
43765 LDKMultiThreadedLockableScore obj_conv;
43766 obj_conv.inner = untag_ptr(obj);
43767 obj_conv.is_owned = ptr_is_owned(obj);
43768 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43769 obj_conv.is_owned = false;
43770 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
43771 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43772 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43773 CVec_u8Z_free(ret_var);
43777 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_WriteableScore"))) TS_MultiThreadedLockableScore_as_WriteableScore(uint64_t this_arg) {
43778 LDKMultiThreadedLockableScore this_arg_conv;
43779 this_arg_conv.inner = untag_ptr(this_arg);
43780 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43782 this_arg_conv.is_owned = false;
43783 LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
43784 *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
43785 return tag_ptr(ret_ret, true);
43788 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
43789 void* score_ptr = untag_ptr(score);
43790 CHECK_ACCESS(score_ptr);
43791 LDKScore score_conv = *(LDKScore*)(score_ptr);
43792 if (score_conv.free == LDKScore_JCalls_free) {
43793 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43794 LDKScore_JCalls_cloned(&score_conv);
43796 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
43797 uint64_t ret_ref = 0;
43798 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43799 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43803 void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) {
43804 LDKChannelUsage this_obj_conv;
43805 this_obj_conv.inner = untag_ptr(this_obj);
43806 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43808 ChannelUsage_free(this_obj_conv);
43811 int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) {
43812 LDKChannelUsage this_ptr_conv;
43813 this_ptr_conv.inner = untag_ptr(this_ptr);
43814 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43816 this_ptr_conv.is_owned = false;
43817 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
43821 void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) {
43822 LDKChannelUsage this_ptr_conv;
43823 this_ptr_conv.inner = untag_ptr(this_ptr);
43824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43826 this_ptr_conv.is_owned = false;
43827 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
43830 int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) {
43831 LDKChannelUsage this_ptr_conv;
43832 this_ptr_conv.inner = untag_ptr(this_ptr);
43833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43835 this_ptr_conv.is_owned = false;
43836 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
43840 void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) {
43841 LDKChannelUsage this_ptr_conv;
43842 this_ptr_conv.inner = untag_ptr(this_ptr);
43843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43845 this_ptr_conv.is_owned = false;
43846 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
43849 uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) {
43850 LDKChannelUsage this_ptr_conv;
43851 this_ptr_conv.inner = untag_ptr(this_ptr);
43852 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43854 this_ptr_conv.is_owned = false;
43855 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
43856 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
43857 uint64_t ret_ref = tag_ptr(ret_copy, true);
43861 void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) {
43862 LDKChannelUsage this_ptr_conv;
43863 this_ptr_conv.inner = untag_ptr(this_ptr);
43864 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43866 this_ptr_conv.is_owned = false;
43867 void* val_ptr = untag_ptr(val);
43868 CHECK_ACCESS(val_ptr);
43869 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
43870 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
43871 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
43874 uint64_t __attribute__((export_name("TS_ChannelUsage_new"))) TS_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, uint64_t effective_capacity_arg) {
43875 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
43876 CHECK_ACCESS(effective_capacity_arg_ptr);
43877 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
43878 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
43879 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
43880 uint64_t ret_ref = 0;
43881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43886 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
43887 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
43888 uint64_t ret_ref = 0;
43889 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43890 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43893 int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) {
43894 LDKChannelUsage arg_conv;
43895 arg_conv.inner = untag_ptr(arg);
43896 arg_conv.is_owned = ptr_is_owned(arg);
43897 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43898 arg_conv.is_owned = false;
43899 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
43903 uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) {
43904 LDKChannelUsage orig_conv;
43905 orig_conv.inner = untag_ptr(orig);
43906 orig_conv.is_owned = ptr_is_owned(orig);
43907 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43908 orig_conv.is_owned = false;
43909 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
43910 uint64_t ret_ref = 0;
43911 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43912 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43916 void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) {
43917 LDKFixedPenaltyScorer this_obj_conv;
43918 this_obj_conv.inner = untag_ptr(this_obj);
43919 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43921 FixedPenaltyScorer_free(this_obj_conv);
43924 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
43925 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
43926 uint64_t ret_ref = 0;
43927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43931 int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) {
43932 LDKFixedPenaltyScorer arg_conv;
43933 arg_conv.inner = untag_ptr(arg);
43934 arg_conv.is_owned = ptr_is_owned(arg);
43935 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43936 arg_conv.is_owned = false;
43937 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
43941 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) {
43942 LDKFixedPenaltyScorer orig_conv;
43943 orig_conv.inner = untag_ptr(orig);
43944 orig_conv.is_owned = ptr_is_owned(orig);
43945 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43946 orig_conv.is_owned = false;
43947 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
43948 uint64_t ret_ref = 0;
43949 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43950 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43954 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) {
43955 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
43956 uint64_t ret_ref = 0;
43957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43962 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) {
43963 LDKFixedPenaltyScorer this_arg_conv;
43964 this_arg_conv.inner = untag_ptr(this_arg);
43965 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43967 this_arg_conv.is_owned = false;
43968 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
43969 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
43970 return tag_ptr(ret_ret, true);
43973 int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) {
43974 LDKFixedPenaltyScorer obj_conv;
43975 obj_conv.inner = untag_ptr(obj);
43976 obj_conv.is_owned = ptr_is_owned(obj);
43977 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43978 obj_conv.is_owned = false;
43979 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
43980 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43981 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43982 CVec_u8Z_free(ret_var);
43986 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
43987 LDKu8slice ser_ref;
43988 ser_ref.datalen = ser->arr_len;
43989 ser_ref.data = ser->elems;
43990 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
43991 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
43993 return tag_ptr(ret_conv, true);
43996 void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) {
43997 LDKProbabilisticScorer this_obj_conv;
43998 this_obj_conv.inner = untag_ptr(this_obj);
43999 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44001 ProbabilisticScorer_free(this_obj_conv);
44004 void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) {
44005 LDKProbabilisticScoringParameters this_obj_conv;
44006 this_obj_conv.inner = untag_ptr(this_obj);
44007 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44009 ProbabilisticScoringParameters_free(this_obj_conv);
44012 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_msat(uint64_t this_ptr) {
44013 LDKProbabilisticScoringParameters this_ptr_conv;
44014 this_ptr_conv.inner = untag_ptr(this_ptr);
44015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44017 this_ptr_conv.is_owned = false;
44018 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
44022 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_msat(uint64_t this_ptr, int64_t val) {
44023 LDKProbabilisticScoringParameters this_ptr_conv;
44024 this_ptr_conv.inner = untag_ptr(this_ptr);
44025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44027 this_ptr_conv.is_owned = false;
44028 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
44031 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(uint64_t this_ptr) {
44032 LDKProbabilisticScoringParameters this_ptr_conv;
44033 this_ptr_conv.inner = untag_ptr(this_ptr);
44034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44036 this_ptr_conv.is_owned = false;
44037 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
44041 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(uint64_t this_ptr, int64_t val) {
44042 LDKProbabilisticScoringParameters this_ptr_conv;
44043 this_ptr_conv.inner = untag_ptr(this_ptr);
44044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44046 this_ptr_conv.is_owned = false;
44047 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
44050 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
44051 LDKProbabilisticScoringParameters this_ptr_conv;
44052 this_ptr_conv.inner = untag_ptr(this_ptr);
44053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44055 this_ptr_conv.is_owned = false;
44056 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
44060 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(uint64_t this_ptr, int64_t val) {
44061 LDKProbabilisticScoringParameters this_ptr_conv;
44062 this_ptr_conv.inner = untag_ptr(this_ptr);
44063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44065 this_ptr_conv.is_owned = false;
44066 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
44069 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life(uint64_t this_ptr) {
44070 LDKProbabilisticScoringParameters this_ptr_conv;
44071 this_ptr_conv.inner = untag_ptr(this_ptr);
44072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44074 this_ptr_conv.is_owned = false;
44075 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
44079 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_set_liquidity_offset_half_life(uint64_t this_ptr, int64_t val) {
44080 LDKProbabilisticScoringParameters this_ptr_conv;
44081 this_ptr_conv.inner = untag_ptr(this_ptr);
44082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44084 this_ptr_conv.is_owned = false;
44085 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
44088 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr) {
44089 LDKProbabilisticScoringParameters this_ptr_conv;
44090 this_ptr_conv.inner = untag_ptr(this_ptr);
44091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44093 this_ptr_conv.is_owned = false;
44094 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
44098 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr, int64_t val) {
44099 LDKProbabilisticScoringParameters this_ptr_conv;
44100 this_ptr_conv.inner = untag_ptr(this_ptr);
44101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44103 this_ptr_conv.is_owned = false;
44104 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
44107 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
44108 LDKProbabilisticScoringParameters this_ptr_conv;
44109 this_ptr_conv.inner = untag_ptr(this_ptr);
44110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44112 this_ptr_conv.is_owned = false;
44113 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
44117 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr, int64_t val) {
44118 LDKProbabilisticScoringParameters this_ptr_conv;
44119 this_ptr_conv.inner = untag_ptr(this_ptr);
44120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44122 this_ptr_conv.is_owned = false;
44123 ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
44126 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr) {
44127 LDKProbabilisticScoringParameters this_ptr_conv;
44128 this_ptr_conv.inner = untag_ptr(this_ptr);
44129 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44131 this_ptr_conv.is_owned = false;
44132 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
44136 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr, int64_t val) {
44137 LDKProbabilisticScoringParameters this_ptr_conv;
44138 this_ptr_conv.inner = untag_ptr(this_ptr);
44139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44141 this_ptr_conv.is_owned = false;
44142 ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
44145 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life(uint64_t this_ptr) {
44146 LDKProbabilisticScoringParameters this_ptr_conv;
44147 this_ptr_conv.inner = untag_ptr(this_ptr);
44148 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44150 this_ptr_conv.is_owned = false;
44151 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
44155 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life(uint64_t this_ptr, int64_t val) {
44156 LDKProbabilisticScoringParameters this_ptr_conv;
44157 this_ptr_conv.inner = untag_ptr(this_ptr);
44158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44160 this_ptr_conv.is_owned = false;
44161 ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
44164 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
44165 LDKProbabilisticScoringParameters this_ptr_conv;
44166 this_ptr_conv.inner = untag_ptr(this_ptr);
44167 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44169 this_ptr_conv.is_owned = false;
44170 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
44174 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_set_anti_probing_penalty_msat(uint64_t this_ptr, int64_t val) {
44175 LDKProbabilisticScoringParameters this_ptr_conv;
44176 this_ptr_conv.inner = untag_ptr(this_ptr);
44177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44179 this_ptr_conv.is_owned = false;
44180 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
44183 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(uint64_t this_ptr) {
44184 LDKProbabilisticScoringParameters this_ptr_conv;
44185 this_ptr_conv.inner = untag_ptr(this_ptr);
44186 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44188 this_ptr_conv.is_owned = false;
44189 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
44193 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(uint64_t this_ptr, int64_t val) {
44194 LDKProbabilisticScoringParameters this_ptr_conv;
44195 this_ptr_conv.inner = untag_ptr(this_ptr);
44196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44198 this_ptr_conv.is_owned = false;
44199 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
44202 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
44203 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
44204 uint64_t ret_ref = 0;
44205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44209 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) {
44210 LDKProbabilisticScoringParameters arg_conv;
44211 arg_conv.inner = untag_ptr(arg);
44212 arg_conv.is_owned = ptr_is_owned(arg);
44213 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44214 arg_conv.is_owned = false;
44215 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
44219 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) {
44220 LDKProbabilisticScoringParameters orig_conv;
44221 orig_conv.inner = untag_ptr(orig);
44222 orig_conv.is_owned = ptr_is_owned(orig);
44223 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44224 orig_conv.is_owned = false;
44225 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
44226 uint64_t ret_ref = 0;
44227 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44228 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44232 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) {
44233 LDKProbabilisticScoringParameters params_conv;
44234 params_conv.inner = untag_ptr(params);
44235 params_conv.is_owned = ptr_is_owned(params);
44236 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
44237 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
44238 LDKNetworkGraph network_graph_conv;
44239 network_graph_conv.inner = untag_ptr(network_graph);
44240 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44241 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44242 network_graph_conv.is_owned = false;
44243 void* logger_ptr = untag_ptr(logger);
44244 CHECK_ACCESS(logger_ptr);
44245 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44246 if (logger_conv.free == LDKLogger_JCalls_free) {
44247 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44248 LDKLogger_JCalls_cloned(&logger_conv);
44250 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
44251 uint64_t ret_ref = 0;
44252 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44253 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44257 void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) {
44258 LDKProbabilisticScorer this_arg_conv;
44259 this_arg_conv.inner = untag_ptr(this_arg);
44260 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44262 this_arg_conv.is_owned = false;
44263 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
44266 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_estimated_channel_liquidity_range"))) TS_ProbabilisticScorer_estimated_channel_liquidity_range(uint64_t this_arg, int64_t scid, uint64_t target) {
44267 LDKProbabilisticScorer this_arg_conv;
44268 this_arg_conv.inner = untag_ptr(this_arg);
44269 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44270 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44271 this_arg_conv.is_owned = false;
44272 LDKNodeId target_conv;
44273 target_conv.inner = untag_ptr(target);
44274 target_conv.is_owned = ptr_is_owned(target);
44275 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
44276 target_conv.is_owned = false;
44277 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
44278 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
44279 uint64_t ret_ref = tag_ptr(ret_copy, true);
44283 void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
44284 LDKProbabilisticScorer this_arg_conv;
44285 this_arg_conv.inner = untag_ptr(this_arg);
44286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44288 this_arg_conv.is_owned = false;
44289 LDKNodeId node_id_conv;
44290 node_id_conv.inner = untag_ptr(node_id);
44291 node_id_conv.is_owned = ptr_is_owned(node_id);
44292 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
44293 node_id_conv.is_owned = false;
44294 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
44297 void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) {
44298 LDKProbabilisticScorer this_arg_conv;
44299 this_arg_conv.inner = untag_ptr(this_arg);
44300 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44302 this_arg_conv.is_owned = false;
44303 LDKNodeId node_id_conv;
44304 node_id_conv.inner = untag_ptr(node_id);
44305 node_id_conv.is_owned = ptr_is_owned(node_id);
44306 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
44307 node_id_conv.is_owned = false;
44308 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
44311 void __attribute__((export_name("TS_ProbabilisticScorer_set_manual_penalty"))) TS_ProbabilisticScorer_set_manual_penalty(uint64_t this_arg, uint64_t node_id, int64_t penalty) {
44312 LDKProbabilisticScorer this_arg_conv;
44313 this_arg_conv.inner = untag_ptr(this_arg);
44314 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44316 this_arg_conv.is_owned = false;
44317 LDKNodeId node_id_conv;
44318 node_id_conv.inner = untag_ptr(node_id);
44319 node_id_conv.is_owned = ptr_is_owned(node_id);
44320 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
44321 node_id_conv.is_owned = false;
44322 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
44325 void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) {
44326 LDKProbabilisticScorer this_arg_conv;
44327 this_arg_conv.inner = untag_ptr(this_arg);
44328 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44330 this_arg_conv.is_owned = false;
44331 LDKNodeId node_id_conv;
44332 node_id_conv.inner = untag_ptr(node_id);
44333 node_id_conv.is_owned = ptr_is_owned(node_id);
44334 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
44335 node_id_conv.is_owned = false;
44336 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
44339 void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) {
44340 LDKProbabilisticScorer this_arg_conv;
44341 this_arg_conv.inner = untag_ptr(this_arg);
44342 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44344 this_arg_conv.is_owned = false;
44345 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
44348 void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) {
44349 LDKProbabilisticScoringParameters this_arg_conv;
44350 this_arg_conv.inner = untag_ptr(this_arg);
44351 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44353 this_arg_conv.is_owned = false;
44354 LDKCVec_NodeIdZ node_ids_constr;
44355 node_ids_constr.datalen = node_ids->arr_len;
44356 if (node_ids_constr.datalen > 0)
44357 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
44359 node_ids_constr.data = NULL;
44360 uint64_t* node_ids_vals = node_ids->elems;
44361 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
44362 uint64_t node_ids_conv_8 = node_ids_vals[i];
44363 LDKNodeId node_ids_conv_8_conv;
44364 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
44365 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
44366 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
44367 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
44368 node_ids_constr.data[i] = node_ids_conv_8_conv;
44371 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
44374 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() {
44375 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
44376 uint64_t ret_ref = 0;
44377 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44378 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44382 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) {
44383 LDKProbabilisticScorer this_arg_conv;
44384 this_arg_conv.inner = untag_ptr(this_arg);
44385 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44387 this_arg_conv.is_owned = false;
44388 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
44389 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
44390 return tag_ptr(ret_ret, true);
44393 int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) {
44394 LDKProbabilisticScorer obj_conv;
44395 obj_conv.inner = untag_ptr(obj);
44396 obj_conv.is_owned = ptr_is_owned(obj);
44397 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44398 obj_conv.is_owned = false;
44399 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
44400 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
44401 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
44402 CVec_u8Z_free(ret_var);
44406 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_read"))) TS_ProbabilisticScorer_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b, uint64_t arg_c) {
44407 LDKu8slice ser_ref;
44408 ser_ref.datalen = ser->arr_len;
44409 ser_ref.data = ser->elems;
44410 LDKProbabilisticScoringParameters arg_a_conv;
44411 arg_a_conv.inner = untag_ptr(arg_a);
44412 arg_a_conv.is_owned = ptr_is_owned(arg_a);
44413 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
44414 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
44415 LDKNetworkGraph arg_b_conv;
44416 arg_b_conv.inner = untag_ptr(arg_b);
44417 arg_b_conv.is_owned = ptr_is_owned(arg_b);
44418 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
44419 arg_b_conv.is_owned = false;
44420 void* arg_c_ptr = untag_ptr(arg_c);
44421 CHECK_ACCESS(arg_c_ptr);
44422 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
44423 if (arg_c_conv.free == LDKLogger_JCalls_free) {
44424 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44425 LDKLogger_JCalls_cloned(&arg_c_conv);
44427 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
44428 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
44430 return tag_ptr(ret_conv, true);
44433 void __attribute__((export_name("TS_BlindedRoute_free"))) TS_BlindedRoute_free(uint64_t this_obj) {
44434 LDKBlindedRoute this_obj_conv;
44435 this_obj_conv.inner = untag_ptr(this_obj);
44436 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44438 BlindedRoute_free(this_obj_conv);
44441 void __attribute__((export_name("TS_BlindedHop_free"))) TS_BlindedHop_free(uint64_t this_obj) {
44442 LDKBlindedHop this_obj_conv;
44443 this_obj_conv.inner = untag_ptr(this_obj);
44444 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44446 BlindedHop_free(this_obj_conv);
44449 uint64_t __attribute__((export_name("TS_BlindedRoute_new"))) TS_BlindedRoute_new(ptrArray node_pks, uint64_t keys_manager) {
44450 LDKCVec_PublicKeyZ node_pks_constr;
44451 node_pks_constr.datalen = node_pks->arr_len;
44452 if (node_pks_constr.datalen > 0)
44453 node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
44455 node_pks_constr.data = NULL;
44456 int8_tArray* node_pks_vals = (void*) node_pks->elems;
44457 for (size_t m = 0; m < node_pks_constr.datalen; m++) {
44458 int8_tArray node_pks_conv_12 = node_pks_vals[m];
44459 LDKPublicKey node_pks_conv_12_ref;
44460 CHECK(node_pks_conv_12->arr_len == 33);
44461 memcpy(node_pks_conv_12_ref.compressed_form, node_pks_conv_12->elems, 33); FREE(node_pks_conv_12);
44462 node_pks_constr.data[m] = node_pks_conv_12_ref;
44465 void* keys_manager_ptr = untag_ptr(keys_manager);
44466 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
44467 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
44468 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
44469 *ret_conv = BlindedRoute_new(node_pks_constr, keys_manager_conv);
44470 return tag_ptr(ret_conv, true);
44473 int8_tArray __attribute__((export_name("TS_BlindedRoute_write"))) TS_BlindedRoute_write(uint64_t obj) {
44474 LDKBlindedRoute obj_conv;
44475 obj_conv.inner = untag_ptr(obj);
44476 obj_conv.is_owned = ptr_is_owned(obj);
44477 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44478 obj_conv.is_owned = false;
44479 LDKCVec_u8Z ret_var = BlindedRoute_write(&obj_conv);
44480 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
44481 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
44482 CVec_u8Z_free(ret_var);
44486 uint64_t __attribute__((export_name("TS_BlindedRoute_read"))) TS_BlindedRoute_read(int8_tArray ser) {
44487 LDKu8slice ser_ref;
44488 ser_ref.datalen = ser->arr_len;
44489 ser_ref.data = ser->elems;
44490 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
44491 *ret_conv = BlindedRoute_read(ser_ref);
44493 return tag_ptr(ret_conv, true);
44496 int8_tArray __attribute__((export_name("TS_BlindedHop_write"))) TS_BlindedHop_write(uint64_t obj) {
44497 LDKBlindedHop obj_conv;
44498 obj_conv.inner = untag_ptr(obj);
44499 obj_conv.is_owned = ptr_is_owned(obj);
44500 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44501 obj_conv.is_owned = false;
44502 LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
44503 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
44504 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
44505 CVec_u8Z_free(ret_var);
44509 uint64_t __attribute__((export_name("TS_BlindedHop_read"))) TS_BlindedHop_read(int8_tArray ser) {
44510 LDKu8slice ser_ref;
44511 ser_ref.datalen = ser->arr_len;
44512 ser_ref.data = ser->elems;
44513 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
44514 *ret_conv = BlindedHop_read(ser_ref);
44516 return tag_ptr(ret_conv, true);
44519 void __attribute__((export_name("TS_OnionMessenger_free"))) TS_OnionMessenger_free(uint64_t this_obj) {
44520 LDKOnionMessenger this_obj_conv;
44521 this_obj_conv.inner = untag_ptr(this_obj);
44522 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44524 OnionMessenger_free(this_obj_conv);
44527 void __attribute__((export_name("TS_Destination_free"))) TS_Destination_free(uint64_t this_ptr) {
44528 if (!ptr_is_owned(this_ptr)) return;
44529 void* this_ptr_ptr = untag_ptr(this_ptr);
44530 CHECK_ACCESS(this_ptr_ptr);
44531 LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
44532 FREE(untag_ptr(this_ptr));
44533 Destination_free(this_ptr_conv);
44536 uint64_t __attribute__((export_name("TS_Destination_node"))) TS_Destination_node(int8_tArray a) {
44537 LDKPublicKey a_ref;
44538 CHECK(a->arr_len == 33);
44539 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
44540 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
44541 *ret_copy = Destination_node(a_ref);
44542 uint64_t ret_ref = tag_ptr(ret_copy, true);
44546 uint64_t __attribute__((export_name("TS_Destination_blinded_route"))) TS_Destination_blinded_route(uint64_t a) {
44547 LDKBlindedRoute a_conv;
44548 a_conv.inner = untag_ptr(a);
44549 a_conv.is_owned = ptr_is_owned(a);
44550 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44551 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
44553 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
44554 *ret_copy = Destination_blinded_route(a_conv);
44555 uint64_t ret_ref = tag_ptr(ret_copy, true);
44559 void __attribute__((export_name("TS_SendError_free"))) TS_SendError_free(uint64_t this_ptr) {
44560 if (!ptr_is_owned(this_ptr)) return;
44561 void* this_ptr_ptr = untag_ptr(this_ptr);
44562 CHECK_ACCESS(this_ptr_ptr);
44563 LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
44564 FREE(untag_ptr(this_ptr));
44565 SendError_free(this_ptr_conv);
44568 static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
44569 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44570 *ret_copy = SendError_clone(arg);
44571 uint64_t ret_ref = tag_ptr(ret_copy, true);
44574 int64_t __attribute__((export_name("TS_SendError_clone_ptr"))) TS_SendError_clone_ptr(uint64_t arg) {
44575 LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
44576 int64_t ret_conv = SendError_clone_ptr(arg_conv);
44580 uint64_t __attribute__((export_name("TS_SendError_clone"))) TS_SendError_clone(uint64_t orig) {
44581 LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
44582 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44583 *ret_copy = SendError_clone(orig_conv);
44584 uint64_t ret_ref = tag_ptr(ret_copy, true);
44588 uint64_t __attribute__((export_name("TS_SendError_secp256k1"))) TS_SendError_secp256k1(uint32_t a) {
44589 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
44590 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44591 *ret_copy = SendError_secp256k1(a_conv);
44592 uint64_t ret_ref = tag_ptr(ret_copy, true);
44596 uint64_t __attribute__((export_name("TS_SendError_too_big_packet"))) TS_SendError_too_big_packet() {
44597 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44598 *ret_copy = SendError_too_big_packet();
44599 uint64_t ret_ref = tag_ptr(ret_copy, true);
44603 uint64_t __attribute__((export_name("TS_SendError_too_few_blinded_hops"))) TS_SendError_too_few_blinded_hops() {
44604 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44605 *ret_copy = SendError_too_few_blinded_hops();
44606 uint64_t ret_ref = tag_ptr(ret_copy, true);
44610 uint64_t __attribute__((export_name("TS_SendError_invalid_first_hop"))) TS_SendError_invalid_first_hop() {
44611 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44612 *ret_copy = SendError_invalid_first_hop();
44613 uint64_t ret_ref = tag_ptr(ret_copy, true);
44617 uint64_t __attribute__((export_name("TS_SendError_invalid_message"))) TS_SendError_invalid_message() {
44618 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44619 *ret_copy = SendError_invalid_message();
44620 uint64_t ret_ref = tag_ptr(ret_copy, true);
44624 uint64_t __attribute__((export_name("TS_SendError_buffer_full"))) TS_SendError_buffer_full() {
44625 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
44626 *ret_copy = SendError_buffer_full();
44627 uint64_t ret_ref = tag_ptr(ret_copy, true);
44631 jboolean __attribute__((export_name("TS_SendError_eq"))) TS_SendError_eq(uint64_t a, uint64_t b) {
44632 LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
44633 LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
44634 jboolean ret_conv = SendError_eq(a_conv, b_conv);
44638 void __attribute__((export_name("TS_CustomOnionMessageHandler_free"))) TS_CustomOnionMessageHandler_free(uint64_t this_ptr) {
44639 if (!ptr_is_owned(this_ptr)) return;
44640 void* this_ptr_ptr = untag_ptr(this_ptr);
44641 CHECK_ACCESS(this_ptr_ptr);
44642 LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
44643 FREE(untag_ptr(this_ptr));
44644 CustomOnionMessageHandler_free(this_ptr_conv);
44647 uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t keys_manager, uint64_t logger, uint64_t custom_handler) {
44648 void* keys_manager_ptr = untag_ptr(keys_manager);
44649 CHECK_ACCESS(keys_manager_ptr);
44650 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
44651 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
44652 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44653 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
44655 void* logger_ptr = untag_ptr(logger);
44656 CHECK_ACCESS(logger_ptr);
44657 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44658 if (logger_conv.free == LDKLogger_JCalls_free) {
44659 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44660 LDKLogger_JCalls_cloned(&logger_conv);
44662 void* custom_handler_ptr = untag_ptr(custom_handler);
44663 CHECK_ACCESS(custom_handler_ptr);
44664 LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
44665 if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
44666 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44667 LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
44669 LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv, custom_handler_conv);
44670 uint64_t ret_ref = 0;
44671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44676 uint64_t __attribute__((export_name("TS_OnionMessenger_send_custom_onion_message"))) TS_OnionMessenger_send_custom_onion_message(uint64_t this_arg, ptrArray intermediate_nodes, uint64_t destination, uint64_t msg, uint64_t reply_path) {
44677 LDKOnionMessenger this_arg_conv;
44678 this_arg_conv.inner = untag_ptr(this_arg);
44679 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44681 this_arg_conv.is_owned = false;
44682 LDKCVec_PublicKeyZ intermediate_nodes_constr;
44683 intermediate_nodes_constr.datalen = intermediate_nodes->arr_len;
44684 if (intermediate_nodes_constr.datalen > 0)
44685 intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
44687 intermediate_nodes_constr.data = NULL;
44688 int8_tArray* intermediate_nodes_vals = (void*) intermediate_nodes->elems;
44689 for (size_t m = 0; m < intermediate_nodes_constr.datalen; m++) {
44690 int8_tArray intermediate_nodes_conv_12 = intermediate_nodes_vals[m];
44691 LDKPublicKey intermediate_nodes_conv_12_ref;
44692 CHECK(intermediate_nodes_conv_12->arr_len == 33);
44693 memcpy(intermediate_nodes_conv_12_ref.compressed_form, intermediate_nodes_conv_12->elems, 33); FREE(intermediate_nodes_conv_12);
44694 intermediate_nodes_constr.data[m] = intermediate_nodes_conv_12_ref;
44696 FREE(intermediate_nodes);
44697 void* destination_ptr = untag_ptr(destination);
44698 CHECK_ACCESS(destination_ptr);
44699 LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
44700 // WARNING: we may need a move here but no clone is available for LDKDestination
44701 void* msg_ptr = untag_ptr(msg);
44702 CHECK_ACCESS(msg_ptr);
44703 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
44704 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
44705 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44706 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
44708 LDKBlindedRoute reply_path_conv;
44709 reply_path_conv.inner = untag_ptr(reply_path);
44710 reply_path_conv.is_owned = ptr_is_owned(reply_path);
44711 CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
44712 reply_path_conv.is_owned = false;
44713 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
44714 *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv);
44715 return tag_ptr(ret_conv, true);
44718 uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageHandler"))) TS_OnionMessenger_as_OnionMessageHandler(uint64_t this_arg) {
44719 LDKOnionMessenger this_arg_conv;
44720 this_arg_conv.inner = untag_ptr(this_arg);
44721 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44723 this_arg_conv.is_owned = false;
44724 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
44725 *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
44726 return tag_ptr(ret_ret, true);
44729 uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageProvider"))) TS_OnionMessenger_as_OnionMessageProvider(uint64_t this_arg) {
44730 LDKOnionMessenger this_arg_conv;
44731 this_arg_conv.inner = untag_ptr(this_arg);
44732 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44734 this_arg_conv.is_owned = false;
44735 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
44736 *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
44737 return tag_ptr(ret_ret, true);
44740 static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
44741 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
44742 *ret_ret = CustomOnionMessageContents_clone(arg);
44743 return tag_ptr(ret_ret, true);
44745 int64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone_ptr"))) TS_CustomOnionMessageContents_clone_ptr(uint64_t arg) {
44746 void* arg_ptr = untag_ptr(arg);
44747 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
44748 LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
44749 int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
44753 uint64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone"))) TS_CustomOnionMessageContents_clone(uint64_t orig) {
44754 void* orig_ptr = untag_ptr(orig);
44755 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
44756 LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
44757 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
44758 *ret_ret = CustomOnionMessageContents_clone(orig_conv);
44759 return tag_ptr(ret_ret, true);
44762 void __attribute__((export_name("TS_CustomOnionMessageContents_free"))) TS_CustomOnionMessageContents_free(uint64_t this_ptr) {
44763 if (!ptr_is_owned(this_ptr)) return;
44764 void* this_ptr_ptr = untag_ptr(this_ptr);
44765 CHECK_ACCESS(this_ptr_ptr);
44766 LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
44767 FREE(untag_ptr(this_ptr));
44768 CustomOnionMessageContents_free(this_ptr_conv);
44771 void __attribute__((export_name("TS_RapidGossipSync_free"))) TS_RapidGossipSync_free(uint64_t this_obj) {
44772 LDKRapidGossipSync this_obj_conv;
44773 this_obj_conv.inner = untag_ptr(this_obj);
44774 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44776 RapidGossipSync_free(this_obj_conv);
44779 uint64_t __attribute__((export_name("TS_RapidGossipSync_new"))) TS_RapidGossipSync_new(uint64_t network_graph) {
44780 LDKNetworkGraph network_graph_conv;
44781 network_graph_conv.inner = untag_ptr(network_graph);
44782 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44783 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44784 network_graph_conv.is_owned = false;
44785 LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv);
44786 uint64_t ret_ref = 0;
44787 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44788 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44792 uint64_t __attribute__((export_name("TS_RapidGossipSync_update_network_graph"))) TS_RapidGossipSync_update_network_graph(uint64_t this_arg, int8_tArray update_data) {
44793 LDKRapidGossipSync this_arg_conv;
44794 this_arg_conv.inner = untag_ptr(this_arg);
44795 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44797 this_arg_conv.is_owned = false;
44798 LDKu8slice update_data_ref;
44799 update_data_ref.datalen = update_data->arr_len;
44800 update_data_ref.data = update_data->elems;
44801 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
44802 *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
44804 return tag_ptr(ret_conv, true);
44807 jboolean __attribute__((export_name("TS_RapidGossipSync_is_initial_sync_complete"))) TS_RapidGossipSync_is_initial_sync_complete(uint64_t this_arg) {
44808 LDKRapidGossipSync this_arg_conv;
44809 this_arg_conv.inner = untag_ptr(this_arg);
44810 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44812 this_arg_conv.is_owned = false;
44813 jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
44817 void __attribute__((export_name("TS_GraphSyncError_free"))) TS_GraphSyncError_free(uint64_t this_ptr) {
44818 if (!ptr_is_owned(this_ptr)) return;
44819 void* this_ptr_ptr = untag_ptr(this_ptr);
44820 CHECK_ACCESS(this_ptr_ptr);
44821 LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
44822 FREE(untag_ptr(this_ptr));
44823 GraphSyncError_free(this_ptr_conv);
44826 static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
44827 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
44828 *ret_copy = GraphSyncError_clone(arg);
44829 uint64_t ret_ref = tag_ptr(ret_copy, true);
44832 int64_t __attribute__((export_name("TS_GraphSyncError_clone_ptr"))) TS_GraphSyncError_clone_ptr(uint64_t arg) {
44833 LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
44834 int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
44838 uint64_t __attribute__((export_name("TS_GraphSyncError_clone"))) TS_GraphSyncError_clone(uint64_t orig) {
44839 LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
44840 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
44841 *ret_copy = GraphSyncError_clone(orig_conv);
44842 uint64_t ret_ref = tag_ptr(ret_copy, true);
44846 uint64_t __attribute__((export_name("TS_GraphSyncError_decode_error"))) TS_GraphSyncError_decode_error(uint64_t a) {
44847 void* a_ptr = untag_ptr(a);
44848 CHECK_ACCESS(a_ptr);
44849 LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
44850 a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
44851 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
44852 *ret_copy = GraphSyncError_decode_error(a_conv);
44853 uint64_t ret_ref = tag_ptr(ret_copy, true);
44857 uint64_t __attribute__((export_name("TS_GraphSyncError_lightning_error"))) TS_GraphSyncError_lightning_error(uint64_t a) {
44858 LDKLightningError a_conv;
44859 a_conv.inner = untag_ptr(a);
44860 a_conv.is_owned = ptr_is_owned(a);
44861 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44862 a_conv = LightningError_clone(&a_conv);
44863 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
44864 *ret_copy = GraphSyncError_lightning_error(a_conv);
44865 uint64_t ret_ref = tag_ptr(ret_copy, true);
44869 void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
44870 if (!ptr_is_owned(this_ptr)) return;
44871 void* this_ptr_ptr = untag_ptr(this_ptr);
44872 CHECK_ACCESS(this_ptr_ptr);
44873 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
44874 FREE(untag_ptr(this_ptr));
44875 ParseError_free(this_ptr_conv);
44878 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
44879 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44880 *ret_copy = ParseError_clone(arg);
44881 uint64_t ret_ref = tag_ptr(ret_copy, true);
44884 int64_t __attribute__((export_name("TS_ParseError_clone_ptr"))) TS_ParseError_clone_ptr(uint64_t arg) {
44885 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
44886 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
44890 uint64_t __attribute__((export_name("TS_ParseError_clone"))) TS_ParseError_clone(uint64_t orig) {
44891 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
44892 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44893 *ret_copy = ParseError_clone(orig_conv);
44894 uint64_t ret_ref = tag_ptr(ret_copy, true);
44898 uint64_t __attribute__((export_name("TS_ParseError_bech32_error"))) TS_ParseError_bech32_error(uint64_t a) {
44899 void* a_ptr = untag_ptr(a);
44900 CHECK_ACCESS(a_ptr);
44901 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
44902 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
44903 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44904 *ret_copy = ParseError_bech32_error(a_conv);
44905 uint64_t ret_ref = tag_ptr(ret_copy, true);
44909 uint64_t __attribute__((export_name("TS_ParseError_parse_amount_error"))) TS_ParseError_parse_amount_error(int32_t a) {
44911 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44912 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
44913 uint64_t ret_ref = tag_ptr(ret_copy, true);
44917 uint64_t __attribute__((export_name("TS_ParseError_malformed_signature"))) TS_ParseError_malformed_signature(uint32_t a) {
44918 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
44919 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44920 *ret_copy = ParseError_malformed_signature(a_conv);
44921 uint64_t ret_ref = tag_ptr(ret_copy, true);
44925 uint64_t __attribute__((export_name("TS_ParseError_bad_prefix"))) TS_ParseError_bad_prefix() {
44926 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44927 *ret_copy = ParseError_bad_prefix();
44928 uint64_t ret_ref = tag_ptr(ret_copy, true);
44932 uint64_t __attribute__((export_name("TS_ParseError_unknown_currency"))) TS_ParseError_unknown_currency() {
44933 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44934 *ret_copy = ParseError_unknown_currency();
44935 uint64_t ret_ref = tag_ptr(ret_copy, true);
44939 uint64_t __attribute__((export_name("TS_ParseError_unknown_si_prefix"))) TS_ParseError_unknown_si_prefix() {
44940 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44941 *ret_copy = ParseError_unknown_si_prefix();
44942 uint64_t ret_ref = tag_ptr(ret_copy, true);
44946 uint64_t __attribute__((export_name("TS_ParseError_malformed_hrp"))) TS_ParseError_malformed_hrp() {
44947 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44948 *ret_copy = ParseError_malformed_hrp();
44949 uint64_t ret_ref = tag_ptr(ret_copy, true);
44953 uint64_t __attribute__((export_name("TS_ParseError_too_short_data_part"))) TS_ParseError_too_short_data_part() {
44954 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44955 *ret_copy = ParseError_too_short_data_part();
44956 uint64_t ret_ref = tag_ptr(ret_copy, true);
44960 uint64_t __attribute__((export_name("TS_ParseError_unexpected_end_of_tagged_fields"))) TS_ParseError_unexpected_end_of_tagged_fields() {
44961 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44962 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
44963 uint64_t ret_ref = tag_ptr(ret_copy, true);
44967 uint64_t __attribute__((export_name("TS_ParseError_description_decode_error"))) TS_ParseError_description_decode_error(int32_t a) {
44969 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44970 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
44971 uint64_t ret_ref = tag_ptr(ret_copy, true);
44975 uint64_t __attribute__((export_name("TS_ParseError_padding_error"))) TS_ParseError_padding_error() {
44976 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44977 *ret_copy = ParseError_padding_error();
44978 uint64_t ret_ref = tag_ptr(ret_copy, true);
44982 uint64_t __attribute__((export_name("TS_ParseError_integer_overflow_error"))) TS_ParseError_integer_overflow_error() {
44983 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44984 *ret_copy = ParseError_integer_overflow_error();
44985 uint64_t ret_ref = tag_ptr(ret_copy, true);
44989 uint64_t __attribute__((export_name("TS_ParseError_invalid_seg_wit_program_length"))) TS_ParseError_invalid_seg_wit_program_length() {
44990 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44991 *ret_copy = ParseError_invalid_seg_wit_program_length();
44992 uint64_t ret_ref = tag_ptr(ret_copy, true);
44996 uint64_t __attribute__((export_name("TS_ParseError_invalid_pub_key_hash_length"))) TS_ParseError_invalid_pub_key_hash_length() {
44997 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
44998 *ret_copy = ParseError_invalid_pub_key_hash_length();
44999 uint64_t ret_ref = tag_ptr(ret_copy, true);
45003 uint64_t __attribute__((export_name("TS_ParseError_invalid_script_hash_length"))) TS_ParseError_invalid_script_hash_length() {
45004 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45005 *ret_copy = ParseError_invalid_script_hash_length();
45006 uint64_t ret_ref = tag_ptr(ret_copy, true);
45010 uint64_t __attribute__((export_name("TS_ParseError_invalid_recovery_id"))) TS_ParseError_invalid_recovery_id() {
45011 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45012 *ret_copy = ParseError_invalid_recovery_id();
45013 uint64_t ret_ref = tag_ptr(ret_copy, true);
45017 uint64_t __attribute__((export_name("TS_ParseError_invalid_slice_length"))) TS_ParseError_invalid_slice_length(jstring a) {
45018 LDKStr a_conv = str_ref_to_owned_c(a);
45019 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45020 *ret_copy = ParseError_invalid_slice_length(a_conv);
45021 uint64_t ret_ref = tag_ptr(ret_copy, true);
45025 uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip() {
45026 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45027 *ret_copy = ParseError_skip();
45028 uint64_t ret_ref = tag_ptr(ret_copy, true);
45032 jboolean __attribute__((export_name("TS_ParseError_eq"))) TS_ParseError_eq(uint64_t a, uint64_t b) {
45033 LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
45034 LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
45035 jboolean ret_conv = ParseError_eq(a_conv, b_conv);
45039 void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
45040 if (!ptr_is_owned(this_ptr)) return;
45041 void* this_ptr_ptr = untag_ptr(this_ptr);
45042 CHECK_ACCESS(this_ptr_ptr);
45043 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
45044 FREE(untag_ptr(this_ptr));
45045 ParseOrSemanticError_free(this_ptr_conv);
45048 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
45049 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45050 *ret_copy = ParseOrSemanticError_clone(arg);
45051 uint64_t ret_ref = tag_ptr(ret_copy, true);
45054 int64_t __attribute__((export_name("TS_ParseOrSemanticError_clone_ptr"))) TS_ParseOrSemanticError_clone_ptr(uint64_t arg) {
45055 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
45056 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
45060 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_clone"))) TS_ParseOrSemanticError_clone(uint64_t orig) {
45061 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
45062 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45063 *ret_copy = ParseOrSemanticError_clone(orig_conv);
45064 uint64_t ret_ref = tag_ptr(ret_copy, true);
45068 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_parse_error"))) TS_ParseOrSemanticError_parse_error(uint64_t a) {
45069 void* a_ptr = untag_ptr(a);
45070 CHECK_ACCESS(a_ptr);
45071 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
45072 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
45073 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45074 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
45075 uint64_t ret_ref = tag_ptr(ret_copy, true);
45079 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) TS_ParseOrSemanticError_semantic_error(uint32_t a) {
45080 LDKSemanticError a_conv = LDKSemanticError_from_js(a);
45081 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45082 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
45083 uint64_t ret_ref = tag_ptr(ret_copy, true);
45087 jboolean __attribute__((export_name("TS_ParseOrSemanticError_eq"))) TS_ParseOrSemanticError_eq(uint64_t a, uint64_t b) {
45088 LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
45089 LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
45090 jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
45094 void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
45095 LDKInvoice this_obj_conv;
45096 this_obj_conv.inner = untag_ptr(this_obj);
45097 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45099 Invoice_free(this_obj_conv);
45102 jboolean __attribute__((export_name("TS_Invoice_eq"))) TS_Invoice_eq(uint64_t a, uint64_t b) {
45104 a_conv.inner = untag_ptr(a);
45105 a_conv.is_owned = ptr_is_owned(a);
45106 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45107 a_conv.is_owned = false;
45109 b_conv.inner = untag_ptr(b);
45110 b_conv.is_owned = ptr_is_owned(b);
45111 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45112 b_conv.is_owned = false;
45113 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
45117 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
45118 LDKInvoice ret_var = Invoice_clone(arg);
45119 uint64_t ret_ref = 0;
45120 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45121 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45124 int64_t __attribute__((export_name("TS_Invoice_clone_ptr"))) TS_Invoice_clone_ptr(uint64_t arg) {
45125 LDKInvoice arg_conv;
45126 arg_conv.inner = untag_ptr(arg);
45127 arg_conv.is_owned = ptr_is_owned(arg);
45128 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45129 arg_conv.is_owned = false;
45130 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
45134 uint64_t __attribute__((export_name("TS_Invoice_clone"))) TS_Invoice_clone(uint64_t orig) {
45135 LDKInvoice orig_conv;
45136 orig_conv.inner = untag_ptr(orig);
45137 orig_conv.is_owned = ptr_is_owned(orig);
45138 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45139 orig_conv.is_owned = false;
45140 LDKInvoice ret_var = Invoice_clone(&orig_conv);
45141 uint64_t ret_ref = 0;
45142 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45143 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45147 int64_t __attribute__((export_name("TS_Invoice_hash"))) TS_Invoice_hash(uint64_t o) {
45149 o_conv.inner = untag_ptr(o);
45150 o_conv.is_owned = ptr_is_owned(o);
45151 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45152 o_conv.is_owned = false;
45153 int64_t ret_conv = Invoice_hash(&o_conv);
45157 void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
45158 LDKSignedRawInvoice this_obj_conv;
45159 this_obj_conv.inner = untag_ptr(this_obj);
45160 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45162 SignedRawInvoice_free(this_obj_conv);
45165 jboolean __attribute__((export_name("TS_SignedRawInvoice_eq"))) TS_SignedRawInvoice_eq(uint64_t a, uint64_t b) {
45166 LDKSignedRawInvoice a_conv;
45167 a_conv.inner = untag_ptr(a);
45168 a_conv.is_owned = ptr_is_owned(a);
45169 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45170 a_conv.is_owned = false;
45171 LDKSignedRawInvoice b_conv;
45172 b_conv.inner = untag_ptr(b);
45173 b_conv.is_owned = ptr_is_owned(b);
45174 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45175 b_conv.is_owned = false;
45176 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
45180 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
45181 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
45182 uint64_t ret_ref = 0;
45183 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45184 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45187 int64_t __attribute__((export_name("TS_SignedRawInvoice_clone_ptr"))) TS_SignedRawInvoice_clone_ptr(uint64_t arg) {
45188 LDKSignedRawInvoice arg_conv;
45189 arg_conv.inner = untag_ptr(arg);
45190 arg_conv.is_owned = ptr_is_owned(arg);
45191 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45192 arg_conv.is_owned = false;
45193 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
45197 uint64_t __attribute__((export_name("TS_SignedRawInvoice_clone"))) TS_SignedRawInvoice_clone(uint64_t orig) {
45198 LDKSignedRawInvoice orig_conv;
45199 orig_conv.inner = untag_ptr(orig);
45200 orig_conv.is_owned = ptr_is_owned(orig);
45201 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45202 orig_conv.is_owned = false;
45203 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
45204 uint64_t ret_ref = 0;
45205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45210 int64_t __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t o) {
45211 LDKSignedRawInvoice o_conv;
45212 o_conv.inner = untag_ptr(o);
45213 o_conv.is_owned = ptr_is_owned(o);
45214 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45215 o_conv.is_owned = false;
45216 int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
45220 void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
45221 LDKRawInvoice this_obj_conv;
45222 this_obj_conv.inner = untag_ptr(this_obj);
45223 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45225 RawInvoice_free(this_obj_conv);
45228 uint64_t __attribute__((export_name("TS_RawInvoice_get_data"))) TS_RawInvoice_get_data(uint64_t this_ptr) {
45229 LDKRawInvoice this_ptr_conv;
45230 this_ptr_conv.inner = untag_ptr(this_ptr);
45231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45233 this_ptr_conv.is_owned = false;
45234 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
45235 uint64_t ret_ref = 0;
45236 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45237 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45241 void __attribute__((export_name("TS_RawInvoice_set_data"))) TS_RawInvoice_set_data(uint64_t this_ptr, uint64_t val) {
45242 LDKRawInvoice this_ptr_conv;
45243 this_ptr_conv.inner = untag_ptr(this_ptr);
45244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45246 this_ptr_conv.is_owned = false;
45247 LDKRawDataPart val_conv;
45248 val_conv.inner = untag_ptr(val);
45249 val_conv.is_owned = ptr_is_owned(val);
45250 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45251 val_conv = RawDataPart_clone(&val_conv);
45252 RawInvoice_set_data(&this_ptr_conv, val_conv);
45255 jboolean __attribute__((export_name("TS_RawInvoice_eq"))) TS_RawInvoice_eq(uint64_t a, uint64_t b) {
45256 LDKRawInvoice a_conv;
45257 a_conv.inner = untag_ptr(a);
45258 a_conv.is_owned = ptr_is_owned(a);
45259 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45260 a_conv.is_owned = false;
45261 LDKRawInvoice b_conv;
45262 b_conv.inner = untag_ptr(b);
45263 b_conv.is_owned = ptr_is_owned(b);
45264 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45265 b_conv.is_owned = false;
45266 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
45270 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
45271 LDKRawInvoice ret_var = RawInvoice_clone(arg);
45272 uint64_t ret_ref = 0;
45273 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45274 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45277 int64_t __attribute__((export_name("TS_RawInvoice_clone_ptr"))) TS_RawInvoice_clone_ptr(uint64_t arg) {
45278 LDKRawInvoice arg_conv;
45279 arg_conv.inner = untag_ptr(arg);
45280 arg_conv.is_owned = ptr_is_owned(arg);
45281 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45282 arg_conv.is_owned = false;
45283 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
45287 uint64_t __attribute__((export_name("TS_RawInvoice_clone"))) TS_RawInvoice_clone(uint64_t orig) {
45288 LDKRawInvoice orig_conv;
45289 orig_conv.inner = untag_ptr(orig);
45290 orig_conv.is_owned = ptr_is_owned(orig);
45291 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45292 orig_conv.is_owned = false;
45293 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
45294 uint64_t ret_ref = 0;
45295 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45296 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45300 int64_t __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t o) {
45301 LDKRawInvoice o_conv;
45302 o_conv.inner = untag_ptr(o);
45303 o_conv.is_owned = ptr_is_owned(o);
45304 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45305 o_conv.is_owned = false;
45306 int64_t ret_conv = RawInvoice_hash(&o_conv);
45310 void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
45311 LDKRawDataPart this_obj_conv;
45312 this_obj_conv.inner = untag_ptr(this_obj);
45313 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45315 RawDataPart_free(this_obj_conv);
45318 uint64_t __attribute__((export_name("TS_RawDataPart_get_timestamp"))) TS_RawDataPart_get_timestamp(uint64_t this_ptr) {
45319 LDKRawDataPart this_ptr_conv;
45320 this_ptr_conv.inner = untag_ptr(this_ptr);
45321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45323 this_ptr_conv.is_owned = false;
45324 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
45325 uint64_t ret_ref = 0;
45326 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45327 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45331 void __attribute__((export_name("TS_RawDataPart_set_timestamp"))) TS_RawDataPart_set_timestamp(uint64_t this_ptr, uint64_t val) {
45332 LDKRawDataPart this_ptr_conv;
45333 this_ptr_conv.inner = untag_ptr(this_ptr);
45334 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45336 this_ptr_conv.is_owned = false;
45337 LDKPositiveTimestamp val_conv;
45338 val_conv.inner = untag_ptr(val);
45339 val_conv.is_owned = ptr_is_owned(val);
45340 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45341 val_conv = PositiveTimestamp_clone(&val_conv);
45342 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
45345 jboolean __attribute__((export_name("TS_RawDataPart_eq"))) TS_RawDataPart_eq(uint64_t a, uint64_t b) {
45346 LDKRawDataPart a_conv;
45347 a_conv.inner = untag_ptr(a);
45348 a_conv.is_owned = ptr_is_owned(a);
45349 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45350 a_conv.is_owned = false;
45351 LDKRawDataPart b_conv;
45352 b_conv.inner = untag_ptr(b);
45353 b_conv.is_owned = ptr_is_owned(b);
45354 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45355 b_conv.is_owned = false;
45356 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
45360 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
45361 LDKRawDataPart ret_var = RawDataPart_clone(arg);
45362 uint64_t ret_ref = 0;
45363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45367 int64_t __attribute__((export_name("TS_RawDataPart_clone_ptr"))) TS_RawDataPart_clone_ptr(uint64_t arg) {
45368 LDKRawDataPart arg_conv;
45369 arg_conv.inner = untag_ptr(arg);
45370 arg_conv.is_owned = ptr_is_owned(arg);
45371 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45372 arg_conv.is_owned = false;
45373 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
45377 uint64_t __attribute__((export_name("TS_RawDataPart_clone"))) TS_RawDataPart_clone(uint64_t orig) {
45378 LDKRawDataPart orig_conv;
45379 orig_conv.inner = untag_ptr(orig);
45380 orig_conv.is_owned = ptr_is_owned(orig);
45381 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45382 orig_conv.is_owned = false;
45383 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
45384 uint64_t ret_ref = 0;
45385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45390 int64_t __attribute__((export_name("TS_RawDataPart_hash"))) TS_RawDataPart_hash(uint64_t o) {
45391 LDKRawDataPart o_conv;
45392 o_conv.inner = untag_ptr(o);
45393 o_conv.is_owned = ptr_is_owned(o);
45394 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45395 o_conv.is_owned = false;
45396 int64_t ret_conv = RawDataPart_hash(&o_conv);
45400 void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
45401 LDKPositiveTimestamp this_obj_conv;
45402 this_obj_conv.inner = untag_ptr(this_obj);
45403 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45405 PositiveTimestamp_free(this_obj_conv);
45408 jboolean __attribute__((export_name("TS_PositiveTimestamp_eq"))) TS_PositiveTimestamp_eq(uint64_t a, uint64_t b) {
45409 LDKPositiveTimestamp a_conv;
45410 a_conv.inner = untag_ptr(a);
45411 a_conv.is_owned = ptr_is_owned(a);
45412 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45413 a_conv.is_owned = false;
45414 LDKPositiveTimestamp b_conv;
45415 b_conv.inner = untag_ptr(b);
45416 b_conv.is_owned = ptr_is_owned(b);
45417 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45418 b_conv.is_owned = false;
45419 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
45423 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
45424 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
45425 uint64_t ret_ref = 0;
45426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45427 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45430 int64_t __attribute__((export_name("TS_PositiveTimestamp_clone_ptr"))) TS_PositiveTimestamp_clone_ptr(uint64_t arg) {
45431 LDKPositiveTimestamp arg_conv;
45432 arg_conv.inner = untag_ptr(arg);
45433 arg_conv.is_owned = ptr_is_owned(arg);
45434 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45435 arg_conv.is_owned = false;
45436 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
45440 uint64_t __attribute__((export_name("TS_PositiveTimestamp_clone"))) TS_PositiveTimestamp_clone(uint64_t orig) {
45441 LDKPositiveTimestamp orig_conv;
45442 orig_conv.inner = untag_ptr(orig);
45443 orig_conv.is_owned = ptr_is_owned(orig);
45444 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45445 orig_conv.is_owned = false;
45446 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
45447 uint64_t ret_ref = 0;
45448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45453 int64_t __attribute__((export_name("TS_PositiveTimestamp_hash"))) TS_PositiveTimestamp_hash(uint64_t o) {
45454 LDKPositiveTimestamp o_conv;
45455 o_conv.inner = untag_ptr(o);
45456 o_conv.is_owned = ptr_is_owned(o);
45457 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45458 o_conv.is_owned = false;
45459 int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
45463 uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
45464 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
45465 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
45469 uint32_t __attribute__((export_name("TS_SiPrefix_milli"))) TS_SiPrefix_milli() {
45470 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
45474 uint32_t __attribute__((export_name("TS_SiPrefix_micro"))) TS_SiPrefix_micro() {
45475 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
45479 uint32_t __attribute__((export_name("TS_SiPrefix_nano"))) TS_SiPrefix_nano() {
45480 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
45484 uint32_t __attribute__((export_name("TS_SiPrefix_pico"))) TS_SiPrefix_pico() {
45485 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
45489 jboolean __attribute__((export_name("TS_SiPrefix_eq"))) TS_SiPrefix_eq(uint64_t a, uint64_t b) {
45490 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
45491 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
45492 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
45496 int64_t __attribute__((export_name("TS_SiPrefix_hash"))) TS_SiPrefix_hash(uint64_t o) {
45497 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
45498 int64_t ret_conv = SiPrefix_hash(o_conv);
45502 int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
45503 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
45504 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
45508 uint32_t __attribute__((export_name("TS_Currency_clone"))) TS_Currency_clone(uint64_t orig) {
45509 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
45510 uint32_t ret_conv = LDKCurrency_to_js(Currency_clone(orig_conv));
45514 uint32_t __attribute__((export_name("TS_Currency_bitcoin"))) TS_Currency_bitcoin() {
45515 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
45519 uint32_t __attribute__((export_name("TS_Currency_bitcoin_testnet"))) TS_Currency_bitcoin_testnet() {
45520 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
45524 uint32_t __attribute__((export_name("TS_Currency_regtest"))) TS_Currency_regtest() {
45525 uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
45529 uint32_t __attribute__((export_name("TS_Currency_simnet"))) TS_Currency_simnet() {
45530 uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
45534 uint32_t __attribute__((export_name("TS_Currency_signet"))) TS_Currency_signet() {
45535 uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
45539 int64_t __attribute__((export_name("TS_Currency_hash"))) TS_Currency_hash(uint64_t o) {
45540 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
45541 int64_t ret_conv = Currency_hash(o_conv);
45545 jboolean __attribute__((export_name("TS_Currency_eq"))) TS_Currency_eq(uint64_t a, uint64_t b) {
45546 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
45547 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
45548 jboolean ret_conv = Currency_eq(a_conv, b_conv);
45552 void __attribute__((export_name("TS_Sha256_free"))) TS_Sha256_free(uint64_t this_obj) {
45553 LDKSha256 this_obj_conv;
45554 this_obj_conv.inner = untag_ptr(this_obj);
45555 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45557 Sha256_free(this_obj_conv);
45560 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
45561 LDKSha256 ret_var = Sha256_clone(arg);
45562 uint64_t ret_ref = 0;
45563 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45564 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45567 int64_t __attribute__((export_name("TS_Sha256_clone_ptr"))) TS_Sha256_clone_ptr(uint64_t arg) {
45568 LDKSha256 arg_conv;
45569 arg_conv.inner = untag_ptr(arg);
45570 arg_conv.is_owned = ptr_is_owned(arg);
45571 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45572 arg_conv.is_owned = false;
45573 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
45577 uint64_t __attribute__((export_name("TS_Sha256_clone"))) TS_Sha256_clone(uint64_t orig) {
45578 LDKSha256 orig_conv;
45579 orig_conv.inner = untag_ptr(orig);
45580 orig_conv.is_owned = ptr_is_owned(orig);
45581 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45582 orig_conv.is_owned = false;
45583 LDKSha256 ret_var = Sha256_clone(&orig_conv);
45584 uint64_t ret_ref = 0;
45585 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45586 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45590 int64_t __attribute__((export_name("TS_Sha256_hash"))) TS_Sha256_hash(uint64_t o) {
45592 o_conv.inner = untag_ptr(o);
45593 o_conv.is_owned = ptr_is_owned(o);
45594 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45595 o_conv.is_owned = false;
45596 int64_t ret_conv = Sha256_hash(&o_conv);
45600 jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, uint64_t b) {
45602 a_conv.inner = untag_ptr(a);
45603 a_conv.is_owned = ptr_is_owned(a);
45604 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45605 a_conv.is_owned = false;
45607 b_conv.inner = untag_ptr(b);
45608 b_conv.is_owned = ptr_is_owned(b);
45609 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45610 b_conv.is_owned = false;
45611 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
45615 void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) {
45616 LDKDescription this_obj_conv;
45617 this_obj_conv.inner = untag_ptr(this_obj);
45618 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45620 Description_free(this_obj_conv);
45623 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
45624 LDKDescription ret_var = Description_clone(arg);
45625 uint64_t ret_ref = 0;
45626 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45627 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45630 int64_t __attribute__((export_name("TS_Description_clone_ptr"))) TS_Description_clone_ptr(uint64_t arg) {
45631 LDKDescription arg_conv;
45632 arg_conv.inner = untag_ptr(arg);
45633 arg_conv.is_owned = ptr_is_owned(arg);
45634 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45635 arg_conv.is_owned = false;
45636 int64_t ret_conv = Description_clone_ptr(&arg_conv);
45640 uint64_t __attribute__((export_name("TS_Description_clone"))) TS_Description_clone(uint64_t orig) {
45641 LDKDescription orig_conv;
45642 orig_conv.inner = untag_ptr(orig);
45643 orig_conv.is_owned = ptr_is_owned(orig);
45644 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45645 orig_conv.is_owned = false;
45646 LDKDescription ret_var = Description_clone(&orig_conv);
45647 uint64_t ret_ref = 0;
45648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45653 int64_t __attribute__((export_name("TS_Description_hash"))) TS_Description_hash(uint64_t o) {
45654 LDKDescription o_conv;
45655 o_conv.inner = untag_ptr(o);
45656 o_conv.is_owned = ptr_is_owned(o);
45657 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45658 o_conv.is_owned = false;
45659 int64_t ret_conv = Description_hash(&o_conv);
45663 jboolean __attribute__((export_name("TS_Description_eq"))) TS_Description_eq(uint64_t a, uint64_t b) {
45664 LDKDescription a_conv;
45665 a_conv.inner = untag_ptr(a);
45666 a_conv.is_owned = ptr_is_owned(a);
45667 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45668 a_conv.is_owned = false;
45669 LDKDescription b_conv;
45670 b_conv.inner = untag_ptr(b);
45671 b_conv.is_owned = ptr_is_owned(b);
45672 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45673 b_conv.is_owned = false;
45674 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
45678 void __attribute__((export_name("TS_PayeePubKey_free"))) TS_PayeePubKey_free(uint64_t this_obj) {
45679 LDKPayeePubKey this_obj_conv;
45680 this_obj_conv.inner = untag_ptr(this_obj);
45681 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45683 PayeePubKey_free(this_obj_conv);
45686 int8_tArray __attribute__((export_name("TS_PayeePubKey_get_a"))) TS_PayeePubKey_get_a(uint64_t this_ptr) {
45687 LDKPayeePubKey this_ptr_conv;
45688 this_ptr_conv.inner = untag_ptr(this_ptr);
45689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45691 this_ptr_conv.is_owned = false;
45692 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
45693 memcpy(ret_arr->elems, PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
45697 void __attribute__((export_name("TS_PayeePubKey_set_a"))) TS_PayeePubKey_set_a(uint64_t this_ptr, int8_tArray val) {
45698 LDKPayeePubKey this_ptr_conv;
45699 this_ptr_conv.inner = untag_ptr(this_ptr);
45700 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45702 this_ptr_conv.is_owned = false;
45703 LDKPublicKey val_ref;
45704 CHECK(val->arr_len == 33);
45705 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
45706 PayeePubKey_set_a(&this_ptr_conv, val_ref);
45709 uint64_t __attribute__((export_name("TS_PayeePubKey_new"))) TS_PayeePubKey_new(int8_tArray a_arg) {
45710 LDKPublicKey a_arg_ref;
45711 CHECK(a_arg->arr_len == 33);
45712 memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg);
45713 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
45714 uint64_t ret_ref = 0;
45715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45720 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
45721 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
45722 uint64_t ret_ref = 0;
45723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45727 int64_t __attribute__((export_name("TS_PayeePubKey_clone_ptr"))) TS_PayeePubKey_clone_ptr(uint64_t arg) {
45728 LDKPayeePubKey arg_conv;
45729 arg_conv.inner = untag_ptr(arg);
45730 arg_conv.is_owned = ptr_is_owned(arg);
45731 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45732 arg_conv.is_owned = false;
45733 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
45737 uint64_t __attribute__((export_name("TS_PayeePubKey_clone"))) TS_PayeePubKey_clone(uint64_t orig) {
45738 LDKPayeePubKey orig_conv;
45739 orig_conv.inner = untag_ptr(orig);
45740 orig_conv.is_owned = ptr_is_owned(orig);
45741 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45742 orig_conv.is_owned = false;
45743 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
45744 uint64_t ret_ref = 0;
45745 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45746 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45750 int64_t __attribute__((export_name("TS_PayeePubKey_hash"))) TS_PayeePubKey_hash(uint64_t o) {
45751 LDKPayeePubKey o_conv;
45752 o_conv.inner = untag_ptr(o);
45753 o_conv.is_owned = ptr_is_owned(o);
45754 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45755 o_conv.is_owned = false;
45756 int64_t ret_conv = PayeePubKey_hash(&o_conv);
45760 jboolean __attribute__((export_name("TS_PayeePubKey_eq"))) TS_PayeePubKey_eq(uint64_t a, uint64_t b) {
45761 LDKPayeePubKey a_conv;
45762 a_conv.inner = untag_ptr(a);
45763 a_conv.is_owned = ptr_is_owned(a);
45764 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45765 a_conv.is_owned = false;
45766 LDKPayeePubKey b_conv;
45767 b_conv.inner = untag_ptr(b);
45768 b_conv.is_owned = ptr_is_owned(b);
45769 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45770 b_conv.is_owned = false;
45771 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
45775 void __attribute__((export_name("TS_ExpiryTime_free"))) TS_ExpiryTime_free(uint64_t this_obj) {
45776 LDKExpiryTime this_obj_conv;
45777 this_obj_conv.inner = untag_ptr(this_obj);
45778 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45780 ExpiryTime_free(this_obj_conv);
45783 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
45784 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
45785 uint64_t ret_ref = 0;
45786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45790 int64_t __attribute__((export_name("TS_ExpiryTime_clone_ptr"))) TS_ExpiryTime_clone_ptr(uint64_t arg) {
45791 LDKExpiryTime arg_conv;
45792 arg_conv.inner = untag_ptr(arg);
45793 arg_conv.is_owned = ptr_is_owned(arg);
45794 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45795 arg_conv.is_owned = false;
45796 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
45800 uint64_t __attribute__((export_name("TS_ExpiryTime_clone"))) TS_ExpiryTime_clone(uint64_t orig) {
45801 LDKExpiryTime orig_conv;
45802 orig_conv.inner = untag_ptr(orig);
45803 orig_conv.is_owned = ptr_is_owned(orig);
45804 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45805 orig_conv.is_owned = false;
45806 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
45807 uint64_t ret_ref = 0;
45808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45813 int64_t __attribute__((export_name("TS_ExpiryTime_hash"))) TS_ExpiryTime_hash(uint64_t o) {
45814 LDKExpiryTime o_conv;
45815 o_conv.inner = untag_ptr(o);
45816 o_conv.is_owned = ptr_is_owned(o);
45817 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45818 o_conv.is_owned = false;
45819 int64_t ret_conv = ExpiryTime_hash(&o_conv);
45823 jboolean __attribute__((export_name("TS_ExpiryTime_eq"))) TS_ExpiryTime_eq(uint64_t a, uint64_t b) {
45824 LDKExpiryTime a_conv;
45825 a_conv.inner = untag_ptr(a);
45826 a_conv.is_owned = ptr_is_owned(a);
45827 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45828 a_conv.is_owned = false;
45829 LDKExpiryTime b_conv;
45830 b_conv.inner = untag_ptr(b);
45831 b_conv.is_owned = ptr_is_owned(b);
45832 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45833 b_conv.is_owned = false;
45834 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
45838 void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
45839 LDKMinFinalCltvExpiry this_obj_conv;
45840 this_obj_conv.inner = untag_ptr(this_obj);
45841 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45842 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45843 MinFinalCltvExpiry_free(this_obj_conv);
45846 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
45847 LDKMinFinalCltvExpiry this_ptr_conv;
45848 this_ptr_conv.inner = untag_ptr(this_ptr);
45849 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45851 this_ptr_conv.is_owned = false;
45852 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
45856 void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
45857 LDKMinFinalCltvExpiry this_ptr_conv;
45858 this_ptr_conv.inner = untag_ptr(this_ptr);
45859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45861 this_ptr_conv.is_owned = false;
45862 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
45865 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
45866 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
45867 uint64_t ret_ref = 0;
45868 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45869 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45873 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
45874 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
45875 uint64_t ret_ref = 0;
45876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45880 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
45881 LDKMinFinalCltvExpiry arg_conv;
45882 arg_conv.inner = untag_ptr(arg);
45883 arg_conv.is_owned = ptr_is_owned(arg);
45884 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45885 arg_conv.is_owned = false;
45886 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
45890 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
45891 LDKMinFinalCltvExpiry orig_conv;
45892 orig_conv.inner = untag_ptr(orig);
45893 orig_conv.is_owned = ptr_is_owned(orig);
45894 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45895 orig_conv.is_owned = false;
45896 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
45897 uint64_t ret_ref = 0;
45898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45903 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
45904 LDKMinFinalCltvExpiry o_conv;
45905 o_conv.inner = untag_ptr(o);
45906 o_conv.is_owned = ptr_is_owned(o);
45907 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45908 o_conv.is_owned = false;
45909 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
45913 jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
45914 LDKMinFinalCltvExpiry a_conv;
45915 a_conv.inner = untag_ptr(a);
45916 a_conv.is_owned = ptr_is_owned(a);
45917 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45918 a_conv.is_owned = false;
45919 LDKMinFinalCltvExpiry b_conv;
45920 b_conv.inner = untag_ptr(b);
45921 b_conv.is_owned = ptr_is_owned(b);
45922 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45923 b_conv.is_owned = false;
45924 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
45928 void __attribute__((export_name("TS_Fallback_free"))) TS_Fallback_free(uint64_t this_ptr) {
45929 if (!ptr_is_owned(this_ptr)) return;
45930 void* this_ptr_ptr = untag_ptr(this_ptr);
45931 CHECK_ACCESS(this_ptr_ptr);
45932 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
45933 FREE(untag_ptr(this_ptr));
45934 Fallback_free(this_ptr_conv);
45937 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
45938 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
45939 *ret_copy = Fallback_clone(arg);
45940 uint64_t ret_ref = tag_ptr(ret_copy, true);
45943 int64_t __attribute__((export_name("TS_Fallback_clone_ptr"))) TS_Fallback_clone_ptr(uint64_t arg) {
45944 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
45945 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
45949 uint64_t __attribute__((export_name("TS_Fallback_clone"))) TS_Fallback_clone(uint64_t orig) {
45950 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
45951 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
45952 *ret_copy = Fallback_clone(orig_conv);
45953 uint64_t ret_ref = tag_ptr(ret_copy, true);
45957 uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
45959 LDKCVec_u8Z program_ref;
45960 program_ref.datalen = program->arr_len;
45961 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
45962 memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
45963 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
45964 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
45965 uint64_t ret_ref = tag_ptr(ret_copy, true);
45969 uint64_t __attribute__((export_name("TS_Fallback_pub_key_hash"))) TS_Fallback_pub_key_hash(int8_tArray a) {
45970 LDKTwentyBytes a_ref;
45971 CHECK(a->arr_len == 20);
45972 memcpy(a_ref.data, a->elems, 20); FREE(a);
45973 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
45974 *ret_copy = Fallback_pub_key_hash(a_ref);
45975 uint64_t ret_ref = tag_ptr(ret_copy, true);
45979 uint64_t __attribute__((export_name("TS_Fallback_script_hash"))) TS_Fallback_script_hash(int8_tArray a) {
45980 LDKTwentyBytes a_ref;
45981 CHECK(a->arr_len == 20);
45982 memcpy(a_ref.data, a->elems, 20); FREE(a);
45983 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
45984 *ret_copy = Fallback_script_hash(a_ref);
45985 uint64_t ret_ref = tag_ptr(ret_copy, true);
45989 int64_t __attribute__((export_name("TS_Fallback_hash"))) TS_Fallback_hash(uint64_t o) {
45990 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
45991 int64_t ret_conv = Fallback_hash(o_conv);
45995 jboolean __attribute__((export_name("TS_Fallback_eq"))) TS_Fallback_eq(uint64_t a, uint64_t b) {
45996 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
45997 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
45998 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
46002 void __attribute__((export_name("TS_InvoiceSignature_free"))) TS_InvoiceSignature_free(uint64_t this_obj) {
46003 LDKInvoiceSignature this_obj_conv;
46004 this_obj_conv.inner = untag_ptr(this_obj);
46005 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46007 InvoiceSignature_free(this_obj_conv);
46010 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
46011 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
46012 uint64_t ret_ref = 0;
46013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46017 int64_t __attribute__((export_name("TS_InvoiceSignature_clone_ptr"))) TS_InvoiceSignature_clone_ptr(uint64_t arg) {
46018 LDKInvoiceSignature arg_conv;
46019 arg_conv.inner = untag_ptr(arg);
46020 arg_conv.is_owned = ptr_is_owned(arg);
46021 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46022 arg_conv.is_owned = false;
46023 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
46027 uint64_t __attribute__((export_name("TS_InvoiceSignature_clone"))) TS_InvoiceSignature_clone(uint64_t orig) {
46028 LDKInvoiceSignature orig_conv;
46029 orig_conv.inner = untag_ptr(orig);
46030 orig_conv.is_owned = ptr_is_owned(orig);
46031 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46032 orig_conv.is_owned = false;
46033 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
46034 uint64_t ret_ref = 0;
46035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46036 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46040 int64_t __attribute__((export_name("TS_InvoiceSignature_hash"))) TS_InvoiceSignature_hash(uint64_t o) {
46041 LDKInvoiceSignature o_conv;
46042 o_conv.inner = untag_ptr(o);
46043 o_conv.is_owned = ptr_is_owned(o);
46044 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46045 o_conv.is_owned = false;
46046 int64_t ret_conv = InvoiceSignature_hash(&o_conv);
46050 jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
46051 LDKInvoiceSignature a_conv;
46052 a_conv.inner = untag_ptr(a);
46053 a_conv.is_owned = ptr_is_owned(a);
46054 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46055 a_conv.is_owned = false;
46056 LDKInvoiceSignature b_conv;
46057 b_conv.inner = untag_ptr(b);
46058 b_conv.is_owned = ptr_is_owned(b);
46059 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46060 b_conv.is_owned = false;
46061 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
46065 void __attribute__((export_name("TS_PrivateRoute_free"))) TS_PrivateRoute_free(uint64_t this_obj) {
46066 LDKPrivateRoute this_obj_conv;
46067 this_obj_conv.inner = untag_ptr(this_obj);
46068 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46070 PrivateRoute_free(this_obj_conv);
46073 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
46074 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
46075 uint64_t ret_ref = 0;
46076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46080 int64_t __attribute__((export_name("TS_PrivateRoute_clone_ptr"))) TS_PrivateRoute_clone_ptr(uint64_t arg) {
46081 LDKPrivateRoute arg_conv;
46082 arg_conv.inner = untag_ptr(arg);
46083 arg_conv.is_owned = ptr_is_owned(arg);
46084 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46085 arg_conv.is_owned = false;
46086 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
46090 uint64_t __attribute__((export_name("TS_PrivateRoute_clone"))) TS_PrivateRoute_clone(uint64_t orig) {
46091 LDKPrivateRoute orig_conv;
46092 orig_conv.inner = untag_ptr(orig);
46093 orig_conv.is_owned = ptr_is_owned(orig);
46094 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46095 orig_conv.is_owned = false;
46096 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
46097 uint64_t ret_ref = 0;
46098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46103 int64_t __attribute__((export_name("TS_PrivateRoute_hash"))) TS_PrivateRoute_hash(uint64_t o) {
46104 LDKPrivateRoute o_conv;
46105 o_conv.inner = untag_ptr(o);
46106 o_conv.is_owned = ptr_is_owned(o);
46107 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46108 o_conv.is_owned = false;
46109 int64_t ret_conv = PrivateRoute_hash(&o_conv);
46113 jboolean __attribute__((export_name("TS_PrivateRoute_eq"))) TS_PrivateRoute_eq(uint64_t a, uint64_t b) {
46114 LDKPrivateRoute a_conv;
46115 a_conv.inner = untag_ptr(a);
46116 a_conv.is_owned = ptr_is_owned(a);
46117 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46118 a_conv.is_owned = false;
46119 LDKPrivateRoute b_conv;
46120 b_conv.inner = untag_ptr(b);
46121 b_conv.is_owned = ptr_is_owned(b);
46122 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46123 b_conv.is_owned = false;
46124 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
46128 uint64_t __attribute__((export_name("TS_SignedRawInvoice_into_parts"))) TS_SignedRawInvoice_into_parts(uint64_t this_arg) {
46129 LDKSignedRawInvoice this_arg_conv;
46130 this_arg_conv.inner = untag_ptr(this_arg);
46131 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46133 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
46134 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
46135 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
46136 return tag_ptr(ret_conv, true);
46139 uint64_t __attribute__((export_name("TS_SignedRawInvoice_raw_invoice"))) TS_SignedRawInvoice_raw_invoice(uint64_t this_arg) {
46140 LDKSignedRawInvoice this_arg_conv;
46141 this_arg_conv.inner = untag_ptr(this_arg);
46142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46144 this_arg_conv.is_owned = false;
46145 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
46146 uint64_t ret_ref = 0;
46147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46152 int8_tArray __attribute__((export_name("TS_SignedRawInvoice_signable_hash"))) TS_SignedRawInvoice_signable_hash(uint64_t this_arg) {
46153 LDKSignedRawInvoice this_arg_conv;
46154 this_arg_conv.inner = untag_ptr(this_arg);
46155 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46157 this_arg_conv.is_owned = false;
46158 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
46159 memcpy(ret_arr->elems, *SignedRawInvoice_signable_hash(&this_arg_conv), 32);
46163 uint64_t __attribute__((export_name("TS_SignedRawInvoice_signature"))) TS_SignedRawInvoice_signature(uint64_t this_arg) {
46164 LDKSignedRawInvoice this_arg_conv;
46165 this_arg_conv.inner = untag_ptr(this_arg);
46166 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46168 this_arg_conv.is_owned = false;
46169 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
46170 uint64_t ret_ref = 0;
46171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46176 uint64_t __attribute__((export_name("TS_SignedRawInvoice_recover_payee_pub_key"))) TS_SignedRawInvoice_recover_payee_pub_key(uint64_t this_arg) {
46177 LDKSignedRawInvoice this_arg_conv;
46178 this_arg_conv.inner = untag_ptr(this_arg);
46179 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46181 this_arg_conv.is_owned = false;
46182 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
46183 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
46184 return tag_ptr(ret_conv, true);
46187 jboolean __attribute__((export_name("TS_SignedRawInvoice_check_signature"))) TS_SignedRawInvoice_check_signature(uint64_t this_arg) {
46188 LDKSignedRawInvoice this_arg_conv;
46189 this_arg_conv.inner = untag_ptr(this_arg);
46190 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46192 this_arg_conv.is_owned = false;
46193 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
46197 int8_tArray __attribute__((export_name("TS_RawInvoice_signable_hash"))) TS_RawInvoice_signable_hash(uint64_t this_arg) {
46198 LDKRawInvoice this_arg_conv;
46199 this_arg_conv.inner = untag_ptr(this_arg);
46200 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46202 this_arg_conv.is_owned = false;
46203 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
46204 memcpy(ret_arr->elems, RawInvoice_signable_hash(&this_arg_conv).data, 32);
46208 uint64_t __attribute__((export_name("TS_RawInvoice_payment_hash"))) TS_RawInvoice_payment_hash(uint64_t this_arg) {
46209 LDKRawInvoice this_arg_conv;
46210 this_arg_conv.inner = untag_ptr(this_arg);
46211 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46213 this_arg_conv.is_owned = false;
46214 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
46215 uint64_t ret_ref = 0;
46216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46221 uint64_t __attribute__((export_name("TS_RawInvoice_description"))) TS_RawInvoice_description(uint64_t this_arg) {
46222 LDKRawInvoice this_arg_conv;
46223 this_arg_conv.inner = untag_ptr(this_arg);
46224 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46226 this_arg_conv.is_owned = false;
46227 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
46228 uint64_t ret_ref = 0;
46229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46234 uint64_t __attribute__((export_name("TS_RawInvoice_payee_pub_key"))) TS_RawInvoice_payee_pub_key(uint64_t this_arg) {
46235 LDKRawInvoice this_arg_conv;
46236 this_arg_conv.inner = untag_ptr(this_arg);
46237 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46239 this_arg_conv.is_owned = false;
46240 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
46241 uint64_t ret_ref = 0;
46242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46247 uint64_t __attribute__((export_name("TS_RawInvoice_description_hash"))) TS_RawInvoice_description_hash(uint64_t this_arg) {
46248 LDKRawInvoice this_arg_conv;
46249 this_arg_conv.inner = untag_ptr(this_arg);
46250 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46252 this_arg_conv.is_owned = false;
46253 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
46254 uint64_t ret_ref = 0;
46255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46260 uint64_t __attribute__((export_name("TS_RawInvoice_expiry_time"))) TS_RawInvoice_expiry_time(uint64_t this_arg) {
46261 LDKRawInvoice this_arg_conv;
46262 this_arg_conv.inner = untag_ptr(this_arg);
46263 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46265 this_arg_conv.is_owned = false;
46266 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
46267 uint64_t ret_ref = 0;
46268 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46269 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46273 uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
46274 LDKRawInvoice this_arg_conv;
46275 this_arg_conv.inner = untag_ptr(this_arg);
46276 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46278 this_arg_conv.is_owned = false;
46279 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
46280 uint64_t ret_ref = 0;
46281 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46282 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46286 int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_RawInvoice_payment_secret(uint64_t this_arg) {
46287 LDKRawInvoice this_arg_conv;
46288 this_arg_conv.inner = untag_ptr(this_arg);
46289 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46291 this_arg_conv.is_owned = false;
46292 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
46293 memcpy(ret_arr->elems, RawInvoice_payment_secret(&this_arg_conv).data, 32);
46297 uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) {
46298 LDKRawInvoice this_arg_conv;
46299 this_arg_conv.inner = untag_ptr(this_arg);
46300 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46302 this_arg_conv.is_owned = false;
46303 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
46304 uint64_t ret_ref = 0;
46305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46310 uint64_tArray __attribute__((export_name("TS_RawInvoice_private_routes"))) TS_RawInvoice_private_routes(uint64_t this_arg) {
46311 LDKRawInvoice this_arg_conv;
46312 this_arg_conv.inner = untag_ptr(this_arg);
46313 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46315 this_arg_conv.is_owned = false;
46316 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
46317 uint64_tArray ret_arr = NULL;
46318 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
46319 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
46320 for (size_t o = 0; o < ret_var.datalen; o++) {
46321 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
46322 uint64_t ret_conv_14_ref = 0;
46323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
46324 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
46325 ret_arr_ptr[o] = ret_conv_14_ref;
46328 FREE(ret_var.data);
46332 uint64_t __attribute__((export_name("TS_RawInvoice_amount_pico_btc"))) TS_RawInvoice_amount_pico_btc(uint64_t this_arg) {
46333 LDKRawInvoice this_arg_conv;
46334 this_arg_conv.inner = untag_ptr(this_arg);
46335 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46337 this_arg_conv.is_owned = false;
46338 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
46339 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
46340 uint64_t ret_ref = tag_ptr(ret_copy, true);
46344 uint32_t __attribute__((export_name("TS_RawInvoice_currency"))) TS_RawInvoice_currency(uint64_t this_arg) {
46345 LDKRawInvoice this_arg_conv;
46346 this_arg_conv.inner = untag_ptr(this_arg);
46347 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46349 this_arg_conv.is_owned = false;
46350 uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv));
46354 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_unix_timestamp"))) TS_PositiveTimestamp_from_unix_timestamp(int64_t unix_seconds) {
46355 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
46356 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
46357 return tag_ptr(ret_conv, true);
46360 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_duration_since_epoch"))) TS_PositiveTimestamp_from_duration_since_epoch(int64_t duration) {
46361 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
46362 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
46363 return tag_ptr(ret_conv, true);
46366 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_unix_timestamp"))) TS_PositiveTimestamp_as_unix_timestamp(uint64_t this_arg) {
46367 LDKPositiveTimestamp this_arg_conv;
46368 this_arg_conv.inner = untag_ptr(this_arg);
46369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46371 this_arg_conv.is_owned = false;
46372 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
46376 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoch"))) TS_PositiveTimestamp_as_duration_since_epoch(uint64_t this_arg) {
46377 LDKPositiveTimestamp 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 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
46386 uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) {
46387 LDKInvoice this_arg_conv;
46388 this_arg_conv.inner = untag_ptr(this_arg);
46389 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46391 this_arg_conv = Invoice_clone(&this_arg_conv);
46392 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
46393 uint64_t ret_ref = 0;
46394 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46395 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46399 uint64_t __attribute__((export_name("TS_Invoice_check_signature"))) TS_Invoice_check_signature(uint64_t this_arg) {
46400 LDKInvoice this_arg_conv;
46401 this_arg_conv.inner = untag_ptr(this_arg);
46402 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46404 this_arg_conv.is_owned = false;
46405 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
46406 *ret_conv = Invoice_check_signature(&this_arg_conv);
46407 return tag_ptr(ret_conv, true);
46410 uint64_t __attribute__((export_name("TS_Invoice_from_signed"))) TS_Invoice_from_signed(uint64_t signed_invoice) {
46411 LDKSignedRawInvoice signed_invoice_conv;
46412 signed_invoice_conv.inner = untag_ptr(signed_invoice);
46413 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
46414 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
46415 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
46416 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
46417 *ret_conv = Invoice_from_signed(signed_invoice_conv);
46418 return tag_ptr(ret_conv, true);
46421 int64_t __attribute__((export_name("TS_Invoice_duration_since_epoch"))) TS_Invoice_duration_since_epoch(uint64_t this_arg) {
46422 LDKInvoice this_arg_conv;
46423 this_arg_conv.inner = untag_ptr(this_arg);
46424 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46426 this_arg_conv.is_owned = false;
46427 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
46431 int8_tArray __attribute__((export_name("TS_Invoice_payment_hash"))) TS_Invoice_payment_hash(uint64_t this_arg) {
46432 LDKInvoice this_arg_conv;
46433 this_arg_conv.inner = untag_ptr(this_arg);
46434 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46436 this_arg_conv.is_owned = false;
46437 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
46438 memcpy(ret_arr->elems, *Invoice_payment_hash(&this_arg_conv), 32);
46442 int8_tArray __attribute__((export_name("TS_Invoice_payee_pub_key"))) TS_Invoice_payee_pub_key(uint64_t this_arg) {
46443 LDKInvoice this_arg_conv;
46444 this_arg_conv.inner = untag_ptr(this_arg);
46445 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46447 this_arg_conv.is_owned = false;
46448 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
46449 memcpy(ret_arr->elems, Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33);
46453 int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoice_payment_secret(uint64_t this_arg) {
46454 LDKInvoice this_arg_conv;
46455 this_arg_conv.inner = untag_ptr(this_arg);
46456 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46458 this_arg_conv.is_owned = false;
46459 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
46460 memcpy(ret_arr->elems, *Invoice_payment_secret(&this_arg_conv), 32);
46464 uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) {
46465 LDKInvoice this_arg_conv;
46466 this_arg_conv.inner = untag_ptr(this_arg);
46467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46469 this_arg_conv.is_owned = false;
46470 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
46471 uint64_t ret_ref = 0;
46472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46473 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46477 int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS_Invoice_recover_payee_pub_key(uint64_t this_arg) {
46478 LDKInvoice this_arg_conv;
46479 this_arg_conv.inner = untag_ptr(this_arg);
46480 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46482 this_arg_conv.is_owned = false;
46483 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
46484 memcpy(ret_arr->elems, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33);
46488 int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) {
46489 LDKInvoice this_arg_conv;
46490 this_arg_conv.inner = untag_ptr(this_arg);
46491 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46493 this_arg_conv.is_owned = false;
46494 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
46498 jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) {
46499 LDKInvoice this_arg_conv;
46500 this_arg_conv.inner = untag_ptr(this_arg);
46501 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46503 this_arg_conv.is_owned = false;
46504 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
46508 int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
46509 LDKInvoice 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 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
46518 uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) {
46519 LDKInvoice this_arg_conv;
46520 this_arg_conv.inner = untag_ptr(this_arg);
46521 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46523 this_arg_conv.is_owned = false;
46524 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
46525 uint64_tArray ret_arr = NULL;
46526 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
46527 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
46528 for (size_t o = 0; o < ret_var.datalen; o++) {
46529 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
46530 uint64_t ret_conv_14_ref = 0;
46531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
46532 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
46533 ret_arr_ptr[o] = ret_conv_14_ref;
46536 FREE(ret_var.data);
46540 uint64_tArray __attribute__((export_name("TS_Invoice_route_hints"))) TS_Invoice_route_hints(uint64_t this_arg) {
46541 LDKInvoice this_arg_conv;
46542 this_arg_conv.inner = untag_ptr(this_arg);
46543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46545 this_arg_conv.is_owned = false;
46546 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
46547 uint64_tArray ret_arr = NULL;
46548 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
46549 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
46550 for (size_t l = 0; l < ret_var.datalen; l++) {
46551 LDKRouteHint ret_conv_11_var = ret_var.data[l];
46552 uint64_t ret_conv_11_ref = 0;
46553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
46554 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
46555 ret_arr_ptr[l] = ret_conv_11_ref;
46558 FREE(ret_var.data);
46562 uint32_t __attribute__((export_name("TS_Invoice_currency"))) TS_Invoice_currency(uint64_t this_arg) {
46563 LDKInvoice this_arg_conv;
46564 this_arg_conv.inner = untag_ptr(this_arg);
46565 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46567 this_arg_conv.is_owned = false;
46568 uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv));
46572 uint64_t __attribute__((export_name("TS_Invoice_amount_milli_satoshis"))) TS_Invoice_amount_milli_satoshis(uint64_t this_arg) {
46573 LDKInvoice this_arg_conv;
46574 this_arg_conv.inner = untag_ptr(this_arg);
46575 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46577 this_arg_conv.is_owned = false;
46578 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
46579 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
46580 uint64_t ret_ref = tag_ptr(ret_copy, true);
46584 uint64_t __attribute__((export_name("TS_Description_new"))) TS_Description_new(jstring description) {
46585 LDKStr description_conv = str_ref_to_owned_c(description);
46586 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
46587 *ret_conv = Description_new(description_conv);
46588 return tag_ptr(ret_conv, true);
46591 jstring __attribute__((export_name("TS_Description_into_inner"))) TS_Description_into_inner(uint64_t this_arg) {
46592 LDKDescription this_arg_conv;
46593 this_arg_conv.inner = untag_ptr(this_arg);
46594 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46596 this_arg_conv = Description_clone(&this_arg_conv);
46597 LDKStr ret_str = Description_into_inner(this_arg_conv);
46598 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46603 uint64_t __attribute__((export_name("TS_ExpiryTime_from_seconds"))) TS_ExpiryTime_from_seconds(int64_t seconds) {
46604 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
46605 uint64_t ret_ref = 0;
46606 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46607 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46611 uint64_t __attribute__((export_name("TS_ExpiryTime_from_duration"))) TS_ExpiryTime_from_duration(int64_t duration) {
46612 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
46613 uint64_t ret_ref = 0;
46614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46619 int64_t __attribute__((export_name("TS_ExpiryTime_as_seconds"))) TS_ExpiryTime_as_seconds(uint64_t this_arg) {
46620 LDKExpiryTime this_arg_conv;
46621 this_arg_conv.inner = untag_ptr(this_arg);
46622 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46624 this_arg_conv.is_owned = false;
46625 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
46629 int64_t __attribute__((export_name("TS_ExpiryTime_as_duration"))) TS_ExpiryTime_as_duration(uint64_t this_arg) {
46630 LDKExpiryTime this_arg_conv;
46631 this_arg_conv.inner = untag_ptr(this_arg);
46632 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46634 this_arg_conv.is_owned = false;
46635 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
46639 uint64_t __attribute__((export_name("TS_PrivateRoute_new"))) TS_PrivateRoute_new(uint64_t hops) {
46640 LDKRouteHint hops_conv;
46641 hops_conv.inner = untag_ptr(hops);
46642 hops_conv.is_owned = ptr_is_owned(hops);
46643 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
46644 hops_conv = RouteHint_clone(&hops_conv);
46645 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
46646 *ret_conv = PrivateRoute_new(hops_conv);
46647 return tag_ptr(ret_conv, true);
46650 uint64_t __attribute__((export_name("TS_PrivateRoute_into_inner"))) TS_PrivateRoute_into_inner(uint64_t this_arg) {
46651 LDKPrivateRoute this_arg_conv;
46652 this_arg_conv.inner = untag_ptr(this_arg);
46653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46655 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
46656 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
46657 uint64_t ret_ref = 0;
46658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46659 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46663 uint32_t __attribute__((export_name("TS_CreationError_clone"))) TS_CreationError_clone(uint64_t orig) {
46664 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
46665 uint32_t ret_conv = LDKCreationError_to_js(CreationError_clone(orig_conv));
46669 uint32_t __attribute__((export_name("TS_CreationError_description_too_long"))) TS_CreationError_description_too_long() {
46670 uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
46674 uint32_t __attribute__((export_name("TS_CreationError_route_too_long"))) TS_CreationError_route_too_long() {
46675 uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
46679 uint32_t __attribute__((export_name("TS_CreationError_timestamp_out_of_bounds"))) TS_CreationError_timestamp_out_of_bounds() {
46680 uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
46684 uint32_t __attribute__((export_name("TS_CreationError_invalid_amount"))) TS_CreationError_invalid_amount() {
46685 uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
46689 uint32_t __attribute__((export_name("TS_CreationError_missing_route_hints"))) TS_CreationError_missing_route_hints() {
46690 uint32_t ret_conv = LDKCreationError_to_js(CreationError_missing_route_hints());
46694 jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
46695 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
46696 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
46697 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
46701 jstring __attribute__((export_name("TS_CreationError_to_str"))) TS_CreationError_to_str(uint64_t o) {
46702 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
46703 LDKStr ret_str = CreationError_to_str(o_conv);
46704 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46709 uint32_t __attribute__((export_name("TS_SemanticError_clone"))) TS_SemanticError_clone(uint64_t orig) {
46710 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
46711 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_clone(orig_conv));
46715 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_hash"))) TS_SemanticError_no_payment_hash() {
46716 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
46720 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_hashes"))) TS_SemanticError_multiple_payment_hashes() {
46721 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
46725 uint32_t __attribute__((export_name("TS_SemanticError_no_description"))) TS_SemanticError_no_description() {
46726 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
46730 uint32_t __attribute__((export_name("TS_SemanticError_multiple_descriptions"))) TS_SemanticError_multiple_descriptions() {
46731 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
46735 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_secret"))) TS_SemanticError_no_payment_secret() {
46736 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_secret());
46740 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_secrets"))) TS_SemanticError_multiple_payment_secrets() {
46741 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
46745 uint32_t __attribute__((export_name("TS_SemanticError_invalid_features"))) TS_SemanticError_invalid_features() {
46746 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
46750 uint32_t __attribute__((export_name("TS_SemanticError_invalid_recovery_id"))) TS_SemanticError_invalid_recovery_id() {
46751 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
46755 uint32_t __attribute__((export_name("TS_SemanticError_invalid_signature"))) TS_SemanticError_invalid_signature() {
46756 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
46760 uint32_t __attribute__((export_name("TS_SemanticError_imprecise_amount"))) TS_SemanticError_imprecise_amount() {
46761 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_imprecise_amount());
46765 jboolean __attribute__((export_name("TS_SemanticError_eq"))) TS_SemanticError_eq(uint64_t a, uint64_t b) {
46766 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
46767 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
46768 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
46772 jstring __attribute__((export_name("TS_SemanticError_to_str"))) TS_SemanticError_to_str(uint64_t o) {
46773 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
46774 LDKStr ret_str = SemanticError_to_str(o_conv);
46775 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46780 void __attribute__((export_name("TS_SignOrCreationError_free"))) TS_SignOrCreationError_free(uint64_t this_ptr) {
46781 if (!ptr_is_owned(this_ptr)) return;
46782 void* this_ptr_ptr = untag_ptr(this_ptr);
46783 CHECK_ACCESS(this_ptr_ptr);
46784 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
46785 FREE(untag_ptr(this_ptr));
46786 SignOrCreationError_free(this_ptr_conv);
46789 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
46790 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
46791 *ret_copy = SignOrCreationError_clone(arg);
46792 uint64_t ret_ref = tag_ptr(ret_copy, true);
46795 int64_t __attribute__((export_name("TS_SignOrCreationError_clone_ptr"))) TS_SignOrCreationError_clone_ptr(uint64_t arg) {
46796 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
46797 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
46801 uint64_t __attribute__((export_name("TS_SignOrCreationError_clone"))) TS_SignOrCreationError_clone(uint64_t orig) {
46802 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
46803 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
46804 *ret_copy = SignOrCreationError_clone(orig_conv);
46805 uint64_t ret_ref = tag_ptr(ret_copy, true);
46809 uint64_t __attribute__((export_name("TS_SignOrCreationError_sign_error"))) TS_SignOrCreationError_sign_error() {
46810 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
46811 *ret_copy = SignOrCreationError_sign_error();
46812 uint64_t ret_ref = tag_ptr(ret_copy, true);
46816 uint64_t __attribute__((export_name("TS_SignOrCreationError_creation_error"))) TS_SignOrCreationError_creation_error(uint32_t a) {
46817 LDKCreationError a_conv = LDKCreationError_from_js(a);
46818 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
46819 *ret_copy = SignOrCreationError_creation_error(a_conv);
46820 uint64_t ret_ref = tag_ptr(ret_copy, true);
46824 jboolean __attribute__((export_name("TS_SignOrCreationError_eq"))) TS_SignOrCreationError_eq(uint64_t a, uint64_t b) {
46825 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
46826 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
46827 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
46831 jstring __attribute__((export_name("TS_SignOrCreationError_to_str"))) TS_SignOrCreationError_to_str(uint64_t o) {
46832 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
46833 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
46834 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46839 void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
46840 LDKInvoicePayer this_obj_conv;
46841 this_obj_conv.inner = untag_ptr(this_obj);
46842 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46844 InvoicePayer_free(this_obj_conv);
46847 void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
46848 if (!ptr_is_owned(this_ptr)) return;
46849 void* this_ptr_ptr = untag_ptr(this_ptr);
46850 CHECK_ACCESS(this_ptr_ptr);
46851 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
46852 FREE(untag_ptr(this_ptr));
46853 Payer_free(this_ptr_conv);
46856 void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
46857 if (!ptr_is_owned(this_ptr)) return;
46858 void* this_ptr_ptr = untag_ptr(this_ptr);
46859 CHECK_ACCESS(this_ptr_ptr);
46860 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
46861 FREE(untag_ptr(this_ptr));
46862 Router_free(this_ptr_conv);
46865 void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
46866 if (!ptr_is_owned(this_ptr)) return;
46867 void* this_ptr_ptr = untag_ptr(this_ptr);
46868 CHECK_ACCESS(this_ptr_ptr);
46869 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
46870 FREE(untag_ptr(this_ptr));
46871 Retry_free(this_ptr_conv);
46874 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
46875 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46876 *ret_copy = Retry_clone(arg);
46877 uint64_t ret_ref = tag_ptr(ret_copy, true);
46880 int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
46881 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
46882 int64_t ret_conv = Retry_clone_ptr(arg_conv);
46886 uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
46887 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
46888 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46889 *ret_copy = Retry_clone(orig_conv);
46890 uint64_t ret_ref = tag_ptr(ret_copy, true);
46894 uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
46895 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46896 *ret_copy = Retry_attempts(a);
46897 uint64_t ret_ref = tag_ptr(ret_copy, true);
46901 jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
46902 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
46903 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
46904 jboolean ret_conv = Retry_eq(a_conv, b_conv);
46908 int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
46909 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
46910 int64_t ret_conv = Retry_hash(o_conv);
46914 void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
46915 if (!ptr_is_owned(this_ptr)) return;
46916 void* this_ptr_ptr = untag_ptr(this_ptr);
46917 CHECK_ACCESS(this_ptr_ptr);
46918 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
46919 FREE(untag_ptr(this_ptr));
46920 PaymentError_free(this_ptr_conv);
46923 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
46924 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
46925 *ret_copy = PaymentError_clone(arg);
46926 uint64_t ret_ref = tag_ptr(ret_copy, true);
46929 int64_t __attribute__((export_name("TS_PaymentError_clone_ptr"))) TS_PaymentError_clone_ptr(uint64_t arg) {
46930 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
46931 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
46935 uint64_t __attribute__((export_name("TS_PaymentError_clone"))) TS_PaymentError_clone(uint64_t orig) {
46936 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
46937 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
46938 *ret_copy = PaymentError_clone(orig_conv);
46939 uint64_t ret_ref = tag_ptr(ret_copy, true);
46943 uint64_t __attribute__((export_name("TS_PaymentError_invoice"))) TS_PaymentError_invoice(jstring a) {
46944 LDKStr a_conv = str_ref_to_owned_c(a);
46945 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
46946 *ret_copy = PaymentError_invoice(a_conv);
46947 uint64_t ret_ref = tag_ptr(ret_copy, true);
46951 uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
46952 LDKLightningError a_conv;
46953 a_conv.inner = untag_ptr(a);
46954 a_conv.is_owned = ptr_is_owned(a);
46955 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46956 a_conv = LightningError_clone(&a_conv);
46957 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
46958 *ret_copy = PaymentError_routing(a_conv);
46959 uint64_t ret_ref = tag_ptr(ret_copy, true);
46963 uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
46964 void* a_ptr = untag_ptr(a);
46965 CHECK_ACCESS(a_ptr);
46966 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
46967 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
46968 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
46969 *ret_copy = PaymentError_sending(a_conv);
46970 uint64_t ret_ref = tag_ptr(ret_copy, true);
46974 uint64_t __attribute__((export_name("TS_InvoicePayer_new"))) TS_InvoicePayer_new(uint64_t payer, uint64_t router, uint64_t logger, uint64_t event_handler, uint64_t retry) {
46975 void* payer_ptr = untag_ptr(payer);
46976 CHECK_ACCESS(payer_ptr);
46977 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
46978 if (payer_conv.free == LDKPayer_JCalls_free) {
46979 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46980 LDKPayer_JCalls_cloned(&payer_conv);
46982 void* router_ptr = untag_ptr(router);
46983 CHECK_ACCESS(router_ptr);
46984 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
46985 if (router_conv.free == LDKRouter_JCalls_free) {
46986 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46987 LDKRouter_JCalls_cloned(&router_conv);
46989 void* logger_ptr = untag_ptr(logger);
46990 CHECK_ACCESS(logger_ptr);
46991 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
46992 if (logger_conv.free == LDKLogger_JCalls_free) {
46993 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46994 LDKLogger_JCalls_cloned(&logger_conv);
46996 void* event_handler_ptr = untag_ptr(event_handler);
46997 CHECK_ACCESS(event_handler_ptr);
46998 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
46999 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
47000 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47001 LDKEventHandler_JCalls_cloned(&event_handler_conv);
47003 void* retry_ptr = untag_ptr(retry);
47004 CHECK_ACCESS(retry_ptr);
47005 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
47006 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
47007 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, logger_conv, event_handler_conv, retry_conv);
47008 uint64_t ret_ref = 0;
47009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47014 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
47015 LDKInvoicePayer this_arg_conv;
47016 this_arg_conv.inner = untag_ptr(this_arg);
47017 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47019 this_arg_conv.is_owned = false;
47020 LDKInvoice invoice_conv;
47021 invoice_conv.inner = untag_ptr(invoice);
47022 invoice_conv.is_owned = ptr_is_owned(invoice);
47023 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
47024 invoice_conv.is_owned = false;
47025 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47026 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
47027 return tag_ptr(ret_conv, true);
47030 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_zero_value_invoice"))) TS_InvoicePayer_pay_zero_value_invoice(uint64_t this_arg, uint64_t invoice, int64_t amount_msats) {
47031 LDKInvoicePayer this_arg_conv;
47032 this_arg_conv.inner = untag_ptr(this_arg);
47033 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47035 this_arg_conv.is_owned = false;
47036 LDKInvoice invoice_conv;
47037 invoice_conv.inner = untag_ptr(invoice);
47038 invoice_conv.is_owned = ptr_is_owned(invoice);
47039 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
47040 invoice_conv.is_owned = false;
47041 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47042 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
47043 return tag_ptr(ret_conv, true);
47046 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_pubkey"))) TS_InvoicePayer_pay_pubkey(uint64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
47047 LDKInvoicePayer this_arg_conv;
47048 this_arg_conv.inner = untag_ptr(this_arg);
47049 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47051 this_arg_conv.is_owned = false;
47052 LDKPublicKey pubkey_ref;
47053 CHECK(pubkey->arr_len == 33);
47054 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
47055 LDKThirtyTwoBytes payment_preimage_ref;
47056 CHECK(payment_preimage->arr_len == 32);
47057 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
47058 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47059 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
47060 return tag_ptr(ret_conv, true);
47063 void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
47064 LDKInvoicePayer this_arg_conv;
47065 this_arg_conv.inner = untag_ptr(this_arg);
47066 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47068 this_arg_conv.is_owned = false;
47069 unsigned char payment_hash_arr[32];
47070 CHECK(payment_hash->arr_len == 32);
47071 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
47072 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
47073 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
47076 uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
47077 LDKInvoicePayer this_arg_conv;
47078 this_arg_conv.inner = untag_ptr(this_arg);
47079 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47080 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47081 this_arg_conv.is_owned = false;
47082 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
47083 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
47084 return tag_ptr(ret_ret, true);
47087 void __attribute__((export_name("TS_InFlightHtlcs_free"))) TS_InFlightHtlcs_free(uint64_t this_obj) {
47088 LDKInFlightHtlcs this_obj_conv;
47089 this_obj_conv.inner = untag_ptr(this_obj);
47090 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47092 InFlightHtlcs_free(this_obj_conv);
47095 uint64_t __attribute__((export_name("TS_InFlightHtlcs_used_liquidity_msat"))) TS_InFlightHtlcs_used_liquidity_msat(uint64_t this_arg, uint64_t source, uint64_t target, int64_t channel_scid) {
47096 LDKInFlightHtlcs this_arg_conv;
47097 this_arg_conv.inner = untag_ptr(this_arg);
47098 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47100 this_arg_conv.is_owned = false;
47101 LDKNodeId source_conv;
47102 source_conv.inner = untag_ptr(source);
47103 source_conv.is_owned = ptr_is_owned(source);
47104 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
47105 source_conv.is_owned = false;
47106 LDKNodeId target_conv;
47107 target_conv.inner = untag_ptr(target);
47108 target_conv.is_owned = ptr_is_owned(target);
47109 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
47110 target_conv.is_owned = false;
47111 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47112 *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
47113 uint64_t ret_ref = tag_ptr(ret_copy, true);
47117 int8_tArray __attribute__((export_name("TS_InFlightHtlcs_write"))) TS_InFlightHtlcs_write(uint64_t obj) {
47118 LDKInFlightHtlcs obj_conv;
47119 obj_conv.inner = untag_ptr(obj);
47120 obj_conv.is_owned = ptr_is_owned(obj);
47121 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47122 obj_conv.is_owned = false;
47123 LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
47124 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
47125 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
47126 CVec_u8Z_free(ret_var);
47130 uint64_t __attribute__((export_name("TS_InFlightHtlcs_read"))) TS_InFlightHtlcs_read(int8_tArray ser) {
47131 LDKu8slice ser_ref;
47132 ser_ref.datalen = ser->arr_len;
47133 ser_ref.data = ser->elems;
47134 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
47135 *ret_conv = InFlightHtlcs_read(ser_ref);
47137 return tag_ptr(ret_conv, true);
47140 uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint64_t logger, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
47141 LDKChannelManager channelmanager_conv;
47142 channelmanager_conv.inner = untag_ptr(channelmanager);
47143 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47144 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47145 channelmanager_conv.is_owned = false;
47146 void* keys_manager_ptr = untag_ptr(keys_manager);
47147 CHECK_ACCESS(keys_manager_ptr);
47148 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47149 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47150 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47151 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47153 void* logger_ptr = untag_ptr(logger);
47154 CHECK_ACCESS(logger_ptr);
47155 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47156 if (logger_conv.free == LDKLogger_JCalls_free) {
47157 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47158 LDKLogger_JCalls_cloned(&logger_conv);
47160 LDKCurrency network_conv = LDKCurrency_from_js(network);
47161 void* amt_msat_ptr = untag_ptr(amt_msat);
47162 CHECK_ACCESS(amt_msat_ptr);
47163 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47164 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47165 LDKSha256 description_hash_conv;
47166 description_hash_conv.inner = untag_ptr(description_hash);
47167 description_hash_conv.is_owned = ptr_is_owned(description_hash);
47168 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
47169 description_hash_conv = Sha256_clone(&description_hash_conv);
47170 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47171 *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
47172 return tag_ptr(ret_conv, true);
47175 uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint64_t logger, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
47176 LDKChannelManager channelmanager_conv;
47177 channelmanager_conv.inner = untag_ptr(channelmanager);
47178 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47179 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47180 channelmanager_conv.is_owned = false;
47181 void* keys_manager_ptr = untag_ptr(keys_manager);
47182 CHECK_ACCESS(keys_manager_ptr);
47183 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47184 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47185 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47186 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47188 void* logger_ptr = untag_ptr(logger);
47189 CHECK_ACCESS(logger_ptr);
47190 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47191 if (logger_conv.free == LDKLogger_JCalls_free) {
47192 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47193 LDKLogger_JCalls_cloned(&logger_conv);
47195 LDKCurrency network_conv = LDKCurrency_from_js(network);
47196 void* amt_msat_ptr = untag_ptr(amt_msat);
47197 CHECK_ACCESS(amt_msat_ptr);
47198 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47199 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47200 LDKStr description_conv = str_ref_to_owned_c(description);
47201 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47202 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
47203 return tag_ptr(ret_conv, true);
47206 void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
47207 LDKDefaultRouter this_obj_conv;
47208 this_obj_conv.inner = untag_ptr(this_obj);
47209 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47211 DefaultRouter_free(this_obj_conv);
47214 uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes, uint64_t scorer) {
47215 LDKNetworkGraph network_graph_conv;
47216 network_graph_conv.inner = untag_ptr(network_graph);
47217 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47218 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47219 network_graph_conv.is_owned = false;
47220 void* logger_ptr = untag_ptr(logger);
47221 CHECK_ACCESS(logger_ptr);
47222 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47223 if (logger_conv.free == LDKLogger_JCalls_free) {
47224 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47225 LDKLogger_JCalls_cloned(&logger_conv);
47227 LDKThirtyTwoBytes random_seed_bytes_ref;
47228 CHECK(random_seed_bytes->arr_len == 32);
47229 memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
47230 void* scorer_ptr = untag_ptr(scorer);
47231 CHECK_ACCESS(scorer_ptr);
47232 LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
47233 if (scorer_conv.free == LDKLockableScore_JCalls_free) {
47234 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47235 LDKLockableScore_JCalls_cloned(&scorer_conv);
47237 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
47238 uint64_t ret_ref = 0;
47239 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47240 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47244 uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
47245 LDKDefaultRouter this_arg_conv;
47246 this_arg_conv.inner = untag_ptr(this_arg);
47247 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47249 this_arg_conv.is_owned = false;
47250 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
47251 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
47252 return tag_ptr(ret_ret, true);
47255 uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
47256 LDKChannelManager this_arg_conv;
47257 this_arg_conv.inner = untag_ptr(this_arg);
47258 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47260 this_arg_conv.is_owned = false;
47261 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
47262 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
47263 return tag_ptr(ret_ret, true);
47266 uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {
47267 LDKStr s_conv = str_ref_to_owned_c(s);
47268 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
47269 *ret_conv = SiPrefix_from_str(s_conv);
47270 return tag_ptr(ret_conv, true);
47273 uint64_t __attribute__((export_name("TS_Invoice_from_str"))) TS_Invoice_from_str(jstring s) {
47274 LDKStr s_conv = str_ref_to_owned_c(s);
47275 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
47276 *ret_conv = Invoice_from_str(s_conv);
47277 return tag_ptr(ret_conv, true);
47280 uint64_t __attribute__((export_name("TS_SignedRawInvoice_from_str"))) TS_SignedRawInvoice_from_str(jstring s) {
47281 LDKStr s_conv = str_ref_to_owned_c(s);
47282 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
47283 *ret_conv = SignedRawInvoice_from_str(s_conv);
47284 return tag_ptr(ret_conv, true);
47287 jstring __attribute__((export_name("TS_ParseError_to_str"))) TS_ParseError_to_str(uint64_t o) {
47288 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
47289 LDKStr ret_str = ParseError_to_str(o_conv);
47290 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
47295 jstring __attribute__((export_name("TS_ParseOrSemanticError_to_str"))) TS_ParseOrSemanticError_to_str(uint64_t o) {
47296 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
47297 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
47298 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
47303 jstring __attribute__((export_name("TS_Invoice_to_str"))) TS_Invoice_to_str(uint64_t o) {
47305 o_conv.inner = untag_ptr(o);
47306 o_conv.is_owned = ptr_is_owned(o);
47307 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47308 o_conv.is_owned = false;
47309 LDKStr ret_str = Invoice_to_str(&o_conv);
47310 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
47315 jstring __attribute__((export_name("TS_SignedRawInvoice_to_str"))) TS_SignedRawInvoice_to_str(uint64_t o) {
47316 LDKSignedRawInvoice o_conv;
47317 o_conv.inner = untag_ptr(o);
47318 o_conv.is_owned = ptr_is_owned(o);
47319 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47320 o_conv.is_owned = false;
47321 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
47322 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
47327 jstring __attribute__((export_name("TS_Currency_to_str"))) TS_Currency_to_str(uint64_t o) {
47328 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
47329 LDKStr ret_str = Currency_to_str(o_conv);
47330 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
47335 jstring __attribute__((export_name("TS_SiPrefix_to_str"))) TS_SiPrefix_to_str(uint64_t o) {
47336 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
47337 LDKStr ret_str = SiPrefix_to_str(o_conv);
47338 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);