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 LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) {
182 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
183 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
187 static inline int32_t LDKChannelMonitorUpdateErr_to_js(LDKChannelMonitorUpdateErr val) {
189 case LDKChannelMonitorUpdateErr_TemporaryFailure: return 0;
190 case LDKChannelMonitorUpdateErr_PermanentFailure: return 1;
194 static inline LDKConfirmationTarget LDKConfirmationTarget_from_js(int32_t ord) {
196 case 0: return LDKConfirmationTarget_Background;
197 case 1: return LDKConfirmationTarget_Normal;
198 case 2: return LDKConfirmationTarget_HighPriority;
202 static inline int32_t LDKConfirmationTarget_to_js(LDKConfirmationTarget val) {
204 case LDKConfirmationTarget_Background: return 0;
205 case LDKConfirmationTarget_Normal: return 1;
206 case LDKConfirmationTarget_HighPriority: return 2;
210 static inline LDKCreationError LDKCreationError_from_js(int32_t ord) {
212 case 0: return LDKCreationError_DescriptionTooLong;
213 case 1: return LDKCreationError_RouteTooLong;
214 case 2: return LDKCreationError_TimestampOutOfBounds;
215 case 3: return LDKCreationError_InvalidAmount;
216 case 4: return LDKCreationError_MissingRouteHints;
220 static inline int32_t LDKCreationError_to_js(LDKCreationError val) {
222 case LDKCreationError_DescriptionTooLong: return 0;
223 case LDKCreationError_RouteTooLong: return 1;
224 case LDKCreationError_TimestampOutOfBounds: return 2;
225 case LDKCreationError_InvalidAmount: return 3;
226 case LDKCreationError_MissingRouteHints: return 4;
230 static inline LDKCurrency LDKCurrency_from_js(int32_t ord) {
232 case 0: return LDKCurrency_Bitcoin;
233 case 1: return LDKCurrency_BitcoinTestnet;
234 case 2: return LDKCurrency_Regtest;
235 case 3: return LDKCurrency_Simnet;
236 case 4: return LDKCurrency_Signet;
240 static inline int32_t LDKCurrency_to_js(LDKCurrency val) {
242 case LDKCurrency_Bitcoin: return 0;
243 case LDKCurrency_BitcoinTestnet: return 1;
244 case LDKCurrency_Regtest: return 2;
245 case LDKCurrency_Simnet: return 3;
246 case LDKCurrency_Signet: return 4;
250 static inline LDKIOError LDKIOError_from_js(int32_t ord) {
252 case 0: return LDKIOError_NotFound;
253 case 1: return LDKIOError_PermissionDenied;
254 case 2: return LDKIOError_ConnectionRefused;
255 case 3: return LDKIOError_ConnectionReset;
256 case 4: return LDKIOError_ConnectionAborted;
257 case 5: return LDKIOError_NotConnected;
258 case 6: return LDKIOError_AddrInUse;
259 case 7: return LDKIOError_AddrNotAvailable;
260 case 8: return LDKIOError_BrokenPipe;
261 case 9: return LDKIOError_AlreadyExists;
262 case 10: return LDKIOError_WouldBlock;
263 case 11: return LDKIOError_InvalidInput;
264 case 12: return LDKIOError_InvalidData;
265 case 13: return LDKIOError_TimedOut;
266 case 14: return LDKIOError_WriteZero;
267 case 15: return LDKIOError_Interrupted;
268 case 16: return LDKIOError_Other;
269 case 17: return LDKIOError_UnexpectedEof;
273 static inline int32_t LDKIOError_to_js(LDKIOError val) {
275 case LDKIOError_NotFound: return 0;
276 case LDKIOError_PermissionDenied: return 1;
277 case LDKIOError_ConnectionRefused: return 2;
278 case LDKIOError_ConnectionReset: return 3;
279 case LDKIOError_ConnectionAborted: return 4;
280 case LDKIOError_NotConnected: return 5;
281 case LDKIOError_AddrInUse: return 6;
282 case LDKIOError_AddrNotAvailable: return 7;
283 case LDKIOError_BrokenPipe: return 8;
284 case LDKIOError_AlreadyExists: return 9;
285 case LDKIOError_WouldBlock: return 10;
286 case LDKIOError_InvalidInput: return 11;
287 case LDKIOError_InvalidData: return 12;
288 case LDKIOError_TimedOut: return 13;
289 case LDKIOError_WriteZero: return 14;
290 case LDKIOError_Interrupted: return 15;
291 case LDKIOError_Other: return 16;
292 case LDKIOError_UnexpectedEof: return 17;
296 static inline LDKLevel LDKLevel_from_js(int32_t ord) {
298 case 0: return LDKLevel_Gossip;
299 case 1: return LDKLevel_Trace;
300 case 2: return LDKLevel_Debug;
301 case 3: return LDKLevel_Info;
302 case 4: return LDKLevel_Warn;
303 case 5: return LDKLevel_Error;
307 static inline int32_t LDKLevel_to_js(LDKLevel val) {
309 case LDKLevel_Gossip: return 0;
310 case LDKLevel_Trace: return 1;
311 case LDKLevel_Debug: return 2;
312 case LDKLevel_Info: return 3;
313 case LDKLevel_Warn: return 4;
314 case LDKLevel_Error: return 5;
318 static inline LDKNetwork LDKNetwork_from_js(int32_t ord) {
320 case 0: return LDKNetwork_Bitcoin;
321 case 1: return LDKNetwork_Testnet;
322 case 2: return LDKNetwork_Regtest;
323 case 3: return LDKNetwork_Signet;
327 static inline int32_t LDKNetwork_to_js(LDKNetwork val) {
329 case LDKNetwork_Bitcoin: return 0;
330 case LDKNetwork_Testnet: return 1;
331 case LDKNetwork_Regtest: return 2;
332 case LDKNetwork_Signet: return 3;
336 static inline LDKRecipient LDKRecipient_from_js(int32_t ord) {
338 case 0: return LDKRecipient_Node;
339 case 1: return LDKRecipient_PhantomNode;
343 static inline int32_t LDKRecipient_to_js(LDKRecipient val) {
345 case LDKRecipient_Node: return 0;
346 case LDKRecipient_PhantomNode: return 1;
350 static inline LDKSecp256k1Error LDKSecp256k1Error_from_js(int32_t ord) {
352 case 0: return LDKSecp256k1Error_IncorrectSignature;
353 case 1: return LDKSecp256k1Error_InvalidMessage;
354 case 2: return LDKSecp256k1Error_InvalidPublicKey;
355 case 3: return LDKSecp256k1Error_InvalidSignature;
356 case 4: return LDKSecp256k1Error_InvalidSecretKey;
357 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
358 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
359 case 7: return LDKSecp256k1Error_InvalidTweak;
360 case 8: return LDKSecp256k1Error_NotEnoughMemory;
361 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
362 case 10: return LDKSecp256k1Error_InvalidParityValue;
366 static inline int32_t LDKSecp256k1Error_to_js(LDKSecp256k1Error val) {
368 case LDKSecp256k1Error_IncorrectSignature: return 0;
369 case LDKSecp256k1Error_InvalidMessage: return 1;
370 case LDKSecp256k1Error_InvalidPublicKey: return 2;
371 case LDKSecp256k1Error_InvalidSignature: return 3;
372 case LDKSecp256k1Error_InvalidSecretKey: return 4;
373 case LDKSecp256k1Error_InvalidSharedSecret: return 5;
374 case LDKSecp256k1Error_InvalidRecoveryId: return 6;
375 case LDKSecp256k1Error_InvalidTweak: return 7;
376 case LDKSecp256k1Error_NotEnoughMemory: return 8;
377 case LDKSecp256k1Error_InvalidPublicKeySum: return 9;
378 case LDKSecp256k1Error_InvalidParityValue: return 10;
382 static inline LDKSemanticError LDKSemanticError_from_js(int32_t ord) {
384 case 0: return LDKSemanticError_NoPaymentHash;
385 case 1: return LDKSemanticError_MultiplePaymentHashes;
386 case 2: return LDKSemanticError_NoDescription;
387 case 3: return LDKSemanticError_MultipleDescriptions;
388 case 4: return LDKSemanticError_NoPaymentSecret;
389 case 5: return LDKSemanticError_MultiplePaymentSecrets;
390 case 6: return LDKSemanticError_InvalidFeatures;
391 case 7: return LDKSemanticError_InvalidRecoveryId;
392 case 8: return LDKSemanticError_InvalidSignature;
393 case 9: return LDKSemanticError_ImpreciseAmount;
397 static inline int32_t LDKSemanticError_to_js(LDKSemanticError val) {
399 case LDKSemanticError_NoPaymentHash: return 0;
400 case LDKSemanticError_MultiplePaymentHashes: return 1;
401 case LDKSemanticError_NoDescription: return 2;
402 case LDKSemanticError_MultipleDescriptions: return 3;
403 case LDKSemanticError_NoPaymentSecret: return 4;
404 case LDKSemanticError_MultiplePaymentSecrets: return 5;
405 case LDKSemanticError_InvalidFeatures: return 6;
406 case LDKSemanticError_InvalidRecoveryId: return 7;
407 case LDKSemanticError_InvalidSignature: return 8;
408 case LDKSemanticError_ImpreciseAmount: return 9;
412 static inline LDKSiPrefix LDKSiPrefix_from_js(int32_t ord) {
414 case 0: return LDKSiPrefix_Milli;
415 case 1: return LDKSiPrefix_Micro;
416 case 2: return LDKSiPrefix_Nano;
417 case 3: return LDKSiPrefix_Pico;
421 static inline int32_t LDKSiPrefix_to_js(LDKSiPrefix val) {
423 case LDKSiPrefix_Milli: return 0;
424 case LDKSiPrefix_Micro: return 1;
425 case LDKSiPrefix_Nano: return 2;
426 case LDKSiPrefix_Pico: return 3;
430 struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
431 LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
434 int8_tArray __attribute__((export_name("TS_BigEndianScalar_get_bytes"))) TS_BigEndianScalar_get_bytes(uint64_t thing) {
435 LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
436 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
437 memcpy(ret_arr->elems, BigEndianScalar_get_bytes(thing_conv).data, 32);
441 static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
442 void __attribute__((export_name("TS_BigEndianScalar_free"))) TS_BigEndianScalar_free(uint64_t thing) {
443 if (!ptr_is_owned(thing)) return;
444 void* thing_ptr = untag_ptr(thing);
445 CHECK_ACCESS(thing_ptr);
446 LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
447 FREE(untag_ptr(thing));
448 BigEndianScalar_free(thing_conv);
451 uint32_t __attribute__((export_name("TS_LDKBech32Error_ty_from_ptr"))) TS_LDKBech32Error_ty_from_ptr(uint64_t ptr) {
452 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
454 case LDKBech32Error_MissingSeparator: return 0;
455 case LDKBech32Error_InvalidChecksum: return 1;
456 case LDKBech32Error_InvalidLength: return 2;
457 case LDKBech32Error_InvalidChar: return 3;
458 case LDKBech32Error_InvalidData: return 4;
459 case LDKBech32Error_InvalidPadding: return 5;
460 case LDKBech32Error_MixedCase: return 6;
464 int32_t __attribute__((export_name("TS_LDKBech32Error_InvalidChar_get_invalid_char"))) TS_LDKBech32Error_InvalidChar_get_invalid_char(uint64_t ptr) {
465 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
466 assert(obj->tag == LDKBech32Error_InvalidChar);
467 int32_t invalid_char_conv = obj->invalid_char;
468 return invalid_char_conv;
470 int8_t __attribute__((export_name("TS_LDKBech32Error_InvalidData_get_invalid_data"))) TS_LDKBech32Error_InvalidData_get_invalid_data(uint64_t ptr) {
471 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
472 assert(obj->tag == LDKBech32Error_InvalidData);
473 int8_t invalid_data_conv = obj->invalid_data;
474 return invalid_data_conv;
476 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
477 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
478 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
481 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) {
482 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
483 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
484 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
485 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
486 CVec_u8Z_free(ret_var);
490 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) {
491 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
492 int64_t ret_conv = TxOut_get_value(thing_conv);
496 static inline struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
497 LDKBlindedRoute ret = *owner->contents.result;
498 ret.is_owned = false;
501 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_get_ok"))) TS_CResult_BlindedRouteNoneZ_get_ok(uint64_t owner) {
502 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
503 LDKBlindedRoute ret_var = CResult_BlindedRouteNoneZ_get_ok(owner_conv);
504 uint64_t ret_ref = 0;
505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
510 static inline void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
511 CHECK(!owner->result_ok);
512 return *owner->contents.err;
514 void __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_get_err"))) TS_CResult_BlindedRouteNoneZ_get_err(uint64_t owner) {
515 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
516 CResult_BlindedRouteNoneZ_get_err(owner_conv);
519 static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
520 LDKBlindedRoute ret = *owner->contents.result;
521 ret.is_owned = false;
524 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_get_ok(uint64_t owner) {
525 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
526 LDKBlindedRoute ret_var = CResult_BlindedRouteDecodeErrorZ_get_ok(owner_conv);
527 uint64_t ret_ref = 0;
528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
533 static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
534 LDKDecodeError ret = *owner->contents.err;
535 ret.is_owned = false;
538 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_err"))) TS_CResult_BlindedRouteDecodeErrorZ_get_err(uint64_t owner) {
539 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
540 LDKDecodeError ret_var = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
541 uint64_t ret_ref = 0;
542 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
543 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
547 static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
548 LDKBlindedHop ret = *owner->contents.result;
549 ret.is_owned = false;
552 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_ok"))) TS_CResult_BlindedHopDecodeErrorZ_get_ok(uint64_t owner) {
553 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
554 LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
555 uint64_t ret_ref = 0;
556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
561 static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
562 LDKDecodeError ret = *owner->contents.err;
563 ret.is_owned = false;
566 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_err"))) TS_CResult_BlindedHopDecodeErrorZ_get_err(uint64_t owner) {
567 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
568 LDKDecodeError ret_var = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
569 uint64_t ret_ref = 0;
570 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
571 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
575 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
576 CHECK(owner->result_ok);
577 return *owner->contents.result;
579 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_ok"))) TS_CResult_NoneNoneZ_get_ok(uint64_t owner) {
580 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
581 CResult_NoneNoneZ_get_ok(owner_conv);
584 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
585 CHECK(!owner->result_ok);
586 return *owner->contents.err;
588 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_err"))) TS_CResult_NoneNoneZ_get_err(uint64_t owner) {
589 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
590 CResult_NoneNoneZ_get_err(owner_conv);
593 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
594 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
595 ret.is_owned = false;
598 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(uint64_t owner) {
599 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
600 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
601 uint64_t ret_ref = 0;
602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
607 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
608 LDKDecodeError ret = *owner->contents.err;
609 ret.is_owned = false;
612 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
613 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
614 LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
615 uint64_t ret_ref = 0;
616 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
617 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
621 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
622 CHECK(owner->result_ok);
623 return *owner->contents.result;
625 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
626 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
627 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
628 memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
632 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
633 CHECK(!owner->result_ok);
634 return *owner->contents.err;
636 uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
637 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
638 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
642 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
643 CHECK(owner->result_ok);
644 return *owner->contents.result;
646 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
647 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
648 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
649 memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
653 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
654 CHECK(!owner->result_ok);
655 return *owner->contents.err;
657 uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
658 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
659 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
663 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
664 LDKTxCreationKeys ret = *owner->contents.result;
665 ret.is_owned = false;
668 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint64_t owner) {
669 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
670 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
671 uint64_t ret_ref = 0;
672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
677 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
678 LDKDecodeError ret = *owner->contents.err;
679 ret.is_owned = false;
682 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
683 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
684 LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
685 uint64_t ret_ref = 0;
686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
691 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
692 LDKChannelPublicKeys ret = *owner->contents.result;
693 ret.is_owned = false;
696 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint64_t owner) {
697 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
698 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
699 uint64_t ret_ref = 0;
700 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
701 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
705 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
706 LDKDecodeError ret = *owner->contents.err;
707 ret.is_owned = false;
710 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
711 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
712 LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
713 uint64_t ret_ref = 0;
714 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
715 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
719 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
720 LDKTxCreationKeys ret = *owner->contents.result;
721 ret.is_owned = false;
724 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
725 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
726 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
727 uint64_t ret_ref = 0;
728 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
729 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
733 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
734 CHECK(!owner->result_ok);
735 return *owner->contents.err;
737 uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
738 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
739 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
743 uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
744 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
746 case LDKCOption_u32Z_Some: return 0;
747 case LDKCOption_u32Z_None: return 1;
751 int32_t __attribute__((export_name("TS_LDKCOption_u32Z_Some_get_some"))) TS_LDKCOption_u32Z_Some_get_some(uint64_t ptr) {
752 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
753 assert(obj->tag == LDKCOption_u32Z_Some);
754 int32_t some_conv = obj->some;
757 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
758 LDKHTLCOutputInCommitment ret = *owner->contents.result;
759 ret.is_owned = false;
762 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint64_t owner) {
763 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
764 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
765 uint64_t ret_ref = 0;
766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
771 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
772 LDKDecodeError ret = *owner->contents.err;
773 ret.is_owned = false;
776 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
777 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
778 LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
779 uint64_t ret_ref = 0;
780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
785 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
786 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
787 ret.is_owned = false;
790 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
791 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
792 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
793 uint64_t ret_ref = 0;
794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
799 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
800 LDKDecodeError ret = *owner->contents.err;
801 ret.is_owned = false;
804 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
805 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
806 LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
807 uint64_t ret_ref = 0;
808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
813 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
814 LDKChannelTransactionParameters ret = *owner->contents.result;
815 ret.is_owned = false;
818 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
819 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
820 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
821 uint64_t ret_ref = 0;
822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
823 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
827 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
828 LDKDecodeError ret = *owner->contents.err;
829 ret.is_owned = false;
832 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
833 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
834 LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
835 uint64_t ret_ref = 0;
836 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
837 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
841 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
842 LDKHolderCommitmentTransaction ret = *owner->contents.result;
843 ret.is_owned = false;
846 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
847 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
848 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
849 uint64_t ret_ref = 0;
850 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
851 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
855 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
856 LDKDecodeError ret = *owner->contents.err;
857 ret.is_owned = false;
860 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
861 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
862 LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
863 uint64_t ret_ref = 0;
864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
869 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
870 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
871 ret.is_owned = false;
874 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
875 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
876 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
877 uint64_t ret_ref = 0;
878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
883 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
884 LDKDecodeError ret = *owner->contents.err;
885 ret.is_owned = false;
888 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
889 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
890 LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
891 uint64_t ret_ref = 0;
892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
897 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
898 LDKTrustedClosingTransaction ret = *owner->contents.result;
899 ret.is_owned = false;
902 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint64_t owner) {
903 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
904 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
905 uint64_t ret_ref = 0;
906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
911 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
912 CHECK(!owner->result_ok);
913 return *owner->contents.err;
915 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_err"))) TS_CResult_TrustedClosingTransactionNoneZ_get_err(uint64_t owner) {
916 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
917 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
920 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
921 LDKCommitmentTransaction ret = *owner->contents.result;
922 ret.is_owned = false;
925 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
926 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
927 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
928 uint64_t ret_ref = 0;
929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
934 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
935 LDKDecodeError ret = *owner->contents.err;
936 ret.is_owned = false;
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_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
942 uint64_t ret_ref = 0;
943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
948 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
949 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
950 ret.is_owned = false;
953 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint64_t owner) {
954 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
955 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
956 uint64_t ret_ref = 0;
957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
962 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
963 CHECK(!owner->result_ok);
964 return *owner->contents.err;
966 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_err(uint64_t owner) {
967 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
968 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
971 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
972 CHECK(owner->result_ok);
973 return *owner->contents.result;
975 ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) TS_CResult_CVec_SignatureZNoneZ_get_ok(uint64_t owner) {
976 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
977 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
978 ptrArray ret_arr = NULL;
979 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
980 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
981 for (size_t m = 0; m < ret_var.datalen; m++) {
982 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
983 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
984 ret_arr_ptr[m] = ret_conv_12_arr;
990 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
991 CHECK(!owner->result_ok);
992 return *owner->contents.err;
994 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_err"))) TS_CResult_CVec_SignatureZNoneZ_get_err(uint64_t owner) {
995 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
996 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
999 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1000 LDKShutdownScript ret = *owner->contents.result;
1001 ret.is_owned = false;
1004 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint64_t owner) {
1005 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1006 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1007 uint64_t ret_ref = 0;
1008 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1009 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1013 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1014 LDKDecodeError ret = *owner->contents.err;
1015 ret.is_owned = false;
1018 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
1019 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1020 LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1021 uint64_t ret_ref = 0;
1022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1027 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1028 LDKShutdownScript ret = *owner->contents.result;
1029 ret.is_owned = false;
1032 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint64_t owner) {
1033 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1034 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1035 uint64_t ret_ref = 0;
1036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1041 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1042 LDKInvalidShutdownScript ret = *owner->contents.err;
1043 ret.is_owned = false;
1046 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint64_t owner) {
1047 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1048 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1049 uint64_t ret_ref = 0;
1050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1055 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1056 LDKRouteHop ret = *owner->contents.result;
1057 ret.is_owned = false;
1060 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
1061 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1062 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
1063 uint64_t ret_ref = 0;
1064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1069 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1070 LDKDecodeError ret = *owner->contents.err;
1071 ret.is_owned = false;
1074 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
1075 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1076 LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
1077 uint64_t ret_ref = 0;
1078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1083 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
1084 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
1085 for (size_t i = 0; i < ret.datalen; i++) {
1086 ret.data[i] = RouteHop_clone(&orig->data[i]);
1090 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
1091 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
1092 for (size_t i = 0; i < ret.datalen; i++) {
1093 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
1097 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1098 LDKRoute ret = *owner->contents.result;
1099 ret.is_owned = false;
1102 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint64_t owner) {
1103 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1104 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
1105 uint64_t ret_ref = 0;
1106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1111 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1112 LDKDecodeError ret = *owner->contents.err;
1113 ret.is_owned = false;
1116 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
1117 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1118 LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
1119 uint64_t ret_ref = 0;
1120 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1121 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1125 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1126 LDKRouteParameters ret = *owner->contents.result;
1127 ret.is_owned = false;
1130 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint64_t owner) {
1131 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1132 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1133 uint64_t ret_ref = 0;
1134 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1135 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1139 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1140 LDKDecodeError ret = *owner->contents.err;
1141 ret.is_owned = false;
1144 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
1145 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1146 LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1147 uint64_t ret_ref = 0;
1148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1153 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1154 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1155 for (size_t i = 0; i < ret.datalen; i++) {
1156 ret.data[i] = RouteHint_clone(&orig->data[i]);
1160 uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
1161 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1163 case LDKCOption_u64Z_Some: return 0;
1164 case LDKCOption_u64Z_None: return 1;
1168 int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
1169 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1170 assert(obj->tag == LDKCOption_u64Z_Some);
1171 int64_t some_conv = obj->some;
1174 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1175 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1176 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1179 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1180 LDKPaymentParameters ret = *owner->contents.result;
1181 ret.is_owned = false;
1184 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_get_ok(uint64_t owner) {
1185 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1186 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1187 uint64_t ret_ref = 0;
1188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1193 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1194 LDKDecodeError ret = *owner->contents.err;
1195 ret.is_owned = false;
1198 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
1199 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1200 LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1201 uint64_t ret_ref = 0;
1202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1207 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1208 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1209 for (size_t i = 0; i < ret.datalen; i++) {
1210 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1214 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1215 LDKRouteHint ret = *owner->contents.result;
1216 ret.is_owned = false;
1219 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint64_t owner) {
1220 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1221 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1222 uint64_t ret_ref = 0;
1223 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1224 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1228 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1229 LDKDecodeError ret = *owner->contents.err;
1230 ret.is_owned = false;
1233 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
1234 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1235 LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
1236 uint64_t ret_ref = 0;
1237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1242 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1243 LDKRouteHintHop ret = *owner->contents.result;
1244 ret.is_owned = false;
1247 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint64_t owner) {
1248 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1249 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1250 uint64_t ret_ref = 0;
1251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1256 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1257 LDKDecodeError ret = *owner->contents.err;
1258 ret.is_owned = false;
1261 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
1262 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1263 LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1264 uint64_t ret_ref = 0;
1265 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1266 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1270 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1271 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1272 for (size_t i = 0; i < ret.datalen; i++) {
1273 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1277 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1278 LDKRoute ret = *owner->contents.result;
1279 ret.is_owned = false;
1282 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
1283 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1284 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1285 uint64_t ret_ref = 0;
1286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1291 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1292 LDKLightningError ret = *owner->contents.err;
1293 ret.is_owned = false;
1296 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
1297 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1298 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1299 uint64_t ret_ref = 0;
1300 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1301 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1305 uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) {
1306 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1308 case LDKPaymentPurpose_InvoicePayment: return 0;
1309 case LDKPaymentPurpose_SpontaneousPayment: return 1;
1313 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) {
1314 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1315 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1316 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1317 memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32);
1318 return payment_preimage_arr;
1320 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) {
1321 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1322 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1323 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
1324 memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32);
1325 return payment_secret_arr;
1327 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) {
1328 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1329 assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment);
1330 int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__);
1331 memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32);
1332 return spontaneous_payment_arr;
1334 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1335 CHECK(owner->result_ok);
1336 return PaymentPurpose_clone(&*owner->contents.result);
1338 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) {
1339 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1340 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1341 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1342 uint64_t ret_ref = tag_ptr(ret_copy, true);
1346 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1347 LDKDecodeError ret = *owner->contents.err;
1348 ret.is_owned = false;
1351 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
1352 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1353 LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1354 uint64_t ret_ref = 0;
1355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1360 uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) {
1361 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1363 case LDKClosureReason_CounterpartyForceClosed: return 0;
1364 case LDKClosureReason_HolderForceClosed: return 1;
1365 case LDKClosureReason_CooperativeClosure: return 2;
1366 case LDKClosureReason_CommitmentTxConfirmed: return 3;
1367 case LDKClosureReason_FundingTimedOut: return 4;
1368 case LDKClosureReason_ProcessingError: return 5;
1369 case LDKClosureReason_DisconnectedPeer: return 6;
1370 case LDKClosureReason_OutdatedChannelManager: return 7;
1374 jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) {
1375 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1376 assert(obj->tag == LDKClosureReason_CounterpartyForceClosed);
1377 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1378 jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len);
1379 return peer_msg_conv;
1381 jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) {
1382 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1383 assert(obj->tag == LDKClosureReason_ProcessingError);
1384 LDKStr err_str = obj->processing_error.err;
1385 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
1388 uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) {
1389 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1391 case LDKCOption_ClosureReasonZ_Some: return 0;
1392 case LDKCOption_ClosureReasonZ_None: return 1;
1396 uint64_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint64_t ptr) {
1397 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1398 assert(obj->tag == LDKCOption_ClosureReasonZ_Some);
1399 uint64_t some_ref = tag_ptr(&obj->some, false);
1402 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1403 CHECK(owner->result_ok);
1404 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1406 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint64_t owner) {
1407 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1408 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1409 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1410 uint64_t ret_ref = tag_ptr(ret_copy, true);
1414 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1415 LDKDecodeError ret = *owner->contents.err;
1416 ret.is_owned = false;
1419 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
1420 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1421 LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1422 uint64_t ret_ref = 0;
1423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1428 uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LDKHTLCDestination_ty_from_ptr(uint64_t ptr) {
1429 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1431 case LDKHTLCDestination_NextHopChannel: return 0;
1432 case LDKHTLCDestination_UnknownNextHop: return 1;
1433 case LDKHTLCDestination_FailedPayment: return 2;
1437 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_node_id"))) TS_LDKHTLCDestination_NextHopChannel_get_node_id(uint64_t ptr) {
1438 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1439 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1440 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1441 memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33);
1444 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) {
1445 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1446 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1447 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1448 memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32);
1449 return channel_id_arr;
1451 int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) {
1452 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1453 assert(obj->tag == LDKHTLCDestination_UnknownNextHop);
1454 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
1455 return requested_forward_scid_conv;
1457 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
1458 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1459 assert(obj->tag == LDKHTLCDestination_FailedPayment);
1460 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1461 memcpy(payment_hash_arr->elems, obj->failed_payment.payment_hash.data, 32);
1462 return payment_hash_arr;
1464 uint32_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_ty_from_ptr"))) TS_LDKCOption_HTLCDestinationZ_ty_from_ptr(uint64_t ptr) {
1465 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1467 case LDKCOption_HTLCDestinationZ_Some: return 0;
1468 case LDKCOption_HTLCDestinationZ_None: return 1;
1472 uint64_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_Some_get_some"))) TS_LDKCOption_HTLCDestinationZ_Some_get_some(uint64_t ptr) {
1473 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1474 assert(obj->tag == LDKCOption_HTLCDestinationZ_Some);
1475 uint64_t some_ref = tag_ptr(&obj->some, false);
1478 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1479 CHECK(owner->result_ok);
1480 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
1482 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(uint64_t owner) {
1483 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1484 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
1485 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
1486 uint64_t ret_ref = tag_ptr(ret_copy, true);
1490 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1491 LDKDecodeError ret = *owner->contents.err;
1492 ret.is_owned = false;
1495 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
1496 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1497 LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
1498 uint64_t ret_ref = 0;
1499 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1500 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1504 uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
1505 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1507 case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
1508 case LDKNetworkUpdate_ChannelFailure: return 1;
1509 case LDKNetworkUpdate_NodeFailure: return 2;
1513 uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
1514 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1515 assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
1516 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
1517 uint64_t msg_ref = 0;
1518 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1519 msg_ref = tag_ptr(msg_var.inner, false);
1522 int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
1523 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1524 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1525 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
1526 return short_channel_id_conv;
1528 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
1529 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1530 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1531 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
1532 return is_permanent_conv;
1534 int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
1535 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1536 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1537 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1538 memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
1541 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
1542 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1543 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1544 jboolean is_permanent_conv = obj->node_failure.is_permanent;
1545 return is_permanent_conv;
1547 uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
1548 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1550 case LDKCOption_NetworkUpdateZ_Some: return 0;
1551 case LDKCOption_NetworkUpdateZ_None: return 1;
1555 uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
1556 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1557 assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
1558 uint64_t some_ref = tag_ptr(&obj->some, false);
1561 uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
1562 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1564 case LDKSpendableOutputDescriptor_StaticOutput: return 0;
1565 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: return 1;
1566 case LDKSpendableOutputDescriptor_StaticPaymentOutput: return 2;
1570 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(uint64_t ptr) {
1571 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1572 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1573 LDKOutPoint outpoint_var = obj->static_output.outpoint;
1574 uint64_t outpoint_ref = 0;
1575 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
1576 outpoint_ref = tag_ptr(outpoint_var.inner, false);
1577 return outpoint_ref;
1579 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint64_t ptr) {
1580 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1581 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1582 LDKTxOut* output_ref = &obj->static_output.output;
1583 return tag_ptr(output_ref, false);
1585 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint64_t ptr) {
1586 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1587 assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput);
1588 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
1589 uint64_t delayed_payment_output_ref = 0;
1590 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
1591 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
1592 return delayed_payment_output_ref;
1594 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint64_t ptr) {
1595 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1596 assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput);
1597 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
1598 uint64_t static_payment_output_ref = 0;
1599 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
1600 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
1601 return static_payment_output_ref;
1603 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
1604 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
1605 for (size_t i = 0; i < ret.datalen; i++) {
1606 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
1610 uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_from_ptr(uint64_t ptr) {
1611 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1613 case LDKEvent_FundingGenerationReady: return 0;
1614 case LDKEvent_PaymentReceived: return 1;
1615 case LDKEvent_PaymentClaimed: return 2;
1616 case LDKEvent_PaymentSent: return 3;
1617 case LDKEvent_PaymentFailed: return 4;
1618 case LDKEvent_PaymentPathSuccessful: return 5;
1619 case LDKEvent_PaymentPathFailed: return 6;
1620 case LDKEvent_ProbeSuccessful: return 7;
1621 case LDKEvent_ProbeFailed: return 8;
1622 case LDKEvent_PendingHTLCsForwardable: return 9;
1623 case LDKEvent_SpendableOutputs: return 10;
1624 case LDKEvent_PaymentForwarded: return 11;
1625 case LDKEvent_ChannelClosed: return 12;
1626 case LDKEvent_DiscardFunding: return 13;
1627 case LDKEvent_OpenChannelRequest: return 14;
1628 case LDKEvent_HTLCHandlingFailed: return 15;
1632 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) {
1633 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1634 assert(obj->tag == LDKEvent_FundingGenerationReady);
1635 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1636 memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32);
1637 return temporary_channel_id_arr;
1639 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) {
1640 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1641 assert(obj->tag == LDKEvent_FundingGenerationReady);
1642 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1643 memcpy(counterparty_node_id_arr->elems, obj->funding_generation_ready.counterparty_node_id.compressed_form, 33);
1644 return counterparty_node_id_arr;
1646 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis"))) TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(uint64_t ptr) {
1647 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1648 assert(obj->tag == LDKEvent_FundingGenerationReady);
1649 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
1650 return channel_value_satoshis_conv;
1652 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_output_script"))) TS_LDKEvent_FundingGenerationReady_get_output_script(uint64_t ptr) {
1653 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1654 assert(obj->tag == LDKEvent_FundingGenerationReady);
1655 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
1656 int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__);
1657 memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
1658 return output_script_arr;
1660 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
1661 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1662 assert(obj->tag == LDKEvent_FundingGenerationReady);
1663 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
1664 return user_channel_id_conv;
1666 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
1667 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1668 assert(obj->tag == LDKEvent_PaymentReceived);
1669 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1670 memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
1671 return payment_hash_arr;
1673 int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
1674 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1675 assert(obj->tag == LDKEvent_PaymentReceived);
1676 int64_t amount_msat_conv = obj->payment_received.amount_msat;
1677 return amount_msat_conv;
1679 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
1680 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1681 assert(obj->tag == LDKEvent_PaymentReceived);
1682 uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
1685 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
1686 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1687 assert(obj->tag == LDKEvent_PaymentClaimed);
1688 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1689 memcpy(payment_hash_arr->elems, obj->payment_claimed.payment_hash.data, 32);
1690 return payment_hash_arr;
1692 int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_amount_msat"))) TS_LDKEvent_PaymentClaimed_get_amount_msat(uint64_t ptr) {
1693 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1694 assert(obj->tag == LDKEvent_PaymentClaimed);
1695 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
1696 return amount_msat_conv;
1698 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_purpose"))) TS_LDKEvent_PaymentClaimed_get_purpose(uint64_t ptr) {
1699 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1700 assert(obj->tag == LDKEvent_PaymentClaimed);
1701 uint64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
1704 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint64_t ptr) {
1705 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1706 assert(obj->tag == LDKEvent_PaymentSent);
1707 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1708 memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32);
1709 return payment_id_arr;
1711 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint64_t ptr) {
1712 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1713 assert(obj->tag == LDKEvent_PaymentSent);
1714 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1715 memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32);
1716 return payment_preimage_arr;
1718 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint64_t ptr) {
1719 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1720 assert(obj->tag == LDKEvent_PaymentSent);
1721 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1722 memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32);
1723 return payment_hash_arr;
1725 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint64_t ptr) {
1726 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1727 assert(obj->tag == LDKEvent_PaymentSent);
1728 uint64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
1729 return fee_paid_msat_ref;
1731 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint64_t ptr) {
1732 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1733 assert(obj->tag == LDKEvent_PaymentFailed);
1734 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1735 memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32);
1736 return payment_id_arr;
1738 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint64_t ptr) {
1739 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1740 assert(obj->tag == LDKEvent_PaymentFailed);
1741 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1742 memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32);
1743 return payment_hash_arr;
1745 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) {
1746 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1747 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1748 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1749 memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32);
1750 return payment_id_arr;
1752 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint64_t ptr) {
1753 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1754 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1755 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1756 memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32);
1757 return payment_hash_arr;
1759 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) {
1760 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1761 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1762 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
1763 uint64_tArray path_arr = NULL;
1764 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1765 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1766 for (size_t k = 0; k < path_var.datalen; k++) {
1767 LDKRouteHop path_conv_10_var = path_var.data[k];
1768 uint64_t path_conv_10_ref = 0;
1769 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1770 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1771 path_arr_ptr[k] = path_conv_10_ref;
1776 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) {
1777 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1778 assert(obj->tag == LDKEvent_PaymentPathFailed);
1779 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1780 memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32);
1781 return payment_id_arr;
1783 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint64_t ptr) {
1784 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1785 assert(obj->tag == LDKEvent_PaymentPathFailed);
1786 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1787 memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
1788 return payment_hash_arr;
1790 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently"))) TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently(uint64_t ptr) {
1791 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1792 assert(obj->tag == LDKEvent_PaymentPathFailed);
1793 jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
1794 return payment_failed_permanently_conv;
1796 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
1797 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1798 assert(obj->tag == LDKEvent_PaymentPathFailed);
1799 uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
1800 return network_update_ref;
1802 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
1803 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1804 assert(obj->tag == LDKEvent_PaymentPathFailed);
1805 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
1806 return all_paths_failed_conv;
1808 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
1809 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1810 assert(obj->tag == LDKEvent_PaymentPathFailed);
1811 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
1812 uint64_tArray path_arr = NULL;
1813 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1814 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1815 for (size_t k = 0; k < path_var.datalen; k++) {
1816 LDKRouteHop path_conv_10_var = path_var.data[k];
1817 uint64_t path_conv_10_ref = 0;
1818 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1819 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1820 path_arr_ptr[k] = path_conv_10_ref;
1825 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) {
1826 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1827 assert(obj->tag == LDKEvent_PaymentPathFailed);
1828 uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
1829 return short_channel_id_ref;
1831 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) {
1832 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1833 assert(obj->tag == LDKEvent_PaymentPathFailed);
1834 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
1835 uint64_t retry_ref = 0;
1836 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
1837 retry_ref = tag_ptr(retry_var.inner, false);
1840 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) {
1841 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1842 assert(obj->tag == LDKEvent_ProbeSuccessful);
1843 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1844 memcpy(payment_id_arr->elems, obj->probe_successful.payment_id.data, 32);
1845 return payment_id_arr;
1847 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_hash"))) TS_LDKEvent_ProbeSuccessful_get_payment_hash(uint64_t ptr) {
1848 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1849 assert(obj->tag == LDKEvent_ProbeSuccessful);
1850 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1851 memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32);
1852 return payment_hash_arr;
1854 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) {
1855 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1856 assert(obj->tag == LDKEvent_ProbeSuccessful);
1857 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
1858 uint64_tArray path_arr = NULL;
1859 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1860 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1861 for (size_t k = 0; k < path_var.datalen; k++) {
1862 LDKRouteHop path_conv_10_var = path_var.data[k];
1863 uint64_t path_conv_10_ref = 0;
1864 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1865 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1866 path_arr_ptr[k] = path_conv_10_ref;
1871 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) {
1872 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1873 assert(obj->tag == LDKEvent_ProbeFailed);
1874 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1875 memcpy(payment_id_arr->elems, obj->probe_failed.payment_id.data, 32);
1876 return payment_id_arr;
1878 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash"))) TS_LDKEvent_ProbeFailed_get_payment_hash(uint64_t ptr) {
1879 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1880 assert(obj->tag == LDKEvent_ProbeFailed);
1881 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1882 memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32);
1883 return payment_hash_arr;
1885 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) {
1886 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1887 assert(obj->tag == LDKEvent_ProbeFailed);
1888 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
1889 uint64_tArray path_arr = NULL;
1890 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1891 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1892 for (size_t k = 0; k < path_var.datalen; k++) {
1893 LDKRouteHop path_conv_10_var = path_var.data[k];
1894 uint64_t path_conv_10_ref = 0;
1895 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1896 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1897 path_arr_ptr[k] = path_conv_10_ref;
1902 uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) {
1903 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1904 assert(obj->tag == LDKEvent_ProbeFailed);
1905 uint64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
1906 return short_channel_id_ref;
1908 int64_t __attribute__((export_name("TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable"))) TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(uint64_t ptr) {
1909 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1910 assert(obj->tag == LDKEvent_PendingHTLCsForwardable);
1911 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
1912 return time_forwardable_conv;
1914 uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
1915 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1916 assert(obj->tag == LDKEvent_SpendableOutputs);
1917 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
1918 uint64_tArray outputs_arr = NULL;
1919 outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__);
1920 uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8);
1921 for (size_t b = 0; b < outputs_var.datalen; b++) {
1922 uint64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
1923 outputs_arr_ptr[b] = outputs_conv_27_ref;
1928 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) {
1929 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1930 assert(obj->tag == LDKEvent_PaymentForwarded);
1931 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1932 memcpy(prev_channel_id_arr->elems, obj->payment_forwarded.prev_channel_id.data, 32);
1933 return prev_channel_id_arr;
1935 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) {
1936 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1937 assert(obj->tag == LDKEvent_PaymentForwarded);
1938 int8_tArray next_channel_id_arr = init_int8_tArray(32, __LINE__);
1939 memcpy(next_channel_id_arr->elems, obj->payment_forwarded.next_channel_id.data, 32);
1940 return next_channel_id_arr;
1942 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) {
1943 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1944 assert(obj->tag == LDKEvent_PaymentForwarded);
1945 uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
1946 return fee_earned_msat_ref;
1948 jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) {
1949 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1950 assert(obj->tag == LDKEvent_PaymentForwarded);
1951 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
1952 return claim_from_onchain_tx_conv;
1954 int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
1955 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1956 assert(obj->tag == LDKEvent_ChannelClosed);
1957 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1958 memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
1959 return channel_id_arr;
1961 int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
1962 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1963 assert(obj->tag == LDKEvent_ChannelClosed);
1964 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
1965 return user_channel_id_conv;
1967 uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
1968 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1969 assert(obj->tag == LDKEvent_ChannelClosed);
1970 uint64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
1973 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) {
1974 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1975 assert(obj->tag == LDKEvent_DiscardFunding);
1976 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1977 memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32);
1978 return channel_id_arr;
1980 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) {
1981 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1982 assert(obj->tag == LDKEvent_DiscardFunding);
1983 LDKTransaction transaction_var = obj->discard_funding.transaction;
1984 int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__);
1985 memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen);
1986 return transaction_arr;
1988 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) {
1989 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1990 assert(obj->tag == LDKEvent_OpenChannelRequest);
1991 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1992 memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32);
1993 return temporary_channel_id_arr;
1995 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) {
1996 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1997 assert(obj->tag == LDKEvent_OpenChannelRequest);
1998 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1999 memcpy(counterparty_node_id_arr->elems, obj->open_channel_request.counterparty_node_id.compressed_form, 33);
2000 return counterparty_node_id_arr;
2002 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_funding_satoshis"))) TS_LDKEvent_OpenChannelRequest_get_funding_satoshis(uint64_t ptr) {
2003 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2004 assert(obj->tag == LDKEvent_OpenChannelRequest);
2005 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
2006 return funding_satoshis_conv;
2008 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_push_msat"))) TS_LDKEvent_OpenChannelRequest_get_push_msat(uint64_t ptr) {
2009 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2010 assert(obj->tag == LDKEvent_OpenChannelRequest);
2011 int64_t push_msat_conv = obj->open_channel_request.push_msat;
2012 return push_msat_conv;
2014 uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_type"))) TS_LDKEvent_OpenChannelRequest_get_channel_type(uint64_t ptr) {
2015 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2016 assert(obj->tag == LDKEvent_OpenChannelRequest);
2017 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
2018 uint64_t channel_type_ref = 0;
2019 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
2020 channel_type_ref = tag_ptr(channel_type_var.inner, false);
2021 return channel_type_ref;
2023 int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) {
2024 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2025 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
2026 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
2027 memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32);
2028 return prev_channel_id_arr;
2030 uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) {
2031 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2032 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
2033 uint64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
2034 return failed_next_destination_ref;
2036 uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDKCOption_EventZ_ty_from_ptr(uint64_t ptr) {
2037 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
2039 case LDKCOption_EventZ_Some: return 0;
2040 case LDKCOption_EventZ_None: return 1;
2044 uint64_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint64_t ptr) {
2045 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
2046 assert(obj->tag == LDKCOption_EventZ_Some);
2047 uint64_t some_ref = tag_ptr(&obj->some, false);
2050 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2051 CHECK(owner->result_ok);
2052 return COption_EventZ_clone(&*owner->contents.result);
2054 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ok"))) TS_CResult_COption_EventZDecodeErrorZ_get_ok(uint64_t owner) {
2055 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2056 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
2057 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
2058 uint64_t ret_ref = tag_ptr(ret_copy, true);
2062 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2063 LDKDecodeError ret = *owner->contents.err;
2064 ret.is_owned = false;
2067 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
2068 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2069 LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
2070 uint64_t ret_ref = 0;
2071 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2072 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2076 uint32_t __attribute__((export_name("TS_LDKErrorAction_ty_from_ptr"))) TS_LDKErrorAction_ty_from_ptr(uint64_t ptr) {
2077 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2079 case LDKErrorAction_DisconnectPeer: return 0;
2080 case LDKErrorAction_IgnoreError: return 1;
2081 case LDKErrorAction_IgnoreAndLog: return 2;
2082 case LDKErrorAction_IgnoreDuplicateGossip: return 3;
2083 case LDKErrorAction_SendErrorMessage: return 4;
2084 case LDKErrorAction_SendWarningMessage: return 5;
2088 uint64_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg"))) TS_LDKErrorAction_DisconnectPeer_get_msg(uint64_t ptr) {
2089 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2090 assert(obj->tag == LDKErrorAction_DisconnectPeer);
2091 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
2092 uint64_t msg_ref = 0;
2093 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2094 msg_ref = tag_ptr(msg_var.inner, false);
2097 uint32_t __attribute__((export_name("TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log"))) TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(uint64_t ptr) {
2098 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2099 assert(obj->tag == LDKErrorAction_IgnoreAndLog);
2100 uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
2101 return ignore_and_log_conv;
2103 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg"))) TS_LDKErrorAction_SendErrorMessage_get_msg(uint64_t ptr) {
2104 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2105 assert(obj->tag == LDKErrorAction_SendErrorMessage);
2106 LDKErrorMessage msg_var = obj->send_error_message.msg;
2107 uint64_t msg_ref = 0;
2108 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2109 msg_ref = tag_ptr(msg_var.inner, false);
2112 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_msg"))) TS_LDKErrorAction_SendWarningMessage_get_msg(uint64_t ptr) {
2113 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2114 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2115 LDKWarningMessage msg_var = obj->send_warning_message.msg;
2116 uint64_t msg_ref = 0;
2117 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2118 msg_ref = tag_ptr(msg_var.inner, false);
2121 uint32_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_log_level"))) TS_LDKErrorAction_SendWarningMessage_get_log_level(uint64_t ptr) {
2122 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2123 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2124 uint32_t log_level_conv = LDKLevel_to_js(obj->send_warning_message.log_level);
2125 return log_level_conv;
2127 uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint64_t ptr) {
2128 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2130 case LDKMessageSendEvent_SendAcceptChannel: return 0;
2131 case LDKMessageSendEvent_SendOpenChannel: return 1;
2132 case LDKMessageSendEvent_SendFundingCreated: return 2;
2133 case LDKMessageSendEvent_SendFundingSigned: return 3;
2134 case LDKMessageSendEvent_SendChannelReady: return 4;
2135 case LDKMessageSendEvent_SendAnnouncementSignatures: return 5;
2136 case LDKMessageSendEvent_UpdateHTLCs: return 6;
2137 case LDKMessageSendEvent_SendRevokeAndACK: return 7;
2138 case LDKMessageSendEvent_SendClosingSigned: return 8;
2139 case LDKMessageSendEvent_SendShutdown: return 9;
2140 case LDKMessageSendEvent_SendChannelReestablish: return 10;
2141 case LDKMessageSendEvent_SendChannelAnnouncement: return 11;
2142 case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 12;
2143 case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
2144 case LDKMessageSendEvent_SendChannelUpdate: return 14;
2145 case LDKMessageSendEvent_HandleError: return 15;
2146 case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
2147 case LDKMessageSendEvent_SendShortIdsQuery: return 17;
2148 case LDKMessageSendEvent_SendReplyChannelRange: return 18;
2149 case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
2153 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint64_t ptr) {
2154 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2155 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2156 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2157 memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33);
2160 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_msg"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(uint64_t ptr) {
2161 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2162 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2163 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2164 uint64_t msg_ref = 0;
2165 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2166 msg_ref = tag_ptr(msg_var.inner, false);
2169 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint64_t ptr) {
2170 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2171 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2172 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2173 memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33);
2176 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_msg"))) TS_LDKMessageSendEvent_SendOpenChannel_get_msg(uint64_t ptr) {
2177 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2178 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2179 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2180 uint64_t msg_ref = 0;
2181 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2182 msg_ref = tag_ptr(msg_var.inner, false);
2185 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint64_t ptr) {
2186 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2187 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2188 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2189 memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33);
2192 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_msg"))) TS_LDKMessageSendEvent_SendFundingCreated_get_msg(uint64_t ptr) {
2193 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2194 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2195 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2196 uint64_t msg_ref = 0;
2197 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2198 msg_ref = tag_ptr(msg_var.inner, false);
2201 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint64_t ptr) {
2202 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2203 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2204 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2205 memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33);
2208 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_msg"))) TS_LDKMessageSendEvent_SendFundingSigned_get_msg(uint64_t ptr) {
2209 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2210 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2211 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2212 uint64_t msg_ref = 0;
2213 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2214 msg_ref = tag_ptr(msg_var.inner, false);
2217 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReady_get_node_id(uint64_t ptr) {
2218 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2219 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2220 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2221 memcpy(node_id_arr->elems, obj->send_channel_ready.node_id.compressed_form, 33);
2224 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_msg"))) TS_LDKMessageSendEvent_SendChannelReady_get_msg(uint64_t ptr) {
2225 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2226 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2227 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2228 uint64_t msg_ref = 0;
2229 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2230 msg_ref = tag_ptr(msg_var.inner, false);
2233 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint64_t ptr) {
2234 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2235 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2236 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2237 memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33);
2240 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(uint64_t ptr) {
2241 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2242 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2243 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2244 uint64_t msg_ref = 0;
2245 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2246 msg_ref = tag_ptr(msg_var.inner, false);
2249 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint64_t ptr) {
2250 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2251 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2252 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2253 memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33);
2256 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_updates"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(uint64_t ptr) {
2257 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2258 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2259 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2260 uint64_t updates_ref = 0;
2261 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2262 updates_ref = tag_ptr(updates_var.inner, false);
2265 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint64_t ptr) {
2266 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2267 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2268 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2269 memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33);
2272 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(uint64_t ptr) {
2273 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2274 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2275 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2276 uint64_t msg_ref = 0;
2277 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2278 msg_ref = tag_ptr(msg_var.inner, false);
2281 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint64_t ptr) {
2282 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2283 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2284 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2285 memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33);
2288 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_msg"))) TS_LDKMessageSendEvent_SendClosingSigned_get_msg(uint64_t ptr) {
2289 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2290 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2291 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2292 uint64_t msg_ref = 0;
2293 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2294 msg_ref = tag_ptr(msg_var.inner, false);
2297 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint64_t ptr) {
2298 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2299 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2300 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2301 memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33);
2304 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg"))) TS_LDKMessageSendEvent_SendShutdown_get_msg(uint64_t ptr) {
2305 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2306 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2307 LDKShutdown msg_var = obj->send_shutdown.msg;
2308 uint64_t msg_ref = 0;
2309 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2310 msg_ref = tag_ptr(msg_var.inner, false);
2313 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint64_t ptr) {
2314 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2315 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2316 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2317 memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33);
2320 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_msg"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(uint64_t ptr) {
2321 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2322 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2323 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2324 uint64_t msg_ref = 0;
2325 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2326 msg_ref = tag_ptr(msg_var.inner, false);
2329 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(uint64_t ptr) {
2330 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2331 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2332 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2333 memcpy(node_id_arr->elems, obj->send_channel_announcement.node_id.compressed_form, 33);
2336 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg(uint64_t ptr) {
2337 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2338 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2339 LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
2340 uint64_t msg_ref = 0;
2341 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2342 msg_ref = tag_ptr(msg_var.inner, false);
2345 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(uint64_t ptr) {
2346 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2347 assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
2348 LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
2349 uint64_t update_msg_ref = 0;
2350 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2351 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2352 return update_msg_ref;
2354 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
2355 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2356 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2357 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2358 uint64_t msg_ref = 0;
2359 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2360 msg_ref = tag_ptr(msg_var.inner, false);
2363 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint64_t ptr) {
2364 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2365 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2366 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2367 uint64_t update_msg_ref = 0;
2368 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2369 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2370 return update_msg_ref;
2372 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
2373 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2374 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
2375 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2376 uint64_t msg_ref = 0;
2377 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2378 msg_ref = tag_ptr(msg_var.inner, false);
2381 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint64_t ptr) {
2382 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2383 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2384 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2385 memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33);
2388 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(uint64_t ptr) {
2389 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2390 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2391 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
2392 uint64_t msg_ref = 0;
2393 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2394 msg_ref = tag_ptr(msg_var.inner, false);
2397 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint64_t ptr) {
2398 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2399 assert(obj->tag == LDKMessageSendEvent_HandleError);
2400 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2401 memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33);
2404 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint64_t ptr) {
2405 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2406 assert(obj->tag == LDKMessageSendEvent_HandleError);
2407 uint64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2410 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint64_t ptr) {
2411 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2412 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2413 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2414 memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33);
2417 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(uint64_t ptr) {
2418 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2419 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2420 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2421 uint64_t msg_ref = 0;
2422 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2423 msg_ref = tag_ptr(msg_var.inner, false);
2426 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint64_t ptr) {
2427 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2428 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2429 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2430 memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33);
2433 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(uint64_t ptr) {
2434 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2435 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2436 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2437 uint64_t msg_ref = 0;
2438 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2439 msg_ref = tag_ptr(msg_var.inner, false);
2442 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint64_t ptr) {
2443 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2444 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2445 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2446 memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33);
2449 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg(uint64_t ptr) {
2450 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2451 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2452 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2453 uint64_t msg_ref = 0;
2454 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2455 msg_ref = tag_ptr(msg_var.inner, false);
2458 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(uint64_t ptr) {
2459 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2460 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2461 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2462 memcpy(node_id_arr->elems, obj->send_gossip_timestamp_filter.node_id.compressed_form, 33);
2465 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(uint64_t ptr) {
2466 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2467 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2468 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2469 uint64_t msg_ref = 0;
2470 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2471 msg_ref = tag_ptr(msg_var.inner, false);
2474 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2475 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2476 for (size_t i = 0; i < ret.datalen; i++) {
2477 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2481 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2482 CHECK(owner->result_ok);
2483 return TxOut_clone(&*owner->contents.result);
2485 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
2486 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2487 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
2488 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
2489 return tag_ptr(ret_ref, true);
2492 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2493 CHECK(!owner->result_ok);
2494 return AccessError_clone(&*owner->contents.err);
2496 uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
2497 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2498 uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
2502 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2505 uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) {
2506 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2507 uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2511 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2514 int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) {
2515 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2516 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2517 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
2518 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
2522 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2523 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2524 for (size_t i = 0; i < ret.datalen; i++) {
2525 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2529 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
2530 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
2531 for (size_t i = 0; i < ret.datalen; i++) {
2532 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
2536 static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2537 CHECK(owner->result_ok);
2538 return *owner->contents.result;
2540 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) {
2541 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2542 CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
2545 static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2546 CHECK(!owner->result_ok);
2547 return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
2549 uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) {
2550 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2551 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
2555 uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
2556 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2558 case LDKMonitorEvent_HTLCEvent: return 0;
2559 case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
2560 case LDKMonitorEvent_UpdateCompleted: return 2;
2561 case LDKMonitorEvent_UpdateFailed: return 3;
2565 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) {
2566 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2567 assert(obj->tag == LDKMonitorEvent_HTLCEvent);
2568 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2569 uint64_t htlc_event_ref = 0;
2570 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2571 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2572 return htlc_event_ref;
2574 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) {
2575 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2576 assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed);
2577 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2578 uint64_t commitment_tx_confirmed_ref = 0;
2579 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2580 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2581 return commitment_tx_confirmed_ref;
2583 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) {
2584 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2585 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2586 LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
2587 uint64_t funding_txo_ref = 0;
2588 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2589 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2590 return funding_txo_ref;
2592 int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) {
2593 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2594 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2595 int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
2596 return monitor_update_id_conv;
2598 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
2599 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2600 assert(obj->tag == LDKMonitorEvent_UpdateFailed);
2601 LDKOutPoint update_failed_var = obj->update_failed;
2602 uint64_t update_failed_ref = 0;
2603 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2604 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2605 return update_failed_ref;
2607 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2608 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2609 for (size_t i = 0; i < ret.datalen; i++) {
2610 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2614 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2615 LDKOutPoint ret = owner->a;
2616 ret.is_owned = false;
2619 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) {
2620 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2621 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2622 uint64_t ret_ref = 0;
2623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2628 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2629 return CVec_MonitorEventZ_clone(&owner->b);
2631 uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) {
2632 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2633 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2634 uint64_tArray ret_arr = NULL;
2635 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
2636 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
2637 for (size_t o = 0; o < ret_var.datalen; o++) {
2638 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2639 *ret_conv_14_copy = ret_var.data[o];
2640 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2641 ret_arr_ptr[o] = ret_conv_14_ref;
2648 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2651 int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) {
2652 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2653 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
2654 memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33);
2658 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
2659 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
2660 for (size_t i = 0; i < ret.datalen; i++) {
2661 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
2665 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2666 LDKFixedPenaltyScorer ret = *owner->contents.result;
2667 ret.is_owned = false;
2670 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) {
2671 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2672 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
2673 uint64_t ret_ref = 0;
2674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2679 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2680 LDKDecodeError ret = *owner->contents.err;
2681 ret.is_owned = false;
2684 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
2685 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2686 LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
2687 uint64_t ret_ref = 0;
2688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2693 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2696 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) {
2697 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2698 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
2702 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2705 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) {
2706 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2707 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
2711 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) {
2712 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2714 case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0;
2715 case LDKCOption_C2Tuple_u64u64ZZ_None: return 1;
2719 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) {
2720 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2721 assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some);
2722 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2723 *some_conv = obj->some;
2724 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
2725 return tag_ptr(some_conv, true);
2727 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
2728 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
2729 for (size_t i = 0; i < ret.datalen; i++) {
2730 ret.data[i] = NodeId_clone(&orig->data[i]);
2734 typedef struct LDKLogger_JCalls {
2735 atomic_size_t refcnt;
2736 uint32_t instance_ptr;
2738 static void LDKLogger_JCalls_free(void* this_arg) {
2739 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2740 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2744 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
2745 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2746 LDKRecord record_var = *record;
2747 uint64_t record_ref = 0;
2748 record_var = Record_clone(&record_var);
2749 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
2750 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
2751 js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0);
2753 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
2754 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
2755 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2757 static inline LDKLogger LDKLogger_init (JSValue o) {
2758 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
2759 atomic_init(&calls->refcnt, 1);
2760 calls->instance_ptr = o;
2763 .this_arg = (void*) calls,
2764 .log = log_LDKLogger_jcall,
2765 .free = LDKLogger_JCalls_free,
2769 uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) {
2770 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
2771 *res_ptr = LDKLogger_init(o);
2772 return tag_ptr(res_ptr, true);
2774 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2775 LDKProbabilisticScorer ret = *owner->contents.result;
2776 ret.is_owned = false;
2779 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) {
2780 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2781 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
2782 uint64_t ret_ref = 0;
2783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2788 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2789 LDKDecodeError ret = *owner->contents.err;
2790 ret.is_owned = false;
2793 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
2794 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2795 LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
2796 uint64_t ret_ref = 0;
2797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2802 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2803 LDKInitFeatures ret = *owner->contents.result;
2804 ret.is_owned = false;
2807 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2808 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2809 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
2810 uint64_t ret_ref = 0;
2811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2816 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2817 LDKDecodeError ret = *owner->contents.err;
2818 ret.is_owned = false;
2821 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2822 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2823 LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
2824 uint64_t ret_ref = 0;
2825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2830 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2831 LDKChannelFeatures ret = *owner->contents.result;
2832 ret.is_owned = false;
2835 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2836 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2837 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
2838 uint64_t ret_ref = 0;
2839 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2840 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2844 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2845 LDKDecodeError ret = *owner->contents.err;
2846 ret.is_owned = false;
2849 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2850 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2851 LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
2852 uint64_t ret_ref = 0;
2853 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2854 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2858 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2859 LDKNodeFeatures ret = *owner->contents.result;
2860 ret.is_owned = false;
2863 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2864 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2865 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
2866 uint64_t ret_ref = 0;
2867 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2868 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2872 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2873 LDKDecodeError ret = *owner->contents.err;
2874 ret.is_owned = false;
2877 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2878 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2879 LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
2880 uint64_t ret_ref = 0;
2881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2886 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2887 LDKInvoiceFeatures ret = *owner->contents.result;
2888 ret.is_owned = false;
2891 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2892 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2893 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2901 LDKDecodeError ret = *owner->contents.err;
2902 ret.is_owned = false;
2905 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2906 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2907 LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
2908 uint64_t ret_ref = 0;
2909 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2910 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2914 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2915 LDKChannelTypeFeatures ret = *owner->contents.result;
2916 ret.is_owned = false;
2919 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2920 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2921 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
2922 uint64_t ret_ref = 0;
2923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2928 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2929 LDKDecodeError ret = *owner->contents.err;
2930 ret.is_owned = false;
2933 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2934 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2935 LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
2936 uint64_t ret_ref = 0;
2937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2942 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2943 LDKNodeId ret = *owner->contents.result;
2944 ret.is_owned = false;
2947 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) {
2948 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2949 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
2950 uint64_t ret_ref = 0;
2951 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2952 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2956 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2957 LDKDecodeError ret = *owner->contents.err;
2958 ret.is_owned = false;
2961 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
2962 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2963 LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
2964 uint64_t ret_ref = 0;
2965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2970 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2971 CHECK(owner->result_ok);
2972 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
2974 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) {
2975 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2976 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
2977 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
2978 uint64_t ret_ref = tag_ptr(ret_copy, true);
2982 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2983 LDKDecodeError ret = *owner->contents.err;
2984 ret.is_owned = false;
2987 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
2988 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2989 LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
2990 uint64_t ret_ref = 0;
2991 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2992 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2996 typedef struct LDKAccess_JCalls {
2997 atomic_size_t refcnt;
2998 uint32_t instance_ptr;
3000 static void LDKAccess_JCalls_free(void* this_arg) {
3001 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
3002 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3006 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
3007 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
3008 int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
3009 memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
3010 int64_t short_channel_id_conv = short_channel_id;
3011 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);
3012 void* ret_ptr = untag_ptr(ret);
3013 CHECK_ACCESS(ret_ptr);
3014 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
3015 FREE(untag_ptr(ret));
3018 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
3019 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
3020 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3022 static inline LDKAccess LDKAccess_init (JSValue o) {
3023 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
3024 atomic_init(&calls->refcnt, 1);
3025 calls->instance_ptr = o;
3028 .this_arg = (void*) calls,
3029 .get_utxo = get_utxo_LDKAccess_jcall,
3030 .free = LDKAccess_JCalls_free,
3034 uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
3035 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
3036 *res_ptr = LDKAccess_init(o);
3037 return tag_ptr(res_ptr, true);
3039 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) {
3040 void* this_arg_ptr = untag_ptr(this_arg);
3041 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3042 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
3043 unsigned char genesis_hash_arr[32];
3044 CHECK(genesis_hash->arr_len == 32);
3045 memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
3046 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
3047 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
3048 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
3049 return tag_ptr(ret_conv, true);
3052 uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
3053 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
3055 case LDKCOption_AccessZ_Some: return 0;
3056 case LDKCOption_AccessZ_None: return 1;
3060 uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
3061 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
3062 assert(obj->tag == LDKCOption_AccessZ_Some);
3063 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
3064 *some_ret = obj->some;
3065 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
3066 if ((*some_ret).free == LDKAccess_JCalls_free) {
3067 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3068 LDKAccess_JCalls_cloned(&(*some_ret));
3070 return tag_ptr(some_ret, true);
3072 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3073 CHECK(owner->result_ok);
3074 return *owner->contents.result;
3076 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) {
3077 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3078 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
3082 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3083 LDKLightningError ret = *owner->contents.err;
3084 ret.is_owned = false;
3087 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) {
3088 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3089 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
3090 uint64_t ret_ref = 0;
3091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3096 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3097 LDKChannelAnnouncement ret = owner->a;
3098 ret.is_owned = false;
3101 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) {
3102 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3103 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
3104 uint64_t ret_ref = 0;
3105 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3106 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3110 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3111 LDKChannelUpdate ret = owner->b;
3112 ret.is_owned = false;
3115 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) {
3116 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3117 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
3118 uint64_t ret_ref = 0;
3119 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3120 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3124 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3125 LDKChannelUpdate ret = owner->c;
3126 ret.is_owned = false;
3129 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) {
3130 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3131 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
3132 uint64_t ret_ref = 0;
3133 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3134 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3138 uint32_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr(uint64_t ptr) {
3139 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
3141 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: return 0;
3142 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: return 1;
3146 uint64_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some(uint64_t ptr) {
3147 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
3148 assert(obj->tag == LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some);
3149 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
3150 *some_conv = obj->some;
3151 *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
3152 return tag_ptr(some_conv, true);
3154 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3155 CHECK(owner->result_ok);
3156 return *owner->contents.result;
3158 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_ok"))) TS_CResult_NoneLightningErrorZ_get_ok(uint64_t owner) {
3159 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3160 CResult_NoneLightningErrorZ_get_ok(owner_conv);
3163 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3164 LDKLightningError ret = *owner->contents.err;
3165 ret.is_owned = false;
3168 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint64_t owner) {
3169 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3170 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3171 uint64_t ret_ref = 0;
3172 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3173 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3177 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3178 LDKChannelUpdateInfo ret = *owner->contents.result;
3179 ret.is_owned = false;
3182 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(uint64_t owner) {
3183 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3184 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3185 uint64_t ret_ref = 0;
3186 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3187 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3191 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3192 LDKDecodeError ret = *owner->contents.err;
3193 ret.is_owned = false;
3196 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
3197 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3198 LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3199 uint64_t ret_ref = 0;
3200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3205 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3206 LDKChannelInfo ret = *owner->contents.result;
3207 ret.is_owned = false;
3210 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint64_t owner) {
3211 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3212 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3213 uint64_t ret_ref = 0;
3214 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3215 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3219 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3220 LDKDecodeError ret = *owner->contents.err;
3221 ret.is_owned = false;
3224 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
3225 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3226 LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3227 uint64_t ret_ref = 0;
3228 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3229 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3233 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3234 LDKRoutingFees ret = *owner->contents.result;
3235 ret.is_owned = false;
3238 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint64_t owner) {
3239 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3240 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3241 uint64_t ret_ref = 0;
3242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3247 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3248 LDKDecodeError ret = *owner->contents.err;
3249 ret.is_owned = false;
3252 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
3253 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3254 LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3255 uint64_t ret_ref = 0;
3256 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3257 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3261 uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetAddress_ty_from_ptr(uint64_t ptr) {
3262 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3264 case LDKNetAddress_IPv4: return 0;
3265 case LDKNetAddress_IPv6: return 1;
3266 case LDKNetAddress_OnionV2: return 2;
3267 case LDKNetAddress_OnionV3: return 3;
3268 case LDKNetAddress_Hostname: return 4;
3272 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint64_t ptr) {
3273 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3274 assert(obj->tag == LDKNetAddress_IPv4);
3275 int8_tArray addr_arr = init_int8_tArray(4, __LINE__);
3276 memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4);
3279 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNetAddress_IPv4_get_port(uint64_t ptr) {
3280 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3281 assert(obj->tag == LDKNetAddress_IPv4);
3282 int16_t port_conv = obj->i_pv4.port;
3285 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint64_t ptr) {
3286 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3287 assert(obj->tag == LDKNetAddress_IPv6);
3288 int8_tArray addr_arr = init_int8_tArray(16, __LINE__);
3289 memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16);
3292 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNetAddress_IPv6_get_port(uint64_t ptr) {
3293 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3294 assert(obj->tag == LDKNetAddress_IPv6);
3295 int16_t port_conv = obj->i_pv6.port;
3298 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint64_t ptr) {
3299 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3300 assert(obj->tag == LDKNetAddress_OnionV2);
3301 int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__);
3302 memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12);
3303 return onion_v2_arr;
3305 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint64_t ptr) {
3306 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3307 assert(obj->tag == LDKNetAddress_OnionV3);
3308 int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__);
3309 memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32);
3310 return ed25519_pubkey_arr;
3312 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_checksum"))) TS_LDKNetAddress_OnionV3_get_checksum(uint64_t ptr) {
3313 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3314 assert(obj->tag == LDKNetAddress_OnionV3);
3315 int16_t checksum_conv = obj->onion_v3.checksum;
3316 return checksum_conv;
3318 int8_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_version"))) TS_LDKNetAddress_OnionV3_get_version(uint64_t ptr) {
3319 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3320 assert(obj->tag == LDKNetAddress_OnionV3);
3321 int8_t version_conv = obj->onion_v3.version;
3322 return version_conv;
3324 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_port"))) TS_LDKNetAddress_OnionV3_get_port(uint64_t ptr) {
3325 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3326 assert(obj->tag == LDKNetAddress_OnionV3);
3327 int16_t port_conv = obj->onion_v3.port;
3330 uint64_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_hostname"))) TS_LDKNetAddress_Hostname_get_hostname(uint64_t ptr) {
3331 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3332 assert(obj->tag == LDKNetAddress_Hostname);
3333 LDKHostname hostname_var = obj->hostname.hostname;
3334 uint64_t hostname_ref = 0;
3335 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3336 hostname_ref = tag_ptr(hostname_var.inner, false);
3337 return hostname_ref;
3339 int16_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_port"))) TS_LDKNetAddress_Hostname_get_port(uint64_t ptr) {
3340 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3341 assert(obj->tag == LDKNetAddress_Hostname);
3342 int16_t port_conv = obj->hostname.port;
3345 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3346 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3347 for (size_t i = 0; i < ret.datalen; i++) {
3348 ret.data[i] = NetAddress_clone(&orig->data[i]);
3352 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3353 LDKNodeAnnouncementInfo ret = *owner->contents.result;
3354 ret.is_owned = false;
3357 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint64_t owner) {
3358 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3359 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3360 uint64_t ret_ref = 0;
3361 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3362 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3366 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3367 LDKDecodeError ret = *owner->contents.err;
3368 ret.is_owned = false;
3371 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
3372 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3373 LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3374 uint64_t ret_ref = 0;
3375 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3376 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3380 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3381 LDKNodeAlias ret = *owner->contents.result;
3382 ret.is_owned = false;
3385 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok"))) TS_CResult_NodeAliasDecodeErrorZ_get_ok(uint64_t owner) {
3386 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3387 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3388 uint64_t ret_ref = 0;
3389 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3390 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3394 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3395 LDKDecodeError ret = *owner->contents.err;
3396 ret.is_owned = false;
3399 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
3400 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3401 LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
3402 uint64_t ret_ref = 0;
3403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3408 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3409 LDKNodeInfo ret = *owner->contents.result;
3410 ret.is_owned = false;
3413 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint64_t owner) {
3414 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3415 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
3416 uint64_t ret_ref = 0;
3417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3422 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3423 LDKDecodeError ret = *owner->contents.err;
3424 ret.is_owned = false;
3427 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
3428 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3429 LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
3430 uint64_t ret_ref = 0;
3431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3436 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3437 LDKNetworkGraph ret = *owner->contents.result;
3438 ret.is_owned = false;
3441 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint64_t owner) {
3442 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3443 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
3444 uint64_t ret_ref = 0;
3445 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3446 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3450 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3451 LDKDecodeError ret = *owner->contents.err;
3452 ret.is_owned = false;
3455 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
3456 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3457 LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
3458 uint64_t ret_ref = 0;
3459 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3460 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3464 uint32_t __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr"))) TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(uint64_t ptr) {
3465 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3467 case LDKCOption_CVec_NetAddressZZ_Some: return 0;
3468 case LDKCOption_CVec_NetAddressZZ_None: return 1;
3472 uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_get_some"))) TS_LDKCOption_CVec_NetAddressZZ_Some_get_some(uint64_t ptr) {
3473 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3474 assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some);
3475 LDKCVec_NetAddressZ some_var = obj->some;
3476 uint64_tArray some_arr = NULL;
3477 some_arr = init_uint64_tArray(some_var.datalen, __LINE__);
3478 uint64_t *some_arr_ptr = (uint64_t*)(((uint8_t*)some_arr) + 8);
3479 for (size_t m = 0; m < some_var.datalen; m++) {
3480 uint64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
3481 some_arr_ptr[m] = some_conv_12_ref;
3486 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3487 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
3488 ret.is_owned = false;
3491 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3492 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3493 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3494 uint64_t ret_ref = 0;
3495 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3496 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3500 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3501 LDKDecodeError ret = *owner->contents.err;
3502 ret.is_owned = false;
3505 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3506 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3507 LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3508 uint64_t ret_ref = 0;
3509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3514 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3515 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
3516 ret.is_owned = false;
3519 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3520 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3521 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3522 uint64_t ret_ref = 0;
3523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3528 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3529 LDKDecodeError ret = *owner->contents.err;
3530 ret.is_owned = false;
3533 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3534 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3535 LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3536 uint64_t ret_ref = 0;
3537 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3538 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3542 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3543 CHECK(owner->result_ok);
3544 return SpendableOutputDescriptor_clone(&*owner->contents.result);
3546 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3547 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3548 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
3549 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3550 uint64_t ret_ref = tag_ptr(ret_copy, true);
3554 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3555 LDKDecodeError ret = *owner->contents.err;
3556 ret.is_owned = false;
3559 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3560 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3561 LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3562 uint64_t ret_ref = 0;
3563 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3564 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3568 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
3569 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
3570 for (size_t i = 0; i < ret.datalen; i++) {
3571 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3575 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3578 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint64_t owner) {
3579 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3580 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3581 memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64);
3585 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3588 ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint64_t owner) {
3589 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3590 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
3591 ptrArray ret_arr = NULL;
3592 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
3593 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
3594 for (size_t m = 0; m < ret_var.datalen; m++) {
3595 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
3596 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
3597 ret_arr_ptr[m] = ret_conv_12_arr;
3603 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3604 CHECK(owner->result_ok);
3605 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
3607 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint64_t owner) {
3608 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3609 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3610 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
3611 return tag_ptr(ret_conv, true);
3614 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3615 CHECK(!owner->result_ok);
3616 return *owner->contents.err;
3618 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(uint64_t owner) {
3619 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3620 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
3623 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3624 CHECK(owner->result_ok);
3625 return *owner->contents.result;
3627 int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint64_t owner) {
3628 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3629 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3630 memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64);
3634 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3635 CHECK(!owner->result_ok);
3636 return *owner->contents.err;
3638 void __attribute__((export_name("TS_CResult_SignatureNoneZ_get_err"))) TS_CResult_SignatureNoneZ_get_err(uint64_t owner) {
3639 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3640 CResult_SignatureNoneZ_get_err(owner_conv);
3643 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3646 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
3647 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3648 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3649 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
3653 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3656 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
3657 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3658 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3659 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
3663 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3664 CHECK(owner->result_ok);
3665 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
3667 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
3668 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3669 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
3670 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
3671 return tag_ptr(ret_conv, true);
3674 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3675 CHECK(!owner->result_ok);
3676 return *owner->contents.err;
3678 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
3679 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3680 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
3683 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3684 CHECK(owner->result_ok);
3685 return *owner->contents.result;
3687 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
3688 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3689 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3690 memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
3694 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3695 CHECK(!owner->result_ok);
3696 return *owner->contents.err;
3698 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
3699 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3700 CResult_SecretKeyNoneZ_get_err(owner_conv);
3703 uint32_t __attribute__((export_name("TS_LDKCOption_ScalarZ_ty_from_ptr"))) TS_LDKCOption_ScalarZ_ty_from_ptr(uint64_t ptr) {
3704 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
3706 case LDKCOption_ScalarZ_Some: return 0;
3707 case LDKCOption_ScalarZ_None: return 1;
3711 uint64_t __attribute__((export_name("TS_LDKCOption_ScalarZ_Some_get_some"))) TS_LDKCOption_ScalarZ_Some_get_some(uint64_t ptr) {
3712 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
3713 assert(obj->tag == LDKCOption_ScalarZ_Some);
3714 LDKBigEndianScalar* some_ref = &obj->some;
3715 return tag_ptr(some_ref, false);
3717 static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
3718 CHECK(owner->result_ok);
3719 return ThirtyTwoBytes_clone(&*owner->contents.result);
3721 int8_tArray __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_ok"))) TS_CResult_SharedSecretNoneZ_get_ok(uint64_t owner) {
3722 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
3723 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3724 memcpy(ret_arr->elems, CResult_SharedSecretNoneZ_get_ok(owner_conv).data, 32);
3728 static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
3729 CHECK(!owner->result_ok);
3730 return *owner->contents.err;
3732 void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_err"))) TS_CResult_SharedSecretNoneZ_get_err(uint64_t owner) {
3733 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
3734 CResult_SharedSecretNoneZ_get_err(owner_conv);
3737 typedef struct LDKBaseSign_JCalls {
3738 atomic_size_t refcnt;
3739 uint32_t instance_ptr;
3740 } LDKBaseSign_JCalls;
3741 static void LDKBaseSign_JCalls_free(void* this_arg) {
3742 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3743 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3747 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3748 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3749 int64_t idx_conv = idx;
3750 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
3751 LDKPublicKey ret_ref;
3752 CHECK(ret->arr_len == 33);
3753 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
3756 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3757 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3758 int64_t idx_conv = idx;
3759 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
3760 LDKThirtyTwoBytes ret_ref;
3761 CHECK(ret->arr_len == 32);
3762 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3765 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
3766 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3767 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
3768 uint64_t holder_tx_ref = 0;
3769 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
3770 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
3771 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
3772 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3773 ptrArray preimages_arr = NULL;
3774 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3775 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3776 for (size_t m = 0; m < preimages_var.datalen; m++) {
3777 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3778 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3779 preimages_arr_ptr[m] = preimages_conv_12_arr;
3782 FREE(preimages_var.data);
3783 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3784 void* ret_ptr = untag_ptr(ret);
3785 CHECK_ACCESS(ret_ptr);
3786 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3787 FREE(untag_ptr(ret));
3790 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
3791 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3792 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
3793 LDKThirtyTwoBytes ret_ref;
3794 CHECK(ret->arr_len == 32);
3795 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3798 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
3799 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3800 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
3801 uint64_t commitment_tx_ref = 0;
3802 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
3803 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3804 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3805 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3806 ptrArray preimages_arr = NULL;
3807 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3808 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3809 for (size_t m = 0; m < preimages_var.datalen; m++) {
3810 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3811 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3812 preimages_arr_ptr[m] = preimages_conv_12_arr;
3815 FREE(preimages_var.data);
3816 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3817 void* ret_ptr = untag_ptr(ret);
3818 CHECK_ACCESS(ret_ptr);
3819 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3820 FREE(untag_ptr(ret));
3823 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
3824 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3825 int64_t idx_conv = idx;
3826 int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
3827 memcpy(secret_arr->elems, *secret, 32);
3828 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
3829 void* ret_ptr = untag_ptr(ret);
3830 CHECK_ACCESS(ret_ptr);
3831 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3832 FREE(untag_ptr(ret));
3835 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
3836 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3837 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
3838 uint64_t commitment_tx_ref = 0;
3839 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
3840 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3841 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3842 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
3843 void* ret_ptr = untag_ptr(ret);
3844 CHECK_ACCESS(ret_ptr);
3845 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3846 FREE(untag_ptr(ret));
3849 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]) {
3850 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3851 LDKTransaction justice_tx_var = justice_tx;
3852 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3853 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3854 Transaction_free(justice_tx_var);
3855 uint32_t input_conv = input;
3856 int64_t amount_conv = amount;
3857 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3858 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3859 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);
3860 void* ret_ptr = untag_ptr(ret);
3861 CHECK_ACCESS(ret_ptr);
3862 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3863 FREE(untag_ptr(ret));
3866 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) {
3867 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3868 LDKTransaction justice_tx_var = justice_tx;
3869 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3870 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3871 Transaction_free(justice_tx_var);
3872 uint32_t input_conv = input;
3873 int64_t amount_conv = amount;
3874 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3875 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3876 LDKHTLCOutputInCommitment htlc_var = *htlc;
3877 uint64_t htlc_ref = 0;
3878 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3879 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3880 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3881 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);
3882 void* ret_ptr = untag_ptr(ret);
3883 CHECK_ACCESS(ret_ptr);
3884 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3885 FREE(untag_ptr(ret));
3888 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) {
3889 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3890 LDKTransaction htlc_tx_var = htlc_tx;
3891 int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
3892 memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
3893 Transaction_free(htlc_tx_var);
3894 uint32_t input_conv = input;
3895 int64_t amount_conv = amount;
3896 int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__);
3897 memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33);
3898 LDKHTLCOutputInCommitment htlc_var = *htlc;
3899 uint64_t htlc_ref = 0;
3900 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3901 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3902 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3903 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);
3904 void* ret_ptr = untag_ptr(ret);
3905 CHECK_ACCESS(ret_ptr);
3906 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3907 FREE(untag_ptr(ret));
3910 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
3911 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3912 LDKClosingTransaction closing_tx_var = *closing_tx;
3913 uint64_t closing_tx_ref = 0;
3914 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
3915 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
3916 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
3917 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
3918 void* ret_ptr = untag_ptr(ret);
3919 CHECK_ACCESS(ret_ptr);
3920 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3921 FREE(untag_ptr(ret));
3924 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
3925 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3926 LDKUnsignedChannelAnnouncement msg_var = *msg;
3927 uint64_t msg_ref = 0;
3928 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
3929 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3930 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
3931 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0);
3932 void* ret_ptr = untag_ptr(ret);
3933 CHECK_ACCESS(ret_ptr);
3934 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
3935 FREE(untag_ptr(ret));
3938 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
3939 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3940 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
3941 uint64_t channel_parameters_ref = 0;
3942 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
3943 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
3944 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
3945 js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0);
3947 static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
3948 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
3949 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3951 static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
3952 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
3953 atomic_init(&calls->refcnt, 1);
3954 calls->instance_ptr = o;
3956 LDKChannelPublicKeys pubkeys_conv;
3957 pubkeys_conv.inner = untag_ptr(pubkeys);
3958 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
3959 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
3962 .this_arg = (void*) calls,
3963 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
3964 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
3965 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
3966 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
3967 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
3968 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
3969 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
3970 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
3971 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
3972 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
3973 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
3974 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
3975 .ready_channel = ready_channel_LDKBaseSign_jcall,
3976 .free = LDKBaseSign_JCalls_free,
3977 .pubkeys = pubkeys_conv,
3978 .set_pubkeys = NULL,
3982 uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
3983 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
3984 *res_ptr = LDKBaseSign_init(o, pubkeys);
3985 return tag_ptr(res_ptr, true);
3987 int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
3988 void* this_arg_ptr = untag_ptr(this_arg);
3989 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3990 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3991 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3992 memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
3996 int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
3997 void* this_arg_ptr = untag_ptr(this_arg);
3998 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3999 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4000 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4001 memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
4005 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) {
4006 void* this_arg_ptr = untag_ptr(this_arg);
4007 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4008 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4009 LDKHolderCommitmentTransaction holder_tx_conv;
4010 holder_tx_conv.inner = untag_ptr(holder_tx);
4011 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
4012 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
4013 holder_tx_conv.is_owned = false;
4014 LDKCVec_PaymentPreimageZ preimages_constr;
4015 preimages_constr.datalen = preimages->arr_len;
4016 if (preimages_constr.datalen > 0)
4017 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
4019 preimages_constr.data = NULL;
4020 int8_tArray* preimages_vals = (void*) preimages->elems;
4021 for (size_t m = 0; m < preimages_constr.datalen; m++) {
4022 int8_tArray preimages_conv_12 = preimages_vals[m];
4023 LDKThirtyTwoBytes preimages_conv_12_ref;
4024 CHECK(preimages_conv_12->arr_len == 32);
4025 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
4026 preimages_constr.data[m] = preimages_conv_12_ref;
4029 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
4030 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
4031 return tag_ptr(ret_conv, true);
4034 int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
4035 void* this_arg_ptr = untag_ptr(this_arg);
4036 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4037 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4038 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4039 memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
4043 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) {
4044 void* this_arg_ptr = untag_ptr(this_arg);
4045 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4046 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4047 LDKCommitmentTransaction commitment_tx_conv;
4048 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4049 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4050 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4051 commitment_tx_conv.is_owned = false;
4052 LDKCVec_PaymentPreimageZ preimages_constr;
4053 preimages_constr.datalen = preimages->arr_len;
4054 if (preimages_constr.datalen > 0)
4055 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
4057 preimages_constr.data = NULL;
4058 int8_tArray* preimages_vals = (void*) preimages->elems;
4059 for (size_t m = 0; m < preimages_constr.datalen; m++) {
4060 int8_tArray preimages_conv_12 = preimages_vals[m];
4061 LDKThirtyTwoBytes preimages_conv_12_ref;
4062 CHECK(preimages_conv_12->arr_len == 32);
4063 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
4064 preimages_constr.data[m] = preimages_conv_12_ref;
4067 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4068 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
4069 return tag_ptr(ret_conv, true);
4072 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) {
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 unsigned char secret_arr[32];
4077 CHECK(secret->arr_len == 32);
4078 memcpy(secret_arr, secret->elems, 32); FREE(secret);
4079 unsigned char (*secret_ref)[32] = &secret_arr;
4080 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
4081 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
4082 return tag_ptr(ret_conv, true);
4085 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) {
4086 void* this_arg_ptr = untag_ptr(this_arg);
4087 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4088 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4089 LDKHolderCommitmentTransaction commitment_tx_conv;
4090 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4091 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4092 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4093 commitment_tx_conv.is_owned = false;
4094 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4095 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
4096 return tag_ptr(ret_conv, true);
4099 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) {
4100 void* this_arg_ptr = untag_ptr(this_arg);
4101 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4102 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4103 LDKTransaction justice_tx_ref;
4104 justice_tx_ref.datalen = justice_tx->arr_len;
4105 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4106 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
4107 justice_tx_ref.data_is_owned = true;
4108 unsigned char per_commitment_key_arr[32];
4109 CHECK(per_commitment_key->arr_len == 32);
4110 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
4111 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4112 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4113 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
4114 return tag_ptr(ret_conv, true);
4117 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) {
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 LDKTransaction justice_tx_ref;
4122 justice_tx_ref.datalen = justice_tx->arr_len;
4123 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4124 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
4125 justice_tx_ref.data_is_owned = true;
4126 unsigned char per_commitment_key_arr[32];
4127 CHECK(per_commitment_key->arr_len == 32);
4128 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
4129 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4130 LDKHTLCOutputInCommitment htlc_conv;
4131 htlc_conv.inner = untag_ptr(htlc);
4132 htlc_conv.is_owned = ptr_is_owned(htlc);
4133 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4134 htlc_conv.is_owned = false;
4135 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4136 *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);
4137 return tag_ptr(ret_conv, true);
4140 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) {
4141 void* this_arg_ptr = untag_ptr(this_arg);
4142 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4143 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4144 LDKTransaction htlc_tx_ref;
4145 htlc_tx_ref.datalen = htlc_tx->arr_len;
4146 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
4147 memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx);
4148 htlc_tx_ref.data_is_owned = true;
4149 LDKPublicKey per_commitment_point_ref;
4150 CHECK(per_commitment_point->arr_len == 33);
4151 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
4152 LDKHTLCOutputInCommitment htlc_conv;
4153 htlc_conv.inner = untag_ptr(htlc);
4154 htlc_conv.is_owned = ptr_is_owned(htlc);
4155 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4156 htlc_conv.is_owned = false;
4157 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4158 *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);
4159 return tag_ptr(ret_conv, true);
4162 uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
4163 void* this_arg_ptr = untag_ptr(this_arg);
4164 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4165 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4166 LDKClosingTransaction closing_tx_conv;
4167 closing_tx_conv.inner = untag_ptr(closing_tx);
4168 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
4169 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
4170 closing_tx_conv.is_owned = false;
4171 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4172 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
4173 return tag_ptr(ret_conv, true);
4176 uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
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 LDKUnsignedChannelAnnouncement msg_conv;
4181 msg_conv.inner = untag_ptr(msg);
4182 msg_conv.is_owned = ptr_is_owned(msg);
4183 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
4184 msg_conv.is_owned = false;
4185 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
4186 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
4187 return tag_ptr(ret_conv, true);
4190 void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
4191 void* this_arg_ptr = untag_ptr(this_arg);
4192 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4193 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4194 LDKChannelTransactionParameters channel_parameters_conv;
4195 channel_parameters_conv.inner = untag_ptr(channel_parameters);
4196 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
4197 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
4198 channel_parameters_conv.is_owned = false;
4199 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
4202 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
4203 if (this_arg->set_pubkeys != NULL)
4204 this_arg->set_pubkeys(this_arg);
4205 return this_arg->pubkeys;
4207 uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
4208 void* this_arg_ptr = untag_ptr(this_arg);
4209 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4210 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4211 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
4212 uint64_t ret_ref = 0;
4213 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4214 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4218 typedef struct LDKSign_JCalls {
4219 atomic_size_t refcnt;
4220 uint32_t instance_ptr;
4221 LDKBaseSign_JCalls* BaseSign;
4223 static void LDKSign_JCalls_free(void* this_arg) {
4224 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4225 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4229 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
4230 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4231 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0);
4232 LDKCVec_u8Z ret_ref;
4233 ret_ref.datalen = ret->arr_len;
4234 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4235 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4238 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
4239 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
4240 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4241 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
4243 static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4244 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
4245 atomic_init(&calls->refcnt, 1);
4246 calls->instance_ptr = o;
4248 LDKChannelPublicKeys pubkeys_conv;
4249 pubkeys_conv.inner = untag_ptr(pubkeys);
4250 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4251 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4254 .this_arg = (void*) calls,
4255 .write = write_LDKSign_jcall,
4256 .cloned = LDKSign_JCalls_cloned,
4257 .free = LDKSign_JCalls_free,
4258 .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
4260 calls->BaseSign = ret.BaseSign.this_arg;
4263 uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4264 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
4265 *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
4266 return tag_ptr(res_ptr, true);
4268 int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
4269 void* this_arg_ptr = untag_ptr(this_arg);
4270 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4271 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
4272 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
4273 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4274 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4275 CVec_u8Z_free(ret_var);
4279 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4280 CHECK(owner->result_ok);
4281 return Sign_clone(&*owner->contents.result);
4283 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
4284 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4285 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
4286 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
4287 return tag_ptr(ret_ret, true);
4290 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4291 LDKDecodeError ret = *owner->contents.err;
4292 ret.is_owned = false;
4295 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
4296 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4297 LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
4298 uint64_t ret_ref = 0;
4299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4304 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4305 CHECK(owner->result_ok);
4306 return *owner->contents.result;
4308 int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
4309 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4310 int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
4311 memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
4315 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4316 CHECK(!owner->result_ok);
4317 return *owner->contents.err;
4319 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
4320 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4321 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
4324 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
4325 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
4326 for (size_t i = 0; i < ret.datalen; i++) {
4327 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
4331 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4332 CHECK(owner->result_ok);
4333 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
4335 ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok(uint64_t owner) {
4336 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4337 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
4338 ptrArray ret_arr = NULL;
4339 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
4340 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
4341 for (size_t m = 0; m < ret_var.datalen; m++) {
4342 LDKCVec_u8Z ret_conv_12_var = ret_var.data[m];
4343 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
4344 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
4345 CVec_u8Z_free(ret_conv_12_var);
4346 ret_arr_ptr[m] = ret_conv_12_arr;
4353 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4354 CHECK(!owner->result_ok);
4355 return *owner->contents.err;
4357 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_err(uint64_t owner) {
4358 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4359 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
4362 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4363 LDKInMemorySigner ret = *owner->contents.result;
4364 ret.is_owned = false;
4367 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint64_t owner) {
4368 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4369 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
4370 uint64_t ret_ref = 0;
4371 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4372 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4376 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4377 LDKDecodeError ret = *owner->contents.err;
4378 ret.is_owned = false;
4381 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
4382 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4383 LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
4384 uint64_t ret_ref = 0;
4385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4390 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
4391 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
4392 for (size_t i = 0; i < ret.datalen; i++) {
4393 ret.data[i] = TxOut_clone(&orig->data[i]);
4397 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4398 CHECK(owner->result_ok);
4399 return *owner->contents.result;
4401 int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) {
4402 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4403 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
4404 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4405 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4409 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4410 CHECK(!owner->result_ok);
4411 return *owner->contents.err;
4413 void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) {
4414 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4415 CResult_TransactionNoneZ_get_err(owner_conv);
4418 uint32_t __attribute__((export_name("TS_LDKCOption_u16Z_ty_from_ptr"))) TS_LDKCOption_u16Z_ty_from_ptr(uint64_t ptr) {
4419 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4421 case LDKCOption_u16Z_Some: return 0;
4422 case LDKCOption_u16Z_None: return 1;
4426 int16_t __attribute__((export_name("TS_LDKCOption_u16Z_Some_get_some"))) TS_LDKCOption_u16Z_Some_get_some(uint64_t ptr) {
4427 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4428 assert(obj->tag == LDKCOption_u16Z_Some);
4429 int16_t some_conv = obj->some;
4432 uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
4433 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4435 case LDKAPIError_APIMisuseError: return 0;
4436 case LDKAPIError_FeeRateTooHigh: return 1;
4437 case LDKAPIError_RouteError: return 2;
4438 case LDKAPIError_ChannelUnavailable: return 3;
4439 case LDKAPIError_MonitorUpdateFailed: return 4;
4440 case LDKAPIError_IncompatibleShutdownScript: return 5;
4444 jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
4445 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4446 assert(obj->tag == LDKAPIError_APIMisuseError);
4447 LDKStr err_str = obj->api_misuse_error.err;
4448 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4451 jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
4452 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4453 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4454 LDKStr err_str = obj->fee_rate_too_high.err;
4455 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4458 int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
4459 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4460 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4461 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
4462 return feerate_conv;
4464 jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
4465 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4466 assert(obj->tag == LDKAPIError_RouteError);
4467 LDKStr err_str = obj->route_error.err;
4468 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4471 jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
4472 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4473 assert(obj->tag == LDKAPIError_ChannelUnavailable);
4474 LDKStr err_str = obj->channel_unavailable.err;
4475 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4478 uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
4479 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4480 assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
4481 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
4482 uint64_t script_ref = 0;
4483 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
4484 script_ref = tag_ptr(script_var.inner, false);
4487 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4488 CHECK(owner->result_ok);
4489 return *owner->contents.result;
4491 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
4492 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4493 CResult_NoneAPIErrorZ_get_ok(owner_conv);
4496 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4497 CHECK(!owner->result_ok);
4498 return APIError_clone(&*owner->contents.err);
4500 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
4501 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4502 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4503 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
4504 uint64_t ret_ref = tag_ptr(ret_copy, true);
4508 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
4509 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
4510 for (size_t i = 0; i < ret.datalen; i++) {
4511 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
4515 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
4516 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
4517 for (size_t i = 0; i < ret.datalen; i++) {
4518 ret.data[i] = APIError_clone(&orig->data[i]);
4522 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4523 CHECK(owner->result_ok);
4524 return ThirtyTwoBytes_clone(&*owner->contents.result);
4526 int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint64_t owner) {
4527 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4528 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4529 memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32);
4533 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4534 CHECK(!owner->result_ok);
4535 return APIError_clone(&*owner->contents.err);
4537 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_CResult__u832APIErrorZ_get_err(uint64_t owner) {
4538 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4539 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4540 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
4541 uint64_t ret_ref = tag_ptr(ret_copy, true);
4545 uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
4546 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4548 case LDKPaymentSendFailure_ParameterError: return 0;
4549 case LDKPaymentSendFailure_PathParameterError: return 1;
4550 case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
4551 case LDKPaymentSendFailure_PartialFailure: return 3;
4555 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint64_t ptr) {
4556 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4557 assert(obj->tag == LDKPaymentSendFailure_ParameterError);
4558 uint64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
4559 return parameter_error_ref;
4561 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint64_t ptr) {
4562 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4563 assert(obj->tag == LDKPaymentSendFailure_PathParameterError);
4564 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
4565 uint64_tArray path_parameter_error_arr = NULL;
4566 path_parameter_error_arr = init_uint64_tArray(path_parameter_error_var.datalen, __LINE__);
4567 uint64_t *path_parameter_error_arr_ptr = (uint64_t*)(((uint8_t*)path_parameter_error_arr) + 8);
4568 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
4569 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4570 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
4571 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
4572 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
4575 return path_parameter_error_arr;
4577 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
4578 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4579 assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
4580 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
4581 uint64_tArray all_failed_retry_safe_arr = NULL;
4582 all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
4583 uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
4584 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
4585 uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
4586 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
4589 return all_failed_retry_safe_arr;
4591 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
4592 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4593 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4594 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
4595 uint64_tArray results_arr = NULL;
4596 results_arr = init_uint64_tArray(results_var.datalen, __LINE__);
4597 uint64_t *results_arr_ptr = (uint64_t*)(((uint8_t*)results_arr) + 8);
4598 for (size_t w = 0; w < results_var.datalen; w++) {
4599 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4600 *results_conv_22_conv = results_var.data[w];
4601 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
4602 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
4607 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry"))) TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(uint64_t ptr) {
4608 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4609 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4610 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
4611 uint64_t failed_paths_retry_ref = 0;
4612 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
4613 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
4614 return failed_paths_retry_ref;
4616 int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint64_t ptr) {
4617 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4618 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4619 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
4620 memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
4621 return payment_id_arr;
4623 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4624 CHECK(owner->result_ok);
4625 return ThirtyTwoBytes_clone(&*owner->contents.result);
4627 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
4628 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4629 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4630 memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
4634 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4635 CHECK(!owner->result_ok);
4636 return PaymentSendFailure_clone(&*owner->contents.err);
4638 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
4639 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4640 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4641 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
4642 uint64_t ret_ref = tag_ptr(ret_copy, true);
4646 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4647 CHECK(owner->result_ok);
4648 return *owner->contents.result;
4650 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
4651 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4652 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
4655 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4656 CHECK(!owner->result_ok);
4657 return PaymentSendFailure_clone(&*owner->contents.err);
4659 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
4660 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4661 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4662 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
4663 uint64_t ret_ref = tag_ptr(ret_copy, true);
4667 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4668 return ThirtyTwoBytes_clone(&owner->a);
4670 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint64_t owner) {
4671 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4672 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4673 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32);
4677 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4678 return ThirtyTwoBytes_clone(&owner->b);
4680 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint64_t owner) {
4681 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4682 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4683 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32);
4687 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4688 CHECK(owner->result_ok);
4689 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
4691 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint64_t owner) {
4692 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4693 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
4694 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
4695 return tag_ptr(ret_conv, true);
4698 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4699 CHECK(!owner->result_ok);
4700 return PaymentSendFailure_clone(&*owner->contents.err);
4702 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(uint64_t owner) {
4703 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4704 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4705 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
4706 uint64_t ret_ref = tag_ptr(ret_copy, true);
4710 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
4711 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
4712 for (size_t i = 0; i < ret.datalen; i++) {
4713 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4717 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4718 return ThirtyTwoBytes_clone(&owner->a);
4720 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint64_t owner) {
4721 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4722 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4723 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32);
4727 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4728 return ThirtyTwoBytes_clone(&owner->b);
4730 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint64_t owner) {
4731 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4732 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4733 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32);
4737 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4738 CHECK(owner->result_ok);
4739 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4741 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint64_t owner) {
4742 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4743 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4744 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
4745 return tag_ptr(ret_conv, true);
4748 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4749 CHECK(!owner->result_ok);
4750 return *owner->contents.err;
4752 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint64_t owner) {
4753 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4754 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
4757 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4758 CHECK(owner->result_ok);
4759 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4761 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint64_t owner) {
4762 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4763 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4764 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
4765 return tag_ptr(ret_conv, true);
4768 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4769 CHECK(!owner->result_ok);
4770 return APIError_clone(&*owner->contents.err);
4772 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint64_t owner) {
4773 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4774 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4775 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
4776 uint64_t ret_ref = tag_ptr(ret_copy, true);
4780 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4781 CHECK(owner->result_ok);
4782 return ThirtyTwoBytes_clone(&*owner->contents.result);
4784 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint64_t owner) {
4785 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4786 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4787 memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32);
4791 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4792 CHECK(!owner->result_ok);
4793 return *owner->contents.err;
4795 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_err"))) TS_CResult_PaymentSecretNoneZ_get_err(uint64_t owner) {
4796 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4797 CResult_PaymentSecretNoneZ_get_err(owner_conv);
4800 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4801 CHECK(owner->result_ok);
4802 return ThirtyTwoBytes_clone(&*owner->contents.result);
4804 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint64_t owner) {
4805 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4806 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4807 memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32);
4811 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4812 CHECK(!owner->result_ok);
4813 return APIError_clone(&*owner->contents.err);
4815 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err"))) TS_CResult_PaymentSecretAPIErrorZ_get_err(uint64_t owner) {
4816 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4817 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4818 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
4819 uint64_t ret_ref = tag_ptr(ret_copy, true);
4823 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4824 CHECK(owner->result_ok);
4825 return ThirtyTwoBytes_clone(&*owner->contents.result);
4827 int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint64_t owner) {
4828 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4829 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4830 memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32);
4834 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4835 CHECK(!owner->result_ok);
4836 return APIError_clone(&*owner->contents.err);
4838 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_err"))) TS_CResult_PaymentPreimageAPIErrorZ_get_err(uint64_t owner) {
4839 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4840 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4841 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
4842 uint64_t ret_ref = tag_ptr(ret_copy, true);
4846 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4847 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
4848 ret.is_owned = false;
4851 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) {
4852 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4853 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
4854 uint64_t ret_ref = 0;
4855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4860 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4861 LDKDecodeError ret = *owner->contents.err;
4862 ret.is_owned = false;
4865 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
4866 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4867 LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
4868 uint64_t ret_ref = 0;
4869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4874 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4875 LDKChannelCounterparty ret = *owner->contents.result;
4876 ret.is_owned = false;
4879 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) {
4880 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4881 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
4882 uint64_t ret_ref = 0;
4883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4888 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4889 LDKDecodeError ret = *owner->contents.err;
4890 ret.is_owned = false;
4893 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
4894 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4895 LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
4896 uint64_t ret_ref = 0;
4897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4902 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4903 LDKChannelDetails ret = *owner->contents.result;
4904 ret.is_owned = false;
4907 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) {
4908 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4909 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
4910 uint64_t ret_ref = 0;
4911 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4912 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4916 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4917 LDKDecodeError ret = *owner->contents.err;
4918 ret.is_owned = false;
4921 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
4922 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4923 LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
4924 uint64_t ret_ref = 0;
4925 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4926 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4930 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4931 LDKPhantomRouteHints ret = *owner->contents.result;
4932 ret.is_owned = false;
4935 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(uint64_t owner) {
4936 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4937 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
4938 uint64_t ret_ref = 0;
4939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4944 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4945 LDKDecodeError ret = *owner->contents.err;
4946 ret.is_owned = false;
4949 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
4950 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4951 LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
4952 uint64_t ret_ref = 0;
4953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4954 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4958 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
4959 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
4960 for (size_t i = 0; i < ret.datalen; i++) {
4961 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
4965 typedef struct LDKWatch_JCalls {
4966 atomic_size_t refcnt;
4967 uint32_t instance_ptr;
4969 static void LDKWatch_JCalls_free(void* this_arg) {
4970 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4971 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4975 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
4976 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4977 LDKOutPoint funding_txo_var = funding_txo;
4978 uint64_t funding_txo_ref = 0;
4979 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4980 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4981 LDKChannelMonitor monitor_var = monitor;
4982 uint64_t monitor_ref = 0;
4983 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
4984 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
4985 uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
4986 void* ret_ptr = untag_ptr(ret);
4987 CHECK_ACCESS(ret_ptr);
4988 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4989 FREE(untag_ptr(ret));
4992 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
4993 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4994 LDKOutPoint funding_txo_var = funding_txo;
4995 uint64_t funding_txo_ref = 0;
4996 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4997 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4998 LDKChannelMonitorUpdate update_var = update;
4999 uint64_t update_ref = 0;
5000 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
5001 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
5002 uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0);
5003 void* ret_ptr = untag_ptr(ret);
5004 CHECK_ACCESS(ret_ptr);
5005 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
5006 FREE(untag_ptr(ret));
5009 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
5010 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
5011 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0);
5012 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
5013 ret_constr.datalen = ret->arr_len;
5014 if (ret_constr.datalen > 0)
5015 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
5017 ret_constr.data = NULL;
5018 uint64_t* ret_vals = ret->elems;
5019 for (size_t x = 0; x < ret_constr.datalen; x++) {
5020 uint64_t ret_conv_49 = ret_vals[x];
5021 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
5022 CHECK_ACCESS(ret_conv_49_ptr);
5023 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
5024 FREE(untag_ptr(ret_conv_49));
5025 ret_constr.data[x] = ret_conv_49_conv;
5030 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
5031 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
5032 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5034 static inline LDKWatch LDKWatch_init (JSValue o) {
5035 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
5036 atomic_init(&calls->refcnt, 1);
5037 calls->instance_ptr = o;
5040 .this_arg = (void*) calls,
5041 .watch_channel = watch_channel_LDKWatch_jcall,
5042 .update_channel = update_channel_LDKWatch_jcall,
5043 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
5044 .free = LDKWatch_JCalls_free,
5048 uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) {
5049 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
5050 *res_ptr = LDKWatch_init(o);
5051 return tag_ptr(res_ptr, true);
5053 uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
5054 void* this_arg_ptr = untag_ptr(this_arg);
5055 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5056 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5057 LDKOutPoint funding_txo_conv;
5058 funding_txo_conv.inner = untag_ptr(funding_txo);
5059 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
5060 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
5061 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
5062 LDKChannelMonitor monitor_conv;
5063 monitor_conv.inner = untag_ptr(monitor);
5064 monitor_conv.is_owned = ptr_is_owned(monitor);
5065 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
5066 monitor_conv = ChannelMonitor_clone(&monitor_conv);
5067 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
5068 *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
5069 return tag_ptr(ret_conv, true);
5072 uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
5073 void* this_arg_ptr = untag_ptr(this_arg);
5074 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5075 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5076 LDKOutPoint funding_txo_conv;
5077 funding_txo_conv.inner = untag_ptr(funding_txo);
5078 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
5079 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
5080 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
5081 LDKChannelMonitorUpdate update_conv;
5082 update_conv.inner = untag_ptr(update);
5083 update_conv.is_owned = ptr_is_owned(update);
5084 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
5085 update_conv = ChannelMonitorUpdate_clone(&update_conv);
5086 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
5087 *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
5088 return tag_ptr(ret_conv, true);
5091 uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
5092 void* this_arg_ptr = untag_ptr(this_arg);
5093 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5094 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
5095 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
5096 uint64_tArray ret_arr = NULL;
5097 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
5098 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
5099 for (size_t x = 0; x < ret_var.datalen; x++) {
5100 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
5101 *ret_conv_49_conv = ret_var.data[x];
5102 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
5109 typedef struct LDKBroadcasterInterface_JCalls {
5110 atomic_size_t refcnt;
5111 uint32_t instance_ptr;
5112 } LDKBroadcasterInterface_JCalls;
5113 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
5114 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
5115 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5119 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
5120 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
5121 LDKTransaction tx_var = tx;
5122 int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
5123 memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
5124 Transaction_free(tx_var);
5125 js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
5127 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
5128 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
5129 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5131 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JSValue o) {
5132 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
5133 atomic_init(&calls->refcnt, 1);
5134 calls->instance_ptr = o;
5136 LDKBroadcasterInterface ret = {
5137 .this_arg = (void*) calls,
5138 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
5139 .free = LDKBroadcasterInterface_JCalls_free,
5143 uint64_t __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroadcasterInterface_new(JSValue o) {
5144 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
5145 *res_ptr = LDKBroadcasterInterface_init(o);
5146 return tag_ptr(res_ptr, true);
5148 void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint64_t this_arg, int8_tArray tx) {
5149 void* this_arg_ptr = untag_ptr(this_arg);
5150 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5151 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
5152 LDKTransaction tx_ref;
5153 tx_ref.datalen = tx->arr_len;
5154 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
5155 memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx);
5156 tx_ref.data_is_owned = true;
5157 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
5160 typedef struct LDKKeysInterface_JCalls {
5161 atomic_size_t refcnt;
5162 uint32_t instance_ptr;
5163 } LDKKeysInterface_JCalls;
5164 static void LDKKeysInterface_JCalls_free(void* this_arg) {
5165 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5166 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5170 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
5171 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5172 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5173 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0);
5174 void* ret_ptr = untag_ptr(ret);
5175 CHECK_ACCESS(ret_ptr);
5176 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
5177 FREE(untag_ptr(ret));
5180 LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
5181 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5182 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5183 int8_tArray other_key_arr = init_int8_tArray(33, __LINE__);
5184 memcpy(other_key_arr->elems, other_key.compressed_form, 33);
5185 LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
5186 *tweak_copy = tweak;
5187 uint64_t tweak_ref = tag_ptr(tweak_copy, true);
5188 uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 21, recipient_conv, (uint32_t)other_key_arr, tweak_ref, 0, 0, 0);
5189 void* ret_ptr = untag_ptr(ret);
5190 CHECK_ACCESS(ret_ptr);
5191 LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
5192 FREE(untag_ptr(ret));
5195 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
5196 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5197 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
5198 LDKCVec_u8Z ret_ref;
5199 ret_ref.datalen = ret->arr_len;
5200 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5201 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5204 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
5205 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5206 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 23, 0, 0, 0, 0, 0, 0);
5207 LDKShutdownScript ret_conv;
5208 ret_conv.inner = untag_ptr(ret);
5209 ret_conv.is_owned = ptr_is_owned(ret);
5210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
5213 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
5214 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5215 jboolean inbound_conv = inbound;
5216 int64_t channel_value_satoshis_conv = channel_value_satoshis;
5217 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 24, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
5218 void* ret_ptr = untag_ptr(ret);
5219 CHECK_ACCESS(ret_ptr);
5220 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
5221 FREE(untag_ptr(ret));
5224 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
5225 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5226 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, 0, 0, 0, 0, 0, 0);
5227 LDKThirtyTwoBytes ret_ref;
5228 CHECK(ret->arr_len == 32);
5229 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5232 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
5233 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5234 LDKu8slice reader_var = reader;
5235 int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
5236 memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
5237 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 26, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
5238 void* ret_ptr = untag_ptr(ret);
5239 CHECK_ACCESS(ret_ptr);
5240 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
5241 FREE(untag_ptr(ret));
5244 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
5245 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5246 LDKu8slice hrp_bytes_var = hrp_bytes;
5247 int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
5248 memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
5249 LDKCVec_u5Z invoice_data_var = invoice_data;
5250 ptrArray invoice_data_arr = NULL;
5251 invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
5252 int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
5253 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
5254 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
5255 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
5258 FREE(invoice_data_var.data);
5259 uint32_t receipient_conv = LDKRecipient_to_js(receipient);
5260 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0);
5261 void* ret_ptr = untag_ptr(ret);
5262 CHECK_ACCESS(ret_ptr);
5263 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
5264 FREE(untag_ptr(ret));
5267 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
5268 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5269 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, 0, 0, 0, 0, 0, 0);
5270 LDKThirtyTwoBytes ret_ref;
5271 CHECK(ret->arr_len == 32);
5272 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5275 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
5276 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
5277 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5279 static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
5280 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
5281 atomic_init(&calls->refcnt, 1);
5282 calls->instance_ptr = o;
5284 LDKKeysInterface ret = {
5285 .this_arg = (void*) calls,
5286 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
5287 .ecdh = ecdh_LDKKeysInterface_jcall,
5288 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
5289 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
5290 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
5291 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
5292 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
5293 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
5294 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
5295 .free = LDKKeysInterface_JCalls_free,
5299 uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
5300 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5301 *res_ptr = LDKKeysInterface_init(o);
5302 return tag_ptr(res_ptr, true);
5304 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
5305 void* this_arg_ptr = untag_ptr(this_arg);
5306 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5307 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5308 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5309 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
5310 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
5311 return tag_ptr(ret_conv, true);
5314 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) {
5315 void* this_arg_ptr = untag_ptr(this_arg);
5316 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5317 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5318 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5319 LDKPublicKey other_key_ref;
5320 CHECK(other_key->arr_len == 33);
5321 memcpy(other_key_ref.compressed_form, other_key->elems, 33); FREE(other_key);
5322 void* tweak_ptr = untag_ptr(tweak);
5323 CHECK_ACCESS(tweak_ptr);
5324 LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
5325 // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
5326 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
5327 *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
5328 return tag_ptr(ret_conv, true);
5331 int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
5332 void* this_arg_ptr = untag_ptr(this_arg);
5333 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5334 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5335 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
5336 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5337 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5338 CVec_u8Z_free(ret_var);
5342 uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
5343 void* this_arg_ptr = untag_ptr(this_arg);
5344 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5345 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5346 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
5347 uint64_t ret_ref = 0;
5348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5353 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) {
5354 void* this_arg_ptr = untag_ptr(this_arg);
5355 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5356 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5357 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5358 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
5359 return tag_ptr(ret_ret, true);
5362 int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
5363 void* this_arg_ptr = untag_ptr(this_arg);
5364 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5365 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5366 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5367 memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
5371 uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
5372 void* this_arg_ptr = untag_ptr(this_arg);
5373 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5374 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5375 LDKu8slice reader_ref;
5376 reader_ref.datalen = reader->arr_len;
5377 reader_ref.data = reader->elems;
5378 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
5379 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
5381 return tag_ptr(ret_conv, true);
5384 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) {
5385 void* this_arg_ptr = untag_ptr(this_arg);
5386 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5387 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5388 LDKu8slice hrp_bytes_ref;
5389 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
5390 hrp_bytes_ref.data = hrp_bytes->elems;
5391 LDKCVec_u5Z invoice_data_constr;
5392 invoice_data_constr.datalen = invoice_data->arr_len;
5393 if (invoice_data_constr.datalen > 0)
5394 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
5396 invoice_data_constr.data = NULL;
5397 int8_t* invoice_data_vals = (void*) invoice_data->elems;
5398 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
5399 int8_t invoice_data_conv_7 = invoice_data_vals[h];
5401 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
5404 LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
5405 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
5406 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
5408 return tag_ptr(ret_conv, true);
5411 int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
5412 void* this_arg_ptr = untag_ptr(this_arg);
5413 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5414 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5415 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5416 memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
5420 typedef struct LDKFeeEstimator_JCalls {
5421 atomic_size_t refcnt;
5422 uint32_t instance_ptr;
5423 } LDKFeeEstimator_JCalls;
5424 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
5425 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5426 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5430 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
5431 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5432 uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
5433 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, confirmation_target_conv, 0, 0, 0, 0, 0);
5435 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
5436 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
5437 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5439 static inline LDKFeeEstimator LDKFeeEstimator_init (JSValue o) {
5440 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
5441 atomic_init(&calls->refcnt, 1);
5442 calls->instance_ptr = o;
5444 LDKFeeEstimator ret = {
5445 .this_arg = (void*) calls,
5446 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
5447 .free = LDKFeeEstimator_JCalls_free,
5451 uint64_t __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_new(JSValue o) {
5452 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
5453 *res_ptr = LDKFeeEstimator_init(o);
5454 return tag_ptr(res_ptr, true);
5456 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) {
5457 void* this_arg_ptr = untag_ptr(this_arg);
5458 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5459 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
5460 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
5461 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
5465 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5466 return ThirtyTwoBytes_clone(&owner->a);
5468 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint64_t owner) {
5469 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5470 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5471 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32);
5475 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5476 LDKChannelManager ret = owner->b;
5477 ret.is_owned = false;
5480 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint64_t owner) {
5481 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5482 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
5483 uint64_t ret_ref = 0;
5484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5489 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5490 CHECK(owner->result_ok);
5491 return &*owner->contents.result;
5493 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint64_t owner) {
5494 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5495 uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
5499 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5500 LDKDecodeError ret = *owner->contents.err;
5501 ret.is_owned = false;
5504 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
5505 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5506 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
5507 uint64_t ret_ref = 0;
5508 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5509 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5513 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5514 LDKChannelConfig ret = *owner->contents.result;
5515 ret.is_owned = false;
5518 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint64_t owner) {
5519 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5520 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
5521 uint64_t ret_ref = 0;
5522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5527 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5528 LDKDecodeError ret = *owner->contents.err;
5529 ret.is_owned = false;
5532 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
5533 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5534 LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
5535 uint64_t ret_ref = 0;
5536 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5537 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5541 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5542 LDKOutPoint ret = *owner->contents.result;
5543 ret.is_owned = false;
5546 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint64_t owner) {
5547 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5548 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
5549 uint64_t ret_ref = 0;
5550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5555 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5556 LDKDecodeError ret = *owner->contents.err;
5557 ret.is_owned = false;
5560 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
5561 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5562 LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
5563 uint64_t ret_ref = 0;
5564 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5565 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5569 typedef struct LDKType_JCalls {
5570 atomic_size_t refcnt;
5571 uint32_t instance_ptr;
5573 static void LDKType_JCalls_free(void* this_arg) {
5574 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5575 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5579 uint16_t type_id_LDKType_jcall(const void* this_arg) {
5580 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5581 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
5583 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
5584 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5585 jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
5586 LDKStr ret_conv = str_ref_to_owned_c(ret);
5589 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
5590 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5591 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, 0, 0, 0, 0, 0, 0);
5592 LDKCVec_u8Z ret_ref;
5593 ret_ref.datalen = ret->arr_len;
5594 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5595 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5598 static void LDKType_JCalls_cloned(LDKType* new_obj) {
5599 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
5600 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5602 static inline LDKType LDKType_init (JSValue o) {
5603 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
5604 atomic_init(&calls->refcnt, 1);
5605 calls->instance_ptr = o;
5608 .this_arg = (void*) calls,
5609 .type_id = type_id_LDKType_jcall,
5610 .debug_str = debug_str_LDKType_jcall,
5611 .write = write_LDKType_jcall,
5612 .cloned = LDKType_JCalls_cloned,
5613 .free = LDKType_JCalls_free,
5617 uint64_t __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) {
5618 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
5619 *res_ptr = LDKType_init(o);
5620 return tag_ptr(res_ptr, true);
5622 int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint64_t this_arg) {
5623 void* this_arg_ptr = untag_ptr(this_arg);
5624 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5625 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5626 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
5630 jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint64_t this_arg) {
5631 void* this_arg_ptr = untag_ptr(this_arg);
5632 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5633 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5634 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
5635 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5640 int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint64_t this_arg) {
5641 void* this_arg_ptr = untag_ptr(this_arg);
5642 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5643 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5644 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5645 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5646 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5647 CVec_u8Z_free(ret_var);
5651 uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_ty_from_ptr"))) TS_LDKCOption_TypeZ_ty_from_ptr(uint64_t ptr) {
5652 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5654 case LDKCOption_TypeZ_Some: return 0;
5655 case LDKCOption_TypeZ_None: return 1;
5659 uint64_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LDKCOption_TypeZ_Some_get_some(uint64_t ptr) {
5660 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5661 assert(obj->tag == LDKCOption_TypeZ_Some);
5662 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
5663 *some_ret = Type_clone(&obj->some);
5664 return tag_ptr(some_ret, true);
5666 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5667 CHECK(owner->result_ok);
5668 return COption_TypeZ_clone(&*owner->contents.result);
5670 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_get_ok(uint64_t owner) {
5671 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5672 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
5673 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
5674 uint64_t ret_ref = tag_ptr(ret_copy, true);
5678 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5679 LDKDecodeError ret = *owner->contents.err;
5680 ret.is_owned = false;
5683 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
5684 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5685 LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
5686 uint64_t ret_ref = 0;
5687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5692 uint32_t __attribute__((export_name("TS_LDKPaymentError_ty_from_ptr"))) TS_LDKPaymentError_ty_from_ptr(uint64_t ptr) {
5693 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5695 case LDKPaymentError_Invoice: return 0;
5696 case LDKPaymentError_Routing: return 1;
5697 case LDKPaymentError_Sending: return 2;
5701 jstring __attribute__((export_name("TS_LDKPaymentError_Invoice_get_invoice"))) TS_LDKPaymentError_Invoice_get_invoice(uint64_t ptr) {
5702 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5703 assert(obj->tag == LDKPaymentError_Invoice);
5704 LDKStr invoice_str = obj->invoice;
5705 jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
5706 return invoice_conv;
5708 uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
5709 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5710 assert(obj->tag == LDKPaymentError_Routing);
5711 LDKLightningError routing_var = obj->routing;
5712 uint64_t routing_ref = 0;
5713 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
5714 routing_ref = tag_ptr(routing_var.inner, false);
5717 uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
5718 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5719 assert(obj->tag == LDKPaymentError_Sending);
5720 uint64_t sending_ref = tag_ptr(&obj->sending, false);
5723 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5724 CHECK(owner->result_ok);
5725 return ThirtyTwoBytes_clone(&*owner->contents.result);
5727 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_ok"))) TS_CResult_PaymentIdPaymentErrorZ_get_ok(uint64_t owner) {
5728 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5729 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5730 memcpy(ret_arr->elems, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data, 32);
5734 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5735 CHECK(!owner->result_ok);
5736 return PaymentError_clone(&*owner->contents.err);
5738 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_err"))) TS_CResult_PaymentIdPaymentErrorZ_get_err(uint64_t owner) {
5739 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5740 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
5741 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
5742 uint64_t ret_ref = tag_ptr(ret_copy, true);
5746 static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
5747 LDKInFlightHtlcs ret = *owner->contents.result;
5748 ret.is_owned = false;
5751 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok(uint64_t owner) {
5752 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
5753 LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
5754 uint64_t ret_ref = 0;
5755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5760 static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
5761 LDKDecodeError ret = *owner->contents.err;
5762 ret.is_owned = false;
5765 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_err(uint64_t owner) {
5766 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
5767 LDKDecodeError ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
5768 uint64_t ret_ref = 0;
5769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5770 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5774 uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
5775 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5777 case LDKParseError_Bech32Error: return 0;
5778 case LDKParseError_ParseAmountError: return 1;
5779 case LDKParseError_MalformedSignature: return 2;
5780 case LDKParseError_BadPrefix: return 3;
5781 case LDKParseError_UnknownCurrency: return 4;
5782 case LDKParseError_UnknownSiPrefix: return 5;
5783 case LDKParseError_MalformedHRP: return 6;
5784 case LDKParseError_TooShortDataPart: return 7;
5785 case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
5786 case LDKParseError_DescriptionDecodeError: return 9;
5787 case LDKParseError_PaddingError: return 10;
5788 case LDKParseError_IntegerOverflowError: return 11;
5789 case LDKParseError_InvalidSegWitProgramLength: return 12;
5790 case LDKParseError_InvalidPubKeyHashLength: return 13;
5791 case LDKParseError_InvalidScriptHashLength: return 14;
5792 case LDKParseError_InvalidRecoveryId: return 15;
5793 case LDKParseError_InvalidSliceLength: return 16;
5794 case LDKParseError_Skip: return 17;
5798 uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
5799 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5800 assert(obj->tag == LDKParseError_Bech32Error);
5801 uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
5802 return bech32_error_ref;
5804 int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
5805 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5806 assert(obj->tag == LDKParseError_ParseAmountError);
5807 /*obj->parse_amount_error*/
5810 uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
5811 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5812 assert(obj->tag == LDKParseError_MalformedSignature);
5813 uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
5814 return malformed_signature_conv;
5816 int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
5817 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5818 assert(obj->tag == LDKParseError_DescriptionDecodeError);
5819 /*obj->description_decode_error*/
5822 jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
5823 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5824 assert(obj->tag == LDKParseError_InvalidSliceLength);
5825 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
5826 jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
5827 return invalid_slice_length_conv;
5829 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5830 CHECK(owner->result_ok);
5831 return SiPrefix_clone(&*owner->contents.result);
5833 uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
5834 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5835 uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
5839 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5840 CHECK(!owner->result_ok);
5841 return ParseError_clone(&*owner->contents.err);
5843 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
5844 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5845 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5846 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
5847 uint64_t ret_ref = tag_ptr(ret_copy, true);
5851 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
5852 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5854 case LDKParseOrSemanticError_ParseError: return 0;
5855 case LDKParseOrSemanticError_SemanticError: return 1;
5859 uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
5860 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5861 assert(obj->tag == LDKParseOrSemanticError_ParseError);
5862 uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
5863 return parse_error_ref;
5865 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
5866 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5867 assert(obj->tag == LDKParseOrSemanticError_SemanticError);
5868 uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
5869 return semantic_error_conv;
5871 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5872 LDKInvoice ret = *owner->contents.result;
5873 ret.is_owned = false;
5876 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
5877 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5878 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
5879 uint64_t ret_ref = 0;
5880 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5881 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5885 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5886 CHECK(!owner->result_ok);
5887 return ParseOrSemanticError_clone(&*owner->contents.err);
5889 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
5890 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5891 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
5892 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
5893 uint64_t ret_ref = tag_ptr(ret_copy, true);
5897 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5898 LDKSignedRawInvoice ret = *owner->contents.result;
5899 ret.is_owned = false;
5902 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
5903 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5904 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
5905 uint64_t ret_ref = 0;
5906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5911 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5912 CHECK(!owner->result_ok);
5913 return ParseError_clone(&*owner->contents.err);
5915 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
5916 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5917 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5918 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
5919 uint64_t ret_ref = tag_ptr(ret_copy, true);
5923 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5924 LDKRawInvoice ret = owner->a;
5925 ret.is_owned = false;
5928 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
5929 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5930 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
5931 uint64_t ret_ref = 0;
5932 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5933 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5937 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5938 return ThirtyTwoBytes_clone(&owner->b);
5940 int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
5941 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5942 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5943 memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
5947 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5948 LDKInvoiceSignature ret = owner->c;
5949 ret.is_owned = false;
5952 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
5953 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5954 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
5955 uint64_t ret_ref = 0;
5956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5961 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5962 LDKPayeePubKey ret = *owner->contents.result;
5963 ret.is_owned = false;
5966 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
5967 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5968 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
5969 uint64_t ret_ref = 0;
5970 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5971 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5975 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5976 CHECK(!owner->result_ok);
5977 return *owner->contents.err;
5979 uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
5980 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5981 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
5985 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
5986 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
5987 for (size_t i = 0; i < ret.datalen; i++) {
5988 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
5992 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5993 LDKPositiveTimestamp ret = *owner->contents.result;
5994 ret.is_owned = false;
5997 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
5998 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5999 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
6000 uint64_t ret_ref = 0;
6001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6006 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
6007 CHECK(!owner->result_ok);
6008 return CreationError_clone(&*owner->contents.err);
6010 uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
6011 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
6012 uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
6016 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
6017 CHECK(owner->result_ok);
6018 return *owner->contents.result;
6020 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
6021 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
6022 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
6025 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
6026 CHECK(!owner->result_ok);
6027 return SemanticError_clone(&*owner->contents.err);
6029 uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
6030 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
6031 uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
6035 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
6036 LDKInvoice ret = *owner->contents.result;
6037 ret.is_owned = false;
6040 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
6041 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
6042 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
6043 uint64_t ret_ref = 0;
6044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6049 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
6050 CHECK(!owner->result_ok);
6051 return SemanticError_clone(&*owner->contents.err);
6053 uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
6054 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
6055 uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
6059 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
6060 LDKDescription ret = *owner->contents.result;
6061 ret.is_owned = false;
6064 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
6065 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
6066 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
6067 uint64_t ret_ref = 0;
6068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6073 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
6074 CHECK(!owner->result_ok);
6075 return CreationError_clone(&*owner->contents.err);
6077 uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
6078 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
6079 uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
6083 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
6084 LDKPrivateRoute ret = *owner->contents.result;
6085 ret.is_owned = false;
6088 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
6089 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
6090 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
6091 uint64_t ret_ref = 0;
6092 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6093 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6097 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
6098 CHECK(!owner->result_ok);
6099 return CreationError_clone(&*owner->contents.err);
6101 uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
6102 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
6103 uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
6107 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
6108 CHECK(owner->result_ok);
6109 return *owner->contents.result;
6111 jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
6112 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
6113 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
6114 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
6118 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
6119 CHECK(!owner->result_ok);
6120 return *owner->contents.err;
6122 uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
6123 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
6124 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
6128 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
6129 LDKChannelMonitorUpdate ret = *owner->contents.result;
6130 ret.is_owned = false;
6133 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6134 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
6135 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
6136 uint64_t ret_ref = 0;
6137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6142 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
6143 LDKDecodeError ret = *owner->contents.err;
6144 ret.is_owned = false;
6147 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
6148 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
6149 LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
6150 uint64_t ret_ref = 0;
6151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6156 uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
6157 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
6159 case LDKCOption_MonitorEventZ_Some: return 0;
6160 case LDKCOption_MonitorEventZ_None: return 1;
6164 uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
6165 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
6166 assert(obj->tag == LDKCOption_MonitorEventZ_Some);
6167 uint64_t some_ref = tag_ptr(&obj->some, false);
6170 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
6171 CHECK(owner->result_ok);
6172 return COption_MonitorEventZ_clone(&*owner->contents.result);
6174 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
6175 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
6176 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
6177 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
6178 uint64_t ret_ref = tag_ptr(ret_copy, true);
6182 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
6183 LDKDecodeError ret = *owner->contents.err;
6184 ret.is_owned = false;
6187 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
6188 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
6189 LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
6190 uint64_t ret_ref = 0;
6191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6196 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6197 LDKHTLCUpdate ret = *owner->contents.result;
6198 ret.is_owned = false;
6201 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6202 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6203 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
6204 uint64_t ret_ref = 0;
6205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6210 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6211 LDKDecodeError ret = *owner->contents.err;
6212 ret.is_owned = false;
6215 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
6216 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6217 LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
6218 uint64_t ret_ref = 0;
6219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6224 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6225 LDKOutPoint ret = owner->a;
6226 ret.is_owned = false;
6229 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
6230 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6231 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
6232 uint64_t ret_ref = 0;
6233 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6234 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6238 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6239 return CVec_u8Z_clone(&owner->b);
6241 int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
6242 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6243 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
6244 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6245 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6246 CVec_u8Z_free(ret_var);
6250 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6253 int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
6254 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6255 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
6259 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6260 return CVec_u8Z_clone(&owner->b);
6262 int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
6263 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6264 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
6265 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6266 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6267 CVec_u8Z_free(ret_var);
6271 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
6272 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
6273 for (size_t i = 0; i < ret.datalen; i++) {
6274 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
6278 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6279 return ThirtyTwoBytes_clone(&owner->a);
6281 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint64_t owner) {
6282 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6283 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6284 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32);
6288 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6289 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
6291 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint64_t owner) {
6292 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6293 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
6294 uint64_tArray ret_arr = NULL;
6295 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6296 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6297 for (size_t v = 0; v < ret_var.datalen; v++) {
6298 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
6299 *ret_conv_21_conv = ret_var.data[v];
6300 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
6307 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
6308 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 };
6309 for (size_t i = 0; i < ret.datalen; i++) {
6310 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
6314 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
6315 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
6316 for (size_t i = 0; i < ret.datalen; i++) {
6317 ret.data[i] = Event_clone(&orig->data[i]);
6321 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6324 int32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_a"))) TS_C2Tuple_u32TxOutZ_get_a(uint64_t owner) {
6325 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6326 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
6330 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6331 return TxOut_clone(&owner->b);
6333 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_u32TxOutZ_get_b(uint64_t owner) {
6334 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6335 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
6336 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
6337 return tag_ptr(ret_ref, true);
6340 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
6341 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
6342 for (size_t i = 0; i < ret.datalen; i++) {
6343 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
6347 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6348 return ThirtyTwoBytes_clone(&owner->a);
6350 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint64_t owner) {
6351 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6352 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6353 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32);
6357 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6358 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
6360 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint64_t owner) {
6361 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6362 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
6363 uint64_tArray ret_arr = NULL;
6364 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6365 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6366 for (size_t u = 0; u < ret_var.datalen; u++) {
6367 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
6368 *ret_conv_20_conv = ret_var.data[u];
6369 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
6376 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
6377 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 };
6378 for (size_t i = 0; i < ret.datalen; i++) {
6379 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
6383 uint32_t __attribute__((export_name("TS_LDKBalance_ty_from_ptr"))) TS_LDKBalance_ty_from_ptr(uint64_t ptr) {
6384 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6386 case LDKBalance_ClaimableOnChannelClose: return 0;
6387 case LDKBalance_ClaimableAwaitingConfirmations: return 1;
6388 case LDKBalance_ContentiousClaimable: return 2;
6389 case LDKBalance_MaybeTimeoutClaimableHTLC: return 3;
6390 case LDKBalance_MaybePreimageClaimableHTLC: return 4;
6391 case LDKBalance_CounterpartyRevokedOutputClaimable: return 5;
6395 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(uint64_t ptr) {
6396 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6397 assert(obj->tag == LDKBalance_ClaimableOnChannelClose);
6398 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
6399 return claimable_amount_satoshis_conv;
6401 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(uint64_t ptr) {
6402 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6403 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6404 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
6405 return claimable_amount_satoshis_conv;
6407 int32_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(uint64_t ptr) {
6408 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6409 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6410 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
6411 return confirmation_height_conv;
6413 int64_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6414 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6415 assert(obj->tag == LDKBalance_ContentiousClaimable);
6416 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
6417 return claimable_amount_satoshis_conv;
6419 int32_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_timeout_height"))) TS_LDKBalance_ContentiousClaimable_get_timeout_height(uint64_t ptr) {
6420 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6421 assert(obj->tag == LDKBalance_ContentiousClaimable);
6422 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
6423 return timeout_height_conv;
6425 int64_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
6426 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6427 assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
6428 int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
6429 return claimable_amount_satoshis_conv;
6431 int32_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(uint64_t ptr) {
6432 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6433 assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
6434 int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
6435 return claimable_height_conv;
6437 int64_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
6438 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6439 assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
6440 int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
6441 return claimable_amount_satoshis_conv;
6443 int32_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(uint64_t ptr) {
6444 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6445 assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
6446 int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
6447 return expiry_height_conv;
6449 int64_t __attribute__((export_name("TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6450 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6451 assert(obj->tag == LDKBalance_CounterpartyRevokedOutputClaimable);
6452 int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
6453 return claimable_amount_satoshis_conv;
6455 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
6456 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
6457 for (size_t i = 0; i < ret.datalen; i++) {
6458 ret.data[i] = Balance_clone(&orig->data[i]);
6462 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6463 return ThirtyTwoBytes_clone(&owner->a);
6465 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint64_t owner) {
6466 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6467 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6468 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32);
6472 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6473 LDKChannelMonitor ret = owner->b;
6474 ret.is_owned = false;
6477 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint64_t owner) {
6478 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6479 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6480 uint64_t ret_ref = 0;
6481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6482 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6486 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6487 CHECK(owner->result_ok);
6488 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
6490 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint64_t owner) {
6491 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6492 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6493 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
6494 return tag_ptr(ret_conv, true);
6497 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6498 LDKDecodeError ret = *owner->contents.err;
6499 ret.is_owned = false;
6502 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
6503 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6504 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
6505 uint64_t ret_ref = 0;
6506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6511 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6514 int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint64_t owner) {
6515 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6516 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
6517 memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33);
6521 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6522 return Type_clone(&owner->b);
6524 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint64_t owner) {
6525 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6526 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
6527 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
6528 return tag_ptr(ret_ret, true);
6531 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
6532 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
6533 for (size_t i = 0; i < ret.datalen; i++) {
6534 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
6538 uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
6539 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6541 case LDKCOption_NetAddressZ_Some: return 0;
6542 case LDKCOption_NetAddressZ_None: return 1;
6546 uint64_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_Some_get_some"))) TS_LDKCOption_NetAddressZ_Some_get_some(uint64_t ptr) {
6547 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6548 assert(obj->tag == LDKCOption_NetAddressZ_Some);
6549 uint64_t some_ref = tag_ptr(&obj->some, false);
6552 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6553 CHECK(owner->result_ok);
6554 return CVec_u8Z_clone(&*owner->contents.result);
6556 int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint64_t owner) {
6557 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6558 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
6559 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6560 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6561 CVec_u8Z_free(ret_var);
6565 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6566 LDKPeerHandleError ret = *owner->contents.err;
6567 ret.is_owned = false;
6570 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint64_t owner) {
6571 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6572 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
6573 uint64_t ret_ref = 0;
6574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6579 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6580 CHECK(owner->result_ok);
6581 return *owner->contents.result;
6583 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_ok"))) TS_CResult_NonePeerHandleErrorZ_get_ok(uint64_t owner) {
6584 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6585 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
6588 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6589 LDKPeerHandleError ret = *owner->contents.err;
6590 ret.is_owned = false;
6593 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint64_t owner) {
6594 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6595 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
6596 uint64_t ret_ref = 0;
6597 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6598 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6602 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6603 CHECK(owner->result_ok);
6604 return *owner->contents.result;
6606 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_ok"))) TS_CResult_boolPeerHandleErrorZ_get_ok(uint64_t owner) {
6607 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6608 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
6612 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6613 LDKPeerHandleError ret = *owner->contents.err;
6614 ret.is_owned = false;
6617 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint64_t owner) {
6618 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6619 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
6620 uint64_t ret_ref = 0;
6621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6626 uint32_t __attribute__((export_name("TS_LDKSendError_ty_from_ptr"))) TS_LDKSendError_ty_from_ptr(uint64_t ptr) {
6627 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
6629 case LDKSendError_Secp256k1: return 0;
6630 case LDKSendError_TooBigPacket: return 1;
6631 case LDKSendError_TooFewBlindedHops: return 2;
6632 case LDKSendError_InvalidFirstHop: return 3;
6633 case LDKSendError_BufferFull: return 4;
6637 uint32_t __attribute__((export_name("TS_LDKSendError_Secp256k1_get_secp256k1"))) TS_LDKSendError_Secp256k1_get_secp256k1(uint64_t ptr) {
6638 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
6639 assert(obj->tag == LDKSendError_Secp256k1);
6640 uint32_t secp256k1_conv = LDKSecp256k1Error_to_js(obj->secp256k1);
6641 return secp256k1_conv;
6643 static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
6644 CHECK(owner->result_ok);
6645 return *owner->contents.result;
6647 void __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_ok"))) TS_CResult_NoneSendErrorZ_get_ok(uint64_t owner) {
6648 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
6649 CResult_NoneSendErrorZ_get_ok(owner_conv);
6652 static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
6653 CHECK(!owner->result_ok);
6654 return SendError_clone(&*owner->contents.err);
6656 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_err"))) TS_CResult_NoneSendErrorZ_get_err(uint64_t owner) {
6657 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
6658 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
6659 *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
6660 uint64_t ret_ref = tag_ptr(ret_copy, true);
6664 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6665 CHECK(owner->result_ok);
6666 return *owner->contents.result;
6668 void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
6669 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6670 CResult_NoneErrorZ_get_ok(owner_conv);
6673 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6674 CHECK(!owner->result_ok);
6675 return *owner->contents.err;
6677 uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
6678 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6679 uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
6683 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6684 CHECK(owner->result_ok);
6685 return NetAddress_clone(&*owner->contents.result);
6687 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
6688 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6689 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
6690 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
6691 uint64_t ret_ref = tag_ptr(ret_copy, true);
6695 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6696 LDKDecodeError ret = *owner->contents.err;
6697 ret.is_owned = false;
6700 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
6701 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6702 LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
6703 uint64_t ret_ref = 0;
6704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6709 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
6710 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
6711 for (size_t i = 0; i < ret.datalen; i++) {
6712 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
6716 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
6717 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
6718 for (size_t i = 0; i < ret.datalen; i++) {
6719 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
6723 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
6724 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
6725 for (size_t i = 0; i < ret.datalen; i++) {
6726 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
6730 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
6731 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
6732 for (size_t i = 0; i < ret.datalen; i++) {
6733 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
6737 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6738 LDKAcceptChannel ret = *owner->contents.result;
6739 ret.is_owned = false;
6742 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
6743 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6744 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
6745 uint64_t ret_ref = 0;
6746 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6747 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6751 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6752 LDKDecodeError ret = *owner->contents.err;
6753 ret.is_owned = false;
6756 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
6757 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6758 LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
6759 uint64_t ret_ref = 0;
6760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6765 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6766 LDKAnnouncementSignatures ret = *owner->contents.result;
6767 ret.is_owned = false;
6770 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
6771 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6772 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
6773 uint64_t ret_ref = 0;
6774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6779 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6780 LDKDecodeError ret = *owner->contents.err;
6781 ret.is_owned = false;
6784 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
6785 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6786 LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
6787 uint64_t ret_ref = 0;
6788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6793 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6794 LDKChannelReestablish ret = *owner->contents.result;
6795 ret.is_owned = false;
6798 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint64_t owner) {
6799 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6800 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
6801 uint64_t ret_ref = 0;
6802 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6803 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6807 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6808 LDKDecodeError ret = *owner->contents.err;
6809 ret.is_owned = false;
6812 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
6813 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6814 LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
6815 uint64_t ret_ref = 0;
6816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6821 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6822 LDKClosingSigned ret = *owner->contents.result;
6823 ret.is_owned = false;
6826 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6827 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6828 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
6829 uint64_t ret_ref = 0;
6830 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6831 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6835 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6836 LDKDecodeError ret = *owner->contents.err;
6837 ret.is_owned = false;
6840 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
6841 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6842 LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
6843 uint64_t ret_ref = 0;
6844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6849 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6850 LDKClosingSignedFeeRange ret = *owner->contents.result;
6851 ret.is_owned = false;
6854 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint64_t owner) {
6855 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6856 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
6857 uint64_t ret_ref = 0;
6858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6863 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6864 LDKDecodeError ret = *owner->contents.err;
6865 ret.is_owned = false;
6868 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
6869 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6870 LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(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 LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6878 LDKCommitmentSigned ret = *owner->contents.result;
6879 ret.is_owned = false;
6882 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint64_t owner) {
6883 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6884 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
6885 uint64_t ret_ref = 0;
6886 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6887 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6891 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6892 LDKDecodeError ret = *owner->contents.err;
6893 ret.is_owned = false;
6896 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
6897 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6898 LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
6899 uint64_t ret_ref = 0;
6900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6905 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6906 LDKFundingCreated ret = *owner->contents.result;
6907 ret.is_owned = false;
6910 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint64_t owner) {
6911 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6912 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
6913 uint64_t ret_ref = 0;
6914 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6915 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6919 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6920 LDKDecodeError ret = *owner->contents.err;
6921 ret.is_owned = false;
6924 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
6925 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6926 LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
6927 uint64_t ret_ref = 0;
6928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6933 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6934 LDKFundingSigned ret = *owner->contents.result;
6935 ret.is_owned = false;
6938 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6939 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6940 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
6941 uint64_t ret_ref = 0;
6942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6947 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6948 LDKDecodeError ret = *owner->contents.err;
6949 ret.is_owned = false;
6952 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
6953 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6954 LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
6955 uint64_t ret_ref = 0;
6956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6961 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6962 LDKChannelReady ret = *owner->contents.result;
6963 ret.is_owned = false;
6966 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_get_ok(uint64_t owner) {
6967 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6968 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
6969 uint64_t ret_ref = 0;
6970 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6971 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6975 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6976 LDKDecodeError ret = *owner->contents.err;
6977 ret.is_owned = false;
6980 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
6981 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6982 LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
6983 uint64_t ret_ref = 0;
6984 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6985 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6989 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6990 LDKInit ret = *owner->contents.result;
6991 ret.is_owned = false;
6994 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint64_t owner) {
6995 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6996 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
6997 uint64_t ret_ref = 0;
6998 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6999 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7003 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
7004 LDKDecodeError ret = *owner->contents.err;
7005 ret.is_owned = false;
7008 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
7009 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
7010 LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
7011 uint64_t ret_ref = 0;
7012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7017 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
7018 LDKOpenChannel ret = *owner->contents.result;
7019 ret.is_owned = false;
7022 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint64_t owner) {
7023 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
7024 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
7025 uint64_t ret_ref = 0;
7026 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7027 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7031 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
7032 LDKDecodeError ret = *owner->contents.err;
7033 ret.is_owned = false;
7036 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
7037 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
7038 LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
7039 uint64_t ret_ref = 0;
7040 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7041 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7045 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
7046 LDKRevokeAndACK ret = *owner->contents.result;
7047 ret.is_owned = false;
7050 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint64_t owner) {
7051 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
7052 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_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_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
7060 LDKDecodeError ret = *owner->contents.err;
7061 ret.is_owned = false;
7064 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
7065 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
7066 LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
7067 uint64_t ret_ref = 0;
7068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7073 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
7074 LDKShutdown ret = *owner->contents.result;
7075 ret.is_owned = false;
7078 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint64_t owner) {
7079 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
7080 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
7081 uint64_t ret_ref = 0;
7082 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7083 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7087 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
7088 LDKDecodeError ret = *owner->contents.err;
7089 ret.is_owned = false;
7092 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
7093 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
7094 LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
7095 uint64_t ret_ref = 0;
7096 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7097 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7101 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
7102 LDKUpdateFailHTLC ret = *owner->contents.result;
7103 ret.is_owned = false;
7106 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7107 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
7108 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
7109 uint64_t ret_ref = 0;
7110 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7111 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7115 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
7116 LDKDecodeError ret = *owner->contents.err;
7117 ret.is_owned = false;
7120 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
7121 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
7122 LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
7123 uint64_t ret_ref = 0;
7124 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7125 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7129 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
7130 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
7131 ret.is_owned = false;
7134 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7135 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
7136 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
7137 uint64_t ret_ref = 0;
7138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7143 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
7144 LDKDecodeError ret = *owner->contents.err;
7145 ret.is_owned = false;
7148 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
7149 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
7150 LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
7151 uint64_t ret_ref = 0;
7152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7153 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7157 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
7158 LDKUpdateFee ret = *owner->contents.result;
7159 ret.is_owned = false;
7162 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint64_t owner) {
7163 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
7164 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
7165 uint64_t ret_ref = 0;
7166 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7167 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7171 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
7172 LDKDecodeError ret = *owner->contents.err;
7173 ret.is_owned = false;
7176 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
7177 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
7178 LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
7179 uint64_t ret_ref = 0;
7180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7185 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
7186 LDKUpdateFulfillHTLC ret = *owner->contents.result;
7187 ret.is_owned = false;
7190 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7191 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
7192 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
7193 uint64_t ret_ref = 0;
7194 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7195 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7199 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
7200 LDKDecodeError ret = *owner->contents.err;
7201 ret.is_owned = false;
7204 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
7205 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
7206 LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
7207 uint64_t ret_ref = 0;
7208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7213 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
7214 LDKUpdateAddHTLC ret = *owner->contents.result;
7215 ret.is_owned = false;
7218 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint64_t owner) {
7219 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
7220 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
7221 uint64_t ret_ref = 0;
7222 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7223 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7227 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
7228 LDKDecodeError ret = *owner->contents.err;
7229 ret.is_owned = false;
7232 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
7233 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
7234 LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(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 LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
7242 LDKOnionMessage ret = *owner->contents.result;
7243 ret.is_owned = false;
7246 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_ok"))) TS_CResult_OnionMessageDecodeErrorZ_get_ok(uint64_t owner) {
7247 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
7248 LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
7249 uint64_t ret_ref = 0;
7250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7255 static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
7256 LDKDecodeError ret = *owner->contents.err;
7257 ret.is_owned = false;
7260 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_err"))) TS_CResult_OnionMessageDecodeErrorZ_get_err(uint64_t owner) {
7261 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
7262 LDKDecodeError ret_var = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
7263 uint64_t ret_ref = 0;
7264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7269 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7270 LDKPing ret = *owner->contents.result;
7271 ret.is_owned = false;
7274 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint64_t owner) {
7275 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7276 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
7277 uint64_t ret_ref = 0;
7278 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7279 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7283 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7284 LDKDecodeError ret = *owner->contents.err;
7285 ret.is_owned = false;
7288 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
7289 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7290 LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
7291 uint64_t ret_ref = 0;
7292 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7293 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7297 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7298 LDKPong ret = *owner->contents.result;
7299 ret.is_owned = false;
7302 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint64_t owner) {
7303 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7304 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
7305 uint64_t ret_ref = 0;
7306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7311 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7312 LDKDecodeError ret = *owner->contents.err;
7313 ret.is_owned = false;
7316 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
7317 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7318 LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
7319 uint64_t ret_ref = 0;
7320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7325 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7326 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
7327 ret.is_owned = false;
7330 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7331 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7332 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7333 uint64_t ret_ref = 0;
7334 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7335 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7339 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7340 LDKDecodeError ret = *owner->contents.err;
7341 ret.is_owned = false;
7344 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7345 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7346 LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7347 uint64_t ret_ref = 0;
7348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7353 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7354 LDKChannelAnnouncement ret = *owner->contents.result;
7355 ret.is_owned = false;
7358 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7359 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7360 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7361 uint64_t ret_ref = 0;
7362 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7363 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7367 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7368 LDKDecodeError ret = *owner->contents.err;
7369 ret.is_owned = false;
7372 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7373 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7374 LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7375 uint64_t ret_ref = 0;
7376 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7377 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7381 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7382 LDKUnsignedChannelUpdate ret = *owner->contents.result;
7383 ret.is_owned = false;
7386 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7387 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7388 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7389 uint64_t ret_ref = 0;
7390 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7391 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7395 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7396 LDKDecodeError ret = *owner->contents.err;
7397 ret.is_owned = false;
7400 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7401 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7402 LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
7403 uint64_t ret_ref = 0;
7404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7409 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7410 LDKChannelUpdate ret = *owner->contents.result;
7411 ret.is_owned = false;
7414 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7415 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7416 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_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_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7424 LDKDecodeError ret = *owner->contents.err;
7425 ret.is_owned = false;
7428 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7429 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7430 LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
7431 uint64_t ret_ref = 0;
7432 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7433 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7437 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7438 LDKErrorMessage ret = *owner->contents.result;
7439 ret.is_owned = false;
7442 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint64_t owner) {
7443 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7444 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
7445 uint64_t ret_ref = 0;
7446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7451 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7452 LDKDecodeError ret = *owner->contents.err;
7453 ret.is_owned = false;
7456 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
7457 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7458 LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
7459 uint64_t ret_ref = 0;
7460 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7461 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7465 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7466 LDKWarningMessage ret = *owner->contents.result;
7467 ret.is_owned = false;
7470 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ok"))) TS_CResult_WarningMessageDecodeErrorZ_get_ok(uint64_t owner) {
7471 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7472 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
7473 uint64_t ret_ref = 0;
7474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7479 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7480 LDKDecodeError ret = *owner->contents.err;
7481 ret.is_owned = false;
7484 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
7485 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7486 LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
7487 uint64_t ret_ref = 0;
7488 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7489 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7493 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7494 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
7495 ret.is_owned = false;
7498 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7499 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7500 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7501 uint64_t ret_ref = 0;
7502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7507 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7508 LDKDecodeError ret = *owner->contents.err;
7509 ret.is_owned = false;
7512 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7513 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7514 LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7515 uint64_t ret_ref = 0;
7516 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7517 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7521 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7522 LDKNodeAnnouncement ret = *owner->contents.result;
7523 ret.is_owned = false;
7526 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7527 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7528 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7529 uint64_t ret_ref = 0;
7530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7535 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7536 LDKDecodeError ret = *owner->contents.err;
7537 ret.is_owned = false;
7540 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7541 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7542 LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7543 uint64_t ret_ref = 0;
7544 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7545 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7549 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7550 LDKQueryShortChannelIds ret = *owner->contents.result;
7551 ret.is_owned = false;
7554 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint64_t owner) {
7555 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7556 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
7557 uint64_t ret_ref = 0;
7558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7563 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7564 LDKDecodeError ret = *owner->contents.err;
7565 ret.is_owned = false;
7568 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
7569 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7570 LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
7571 uint64_t ret_ref = 0;
7572 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7573 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7577 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7578 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
7579 ret.is_owned = false;
7582 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint64_t owner) {
7583 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7584 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
7585 uint64_t ret_ref = 0;
7586 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7587 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7591 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7592 LDKDecodeError ret = *owner->contents.err;
7593 ret.is_owned = false;
7596 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
7597 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7598 LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(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 LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7606 LDKQueryChannelRange ret = *owner->contents.result;
7607 ret.is_owned = false;
7610 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7611 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7612 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
7613 uint64_t ret_ref = 0;
7614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7619 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7620 LDKDecodeError ret = *owner->contents.err;
7621 ret.is_owned = false;
7624 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7625 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7626 LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
7627 uint64_t ret_ref = 0;
7628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7633 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7634 LDKReplyChannelRange ret = *owner->contents.result;
7635 ret.is_owned = false;
7638 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7639 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7640 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
7641 uint64_t ret_ref = 0;
7642 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7643 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7647 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7648 LDKDecodeError ret = *owner->contents.err;
7649 ret.is_owned = false;
7652 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7653 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7654 LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
7655 uint64_t ret_ref = 0;
7656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7661 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7662 LDKGossipTimestampFilter ret = *owner->contents.result;
7663 ret.is_owned = false;
7666 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint64_t owner) {
7667 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7668 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
7669 uint64_t ret_ref = 0;
7670 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7671 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7675 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7676 LDKDecodeError ret = *owner->contents.err;
7677 ret.is_owned = false;
7680 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
7681 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7682 LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
7683 uint64_t ret_ref = 0;
7684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7689 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
7690 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7692 case LDKSignOrCreationError_SignError: return 0;
7693 case LDKSignOrCreationError_CreationError: return 1;
7697 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) {
7698 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7699 assert(obj->tag == LDKSignOrCreationError_CreationError);
7700 uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error);
7701 return creation_error_conv;
7703 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7704 LDKInvoice ret = *owner->contents.result;
7705 ret.is_owned = false;
7708 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) {
7709 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7710 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
7711 uint64_t ret_ref = 0;
7712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7717 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7718 CHECK(!owner->result_ok);
7719 return SignOrCreationError_clone(&*owner->contents.err);
7721 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) {
7722 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7723 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
7724 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
7725 uint64_t ret_ref = tag_ptr(ret_copy, true);
7729 typedef struct LDKFilter_JCalls {
7730 atomic_size_t refcnt;
7731 uint32_t instance_ptr;
7733 static void LDKFilter_JCalls_free(void* this_arg) {
7734 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7735 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7739 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
7740 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7741 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
7742 memcpy(txid_arr->elems, *txid, 32);
7743 LDKu8slice script_pubkey_var = script_pubkey;
7744 int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
7745 memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
7746 js_invoke_function_uuuuuu(j_calls->instance_ptr, 33, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
7748 void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
7749 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7750 LDKWatchedOutput output_var = output;
7751 uint64_t output_ref = 0;
7752 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
7753 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
7754 js_invoke_function_buuuuu(j_calls->instance_ptr, 34, output_ref, 0, 0, 0, 0, 0);
7756 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
7757 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
7758 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7760 static inline LDKFilter LDKFilter_init (JSValue o) {
7761 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
7762 atomic_init(&calls->refcnt, 1);
7763 calls->instance_ptr = o;
7766 .this_arg = (void*) calls,
7767 .register_tx = register_tx_LDKFilter_jcall,
7768 .register_output = register_output_LDKFilter_jcall,
7769 .free = LDKFilter_JCalls_free,
7773 uint64_t __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue o) {
7774 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
7775 *res_ptr = LDKFilter_init(o);
7776 return tag_ptr(res_ptr, true);
7778 void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
7779 void* this_arg_ptr = untag_ptr(this_arg);
7780 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7781 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7782 unsigned char txid_arr[32];
7783 CHECK(txid->arr_len == 32);
7784 memcpy(txid_arr, txid->elems, 32); FREE(txid);
7785 unsigned char (*txid_ref)[32] = &txid_arr;
7786 LDKu8slice script_pubkey_ref;
7787 script_pubkey_ref.datalen = script_pubkey->arr_len;
7788 script_pubkey_ref.data = script_pubkey->elems;
7789 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
7790 FREE(script_pubkey);
7793 void __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
7794 void* this_arg_ptr = untag_ptr(this_arg);
7795 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7796 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7797 LDKWatchedOutput output_conv;
7798 output_conv.inner = untag_ptr(output);
7799 output_conv.is_owned = ptr_is_owned(output);
7800 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
7801 output_conv = WatchedOutput_clone(&output_conv);
7802 (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
7805 uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
7806 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7808 case LDKCOption_FilterZ_Some: return 0;
7809 case LDKCOption_FilterZ_None: return 1;
7813 uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_LDKCOption_FilterZ_Some_get_some(uint64_t ptr) {
7814 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7815 assert(obj->tag == LDKCOption_FilterZ_Some);
7816 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
7817 *some_ret = obj->some;
7818 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
7819 if ((*some_ret).free == LDKFilter_JCalls_free) {
7820 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7821 LDKFilter_JCalls_cloned(&(*some_ret));
7823 return tag_ptr(some_ret, true);
7825 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7826 LDKLockedChannelMonitor ret = *owner->contents.result;
7827 ret.is_owned = false;
7830 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) {
7831 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7832 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
7833 uint64_t ret_ref = 0;
7834 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7835 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7839 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7840 CHECK(!owner->result_ok);
7841 return *owner->contents.err;
7843 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) {
7844 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7845 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
7848 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
7849 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
7850 for (size_t i = 0; i < ret.datalen; i++) {
7851 ret.data[i] = OutPoint_clone(&orig->data[i]);
7855 typedef struct LDKMessageSendEventsProvider_JCalls {
7856 atomic_size_t refcnt;
7857 uint32_t instance_ptr;
7858 } LDKMessageSendEventsProvider_JCalls;
7859 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
7860 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7861 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7865 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
7866 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7867 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 35, 0, 0, 0, 0, 0, 0);
7868 LDKCVec_MessageSendEventZ ret_constr;
7869 ret_constr.datalen = ret->arr_len;
7870 if (ret_constr.datalen > 0)
7871 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
7873 ret_constr.data = NULL;
7874 uint64_t* ret_vals = ret->elems;
7875 for (size_t s = 0; s < ret_constr.datalen; s++) {
7876 uint64_t ret_conv_18 = ret_vals[s];
7877 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
7878 CHECK_ACCESS(ret_conv_18_ptr);
7879 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
7880 FREE(untag_ptr(ret_conv_18));
7881 ret_constr.data[s] = ret_conv_18_conv;
7886 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
7887 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
7888 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7890 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) {
7891 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
7892 atomic_init(&calls->refcnt, 1);
7893 calls->instance_ptr = o;
7895 LDKMessageSendEventsProvider ret = {
7896 .this_arg = (void*) calls,
7897 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
7898 .free = LDKMessageSendEventsProvider_JCalls_free,
7902 uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) {
7903 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
7904 *res_ptr = LDKMessageSendEventsProvider_init(o);
7905 return tag_ptr(res_ptr, true);
7907 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) {
7908 void* this_arg_ptr = untag_ptr(this_arg);
7909 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7910 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
7911 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
7912 uint64_tArray ret_arr = NULL;
7913 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
7914 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
7915 for (size_t s = 0; s < ret_var.datalen; s++) {
7916 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
7917 *ret_conv_18_copy = ret_var.data[s];
7918 uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
7919 ret_arr_ptr[s] = ret_conv_18_ref;
7926 typedef struct LDKOnionMessageProvider_JCalls {
7927 atomic_size_t refcnt;
7928 uint32_t instance_ptr;
7929 } LDKOnionMessageProvider_JCalls;
7930 static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
7931 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
7932 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7936 LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
7937 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
7938 int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
7939 memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
7940 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 36, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0);
7941 LDKOnionMessage ret_conv;
7942 ret_conv.inner = untag_ptr(ret);
7943 ret_conv.is_owned = ptr_is_owned(ret);
7944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
7947 static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
7948 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
7949 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7951 static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JSValue o) {
7952 LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
7953 atomic_init(&calls->refcnt, 1);
7954 calls->instance_ptr = o;
7956 LDKOnionMessageProvider ret = {
7957 .this_arg = (void*) calls,
7958 .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
7959 .free = LDKOnionMessageProvider_JCalls_free,
7963 uint64_t __attribute__((export_name("TS_LDKOnionMessageProvider_new"))) TS_LDKOnionMessageProvider_new(JSValue o) {
7964 LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
7965 *res_ptr = LDKOnionMessageProvider_init(o);
7966 return tag_ptr(res_ptr, true);
7968 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) {
7969 void* this_arg_ptr = untag_ptr(this_arg);
7970 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7971 LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
7972 LDKPublicKey peer_node_id_ref;
7973 CHECK(peer_node_id->arr_len == 33);
7974 memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
7975 LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
7976 uint64_t ret_ref = 0;
7977 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7978 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7982 typedef struct LDKEventHandler_JCalls {
7983 atomic_size_t refcnt;
7984 uint32_t instance_ptr;
7985 } LDKEventHandler_JCalls;
7986 static void LDKEventHandler_JCalls_free(void* this_arg) {
7987 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7988 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7992 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
7993 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7994 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
7995 *ret_event = Event_clone(event);
7996 uint64_t ref_event = tag_ptr(ret_event, true);
7997 js_invoke_function_buuuuu(j_calls->instance_ptr, 37, ref_event, 0, 0, 0, 0, 0);
7999 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
8000 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
8001 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8003 static inline LDKEventHandler LDKEventHandler_init (JSValue o) {
8004 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
8005 atomic_init(&calls->refcnt, 1);
8006 calls->instance_ptr = o;
8008 LDKEventHandler ret = {
8009 .this_arg = (void*) calls,
8010 .handle_event = handle_event_LDKEventHandler_jcall,
8011 .free = LDKEventHandler_JCalls_free,
8015 uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) {
8016 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
8017 *res_ptr = LDKEventHandler_init(o);
8018 return tag_ptr(res_ptr, true);
8020 void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) {
8021 void* this_arg_ptr = untag_ptr(this_arg);
8022 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8023 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
8024 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
8025 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
8028 typedef struct LDKEventsProvider_JCalls {
8029 atomic_size_t refcnt;
8030 uint32_t instance_ptr;
8031 } LDKEventsProvider_JCalls;
8032 static void LDKEventsProvider_JCalls_free(void* this_arg) {
8033 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
8034 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8038 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
8039 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
8040 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
8041 *handler_ret = handler;
8042 js_invoke_function_buuuuu(j_calls->instance_ptr, 38, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
8044 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
8045 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
8046 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8048 static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) {
8049 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
8050 atomic_init(&calls->refcnt, 1);
8051 calls->instance_ptr = o;
8053 LDKEventsProvider ret = {
8054 .this_arg = (void*) calls,
8055 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
8056 .free = LDKEventsProvider_JCalls_free,
8060 uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) {
8061 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
8062 *res_ptr = LDKEventsProvider_init(o);
8063 return tag_ptr(res_ptr, true);
8065 void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) {
8066 void* this_arg_ptr = untag_ptr(this_arg);
8067 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8068 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
8069 void* handler_ptr = untag_ptr(handler);
8070 CHECK_ACCESS(handler_ptr);
8071 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
8072 if (handler_conv.free == LDKEventHandler_JCalls_free) {
8073 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8074 LDKEventHandler_JCalls_cloned(&handler_conv);
8076 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
8079 typedef struct LDKScore_JCalls {
8080 atomic_size_t refcnt;
8081 uint32_t instance_ptr;
8083 static void LDKScore_JCalls_free(void* this_arg) {
8084 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8085 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8089 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
8090 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8091 int64_t short_channel_id_conv = short_channel_id;
8092 LDKNodeId source_var = *source;
8093 uint64_t source_ref = 0;
8094 source_var = NodeId_clone(&source_var);
8095 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
8096 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
8097 LDKNodeId target_var = *target;
8098 uint64_t target_ref = 0;
8099 target_var = NodeId_clone(&target_var);
8100 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
8101 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
8102 LDKChannelUsage usage_var = usage;
8103 uint64_t usage_ref = 0;
8104 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
8105 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
8106 return js_invoke_function_bbbbuu(j_calls->instance_ptr, 39, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
8108 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
8109 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8110 LDKCVec_RouteHopZ path_var = path;
8111 uint64_tArray path_arr = NULL;
8112 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8113 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8114 for (size_t k = 0; k < path_var.datalen; k++) {
8115 LDKRouteHop path_conv_10_var = path_var.data[k];
8116 uint64_t path_conv_10_ref = 0;
8117 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8118 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8119 path_arr_ptr[k] = path_conv_10_ref;
8122 FREE(path_var.data);
8123 int64_t short_channel_id_conv = short_channel_id;
8124 js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
8126 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
8127 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8128 LDKCVec_RouteHopZ path_var = path;
8129 uint64_tArray path_arr = NULL;
8130 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8131 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8132 for (size_t k = 0; k < path_var.datalen; k++) {
8133 LDKRouteHop path_conv_10_var = path_var.data[k];
8134 uint64_t path_conv_10_ref = 0;
8135 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8136 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8137 path_arr_ptr[k] = path_conv_10_ref;
8140 FREE(path_var.data);
8141 js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0);
8143 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
8144 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8145 LDKCVec_RouteHopZ path_var = path;
8146 uint64_tArray path_arr = NULL;
8147 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8148 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8149 for (size_t k = 0; k < path_var.datalen; k++) {
8150 LDKRouteHop path_conv_10_var = path_var.data[k];
8151 uint64_t path_conv_10_ref = 0;
8152 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8153 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8154 path_arr_ptr[k] = path_conv_10_ref;
8157 FREE(path_var.data);
8158 int64_t short_channel_id_conv = short_channel_id;
8159 js_invoke_function_ubuuuu(j_calls->instance_ptr, 42, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
8161 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
8162 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8163 LDKCVec_RouteHopZ path_var = path;
8164 uint64_tArray path_arr = NULL;
8165 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
8166 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
8167 for (size_t k = 0; k < path_var.datalen; k++) {
8168 LDKRouteHop path_conv_10_var = path_var.data[k];
8169 uint64_t path_conv_10_ref = 0;
8170 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
8171 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
8172 path_arr_ptr[k] = path_conv_10_ref;
8175 FREE(path_var.data);
8176 js_invoke_function_uuuuuu(j_calls->instance_ptr, 43, (uint32_t)path_arr, 0, 0, 0, 0, 0);
8178 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
8179 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
8180 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 44, 0, 0, 0, 0, 0, 0);
8181 LDKCVec_u8Z ret_ref;
8182 ret_ref.datalen = ret->arr_len;
8183 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8184 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
8187 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
8188 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
8189 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8191 static inline LDKScore LDKScore_init (JSValue o) {
8192 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
8193 atomic_init(&calls->refcnt, 1);
8194 calls->instance_ptr = o;
8197 .this_arg = (void*) calls,
8198 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
8199 .payment_path_failed = payment_path_failed_LDKScore_jcall,
8200 .payment_path_successful = payment_path_successful_LDKScore_jcall,
8201 .probe_failed = probe_failed_LDKScore_jcall,
8202 .probe_successful = probe_successful_LDKScore_jcall,
8203 .write = write_LDKScore_jcall,
8204 .free = LDKScore_JCalls_free,
8208 uint64_t __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) {
8209 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
8210 *res_ptr = LDKScore_init(o);
8211 return tag_ptr(res_ptr, true);
8213 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) {
8214 void* this_arg_ptr = untag_ptr(this_arg);
8215 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8216 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8217 LDKNodeId source_conv;
8218 source_conv.inner = untag_ptr(source);
8219 source_conv.is_owned = ptr_is_owned(source);
8220 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
8221 source_conv.is_owned = false;
8222 LDKNodeId target_conv;
8223 target_conv.inner = untag_ptr(target);
8224 target_conv.is_owned = ptr_is_owned(target);
8225 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
8226 target_conv.is_owned = false;
8227 LDKChannelUsage usage_conv;
8228 usage_conv.inner = untag_ptr(usage);
8229 usage_conv.is_owned = ptr_is_owned(usage);
8230 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
8231 usage_conv = ChannelUsage_clone(&usage_conv);
8232 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
8236 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) {
8237 void* this_arg_ptr = untag_ptr(this_arg);
8238 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8239 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8240 LDKCVec_RouteHopZ path_constr;
8241 path_constr.datalen = path->arr_len;
8242 if (path_constr.datalen > 0)
8243 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8245 path_constr.data = NULL;
8246 uint64_t* path_vals = path->elems;
8247 for (size_t k = 0; k < path_constr.datalen; k++) {
8248 uint64_t path_conv_10 = path_vals[k];
8249 LDKRouteHop path_conv_10_conv;
8250 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8251 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8252 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8253 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8254 path_constr.data[k] = path_conv_10_conv;
8257 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
8260 void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
8261 void* this_arg_ptr = untag_ptr(this_arg);
8262 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8263 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8264 LDKCVec_RouteHopZ path_constr;
8265 path_constr.datalen = path->arr_len;
8266 if (path_constr.datalen > 0)
8267 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8269 path_constr.data = NULL;
8270 uint64_t* path_vals = path->elems;
8271 for (size_t k = 0; k < path_constr.datalen; k++) {
8272 uint64_t path_conv_10 = path_vals[k];
8273 LDKRouteHop path_conv_10_conv;
8274 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8275 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8276 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8277 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8278 path_constr.data[k] = path_conv_10_conv;
8281 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
8284 void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
8285 void* this_arg_ptr = untag_ptr(this_arg);
8286 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8287 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8288 LDKCVec_RouteHopZ path_constr;
8289 path_constr.datalen = path->arr_len;
8290 if (path_constr.datalen > 0)
8291 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8293 path_constr.data = NULL;
8294 uint64_t* path_vals = path->elems;
8295 for (size_t k = 0; k < path_constr.datalen; k++) {
8296 uint64_t path_conv_10 = path_vals[k];
8297 LDKRouteHop path_conv_10_conv;
8298 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8299 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8300 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8301 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8302 path_constr.data[k] = path_conv_10_conv;
8305 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
8308 void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) {
8309 void* this_arg_ptr = untag_ptr(this_arg);
8310 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8311 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8312 LDKCVec_RouteHopZ path_constr;
8313 path_constr.datalen = path->arr_len;
8314 if (path_constr.datalen > 0)
8315 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
8317 path_constr.data = NULL;
8318 uint64_t* path_vals = path->elems;
8319 for (size_t k = 0; k < path_constr.datalen; k++) {
8320 uint64_t path_conv_10 = path_vals[k];
8321 LDKRouteHop path_conv_10_conv;
8322 path_conv_10_conv.inner = untag_ptr(path_conv_10);
8323 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
8324 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
8325 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
8326 path_constr.data[k] = path_conv_10_conv;
8329 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
8332 int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) {
8333 void* this_arg_ptr = untag_ptr(this_arg);
8334 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8335 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8336 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8337 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8338 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8339 CVec_u8Z_free(ret_var);
8343 typedef struct LDKLockableScore_JCalls {
8344 atomic_size_t refcnt;
8345 uint32_t instance_ptr;
8346 } LDKLockableScore_JCalls;
8347 static void LDKLockableScore_JCalls_free(void* this_arg) {
8348 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
8349 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8353 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
8354 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
8355 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 45, 0, 0, 0, 0, 0, 0);
8356 void* ret_ptr = untag_ptr(ret);
8357 CHECK_ACCESS(ret_ptr);
8358 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
8359 if (ret_conv.free == LDKScore_JCalls_free) {
8360 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8361 LDKScore_JCalls_cloned(&ret_conv);
8362 }// WARNING: we may need a move here but no clone is available for LDKScore
8366 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
8367 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
8368 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8370 static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
8371 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
8372 atomic_init(&calls->refcnt, 1);
8373 calls->instance_ptr = o;
8375 LDKLockableScore ret = {
8376 .this_arg = (void*) calls,
8377 .lock = lock_LDKLockableScore_jcall,
8378 .free = LDKLockableScore_JCalls_free,
8382 uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
8383 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
8384 *res_ptr = LDKLockableScore_init(o);
8385 return tag_ptr(res_ptr, true);
8387 uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
8388 void* this_arg_ptr = untag_ptr(this_arg);
8389 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8390 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
8391 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
8392 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
8393 return tag_ptr(ret_ret, true);
8396 typedef struct LDKWriteableScore_JCalls {
8397 atomic_size_t refcnt;
8398 uint32_t instance_ptr;
8399 LDKLockableScore_JCalls* LockableScore;
8400 } LDKWriteableScore_JCalls;
8401 static void LDKWriteableScore_JCalls_free(void* this_arg) {
8402 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
8403 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8407 LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
8408 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
8409 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, 0, 0, 0, 0, 0, 0);
8410 LDKCVec_u8Z ret_ref;
8411 ret_ref.datalen = ret->arr_len;
8412 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8413 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
8416 static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
8417 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
8418 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8419 atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
8421 static inline LDKWriteableScore LDKWriteableScore_init (JSValue o, JSValue LockableScore) {
8422 LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
8423 atomic_init(&calls->refcnt, 1);
8424 calls->instance_ptr = o;
8426 LDKWriteableScore ret = {
8427 .this_arg = (void*) calls,
8428 .write = write_LDKWriteableScore_jcall,
8429 .free = LDKWriteableScore_JCalls_free,
8430 .LockableScore = LDKLockableScore_init(LockableScore),
8432 calls->LockableScore = ret.LockableScore.this_arg;
8435 uint64_t __attribute__((export_name("TS_LDKWriteableScore_new"))) TS_LDKWriteableScore_new(JSValue o, JSValue LockableScore) {
8436 LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
8437 *res_ptr = LDKWriteableScore_init(o, LockableScore);
8438 return tag_ptr(res_ptr, true);
8440 int8_tArray __attribute__((export_name("TS_WriteableScore_write"))) TS_WriteableScore_write(uint64_t this_arg) {
8441 void* this_arg_ptr = untag_ptr(this_arg);
8442 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8443 LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
8444 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8445 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8446 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8447 CVec_u8Z_free(ret_var);
8451 typedef struct LDKPersister_JCalls {
8452 atomic_size_t refcnt;
8453 uint32_t instance_ptr;
8454 } LDKPersister_JCalls;
8455 static void LDKPersister_JCalls_free(void* this_arg) {
8456 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8457 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8461 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
8462 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8463 LDKChannelManager channel_manager_var = *channel_manager;
8464 uint64_t channel_manager_ref = 0;
8465 // WARNING: we may need a move here but no clone is available for LDKChannelManager
8466 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
8467 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
8468 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 47, channel_manager_ref, 0, 0, 0, 0, 0);
8469 void* ret_ptr = untag_ptr(ret);
8470 CHECK_ACCESS(ret_ptr);
8471 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8472 FREE(untag_ptr(ret));
8475 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
8476 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8477 LDKNetworkGraph network_graph_var = *network_graph;
8478 uint64_t network_graph_ref = 0;
8479 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
8480 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
8481 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
8482 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 48, network_graph_ref, 0, 0, 0, 0, 0);
8483 void* ret_ptr = untag_ptr(ret);
8484 CHECK_ACCESS(ret_ptr);
8485 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8486 FREE(untag_ptr(ret));
8489 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
8490 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8491 // WARNING: This object doesn't live past this scope, needs clone!
8492 uint64_t ret_scorer = tag_ptr(scorer, false);
8493 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 49, ret_scorer, 0, 0, 0, 0, 0);
8494 void* ret_ptr = untag_ptr(ret);
8495 CHECK_ACCESS(ret_ptr);
8496 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8497 FREE(untag_ptr(ret));
8500 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
8501 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
8502 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8504 static inline LDKPersister LDKPersister_init (JSValue o) {
8505 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
8506 atomic_init(&calls->refcnt, 1);
8507 calls->instance_ptr = o;
8509 LDKPersister ret = {
8510 .this_arg = (void*) calls,
8511 .persist_manager = persist_manager_LDKPersister_jcall,
8512 .persist_graph = persist_graph_LDKPersister_jcall,
8513 .persist_scorer = persist_scorer_LDKPersister_jcall,
8514 .free = LDKPersister_JCalls_free,
8518 uint64_t __attribute__((export_name("TS_LDKPersister_new"))) TS_LDKPersister_new(JSValue o) {
8519 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
8520 *res_ptr = LDKPersister_init(o);
8521 return tag_ptr(res_ptr, true);
8523 uint64_t __attribute__((export_name("TS_Persister_persist_manager"))) TS_Persister_persist_manager(uint64_t this_arg, uint64_t channel_manager) {
8524 void* this_arg_ptr = untag_ptr(this_arg);
8525 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8526 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8527 LDKChannelManager channel_manager_conv;
8528 channel_manager_conv.inner = untag_ptr(channel_manager);
8529 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
8530 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
8531 channel_manager_conv.is_owned = false;
8532 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8533 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
8534 return tag_ptr(ret_conv, true);
8537 uint64_t __attribute__((export_name("TS_Persister_persist_graph"))) TS_Persister_persist_graph(uint64_t this_arg, uint64_t network_graph) {
8538 void* this_arg_ptr = untag_ptr(this_arg);
8539 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8540 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8541 LDKNetworkGraph network_graph_conv;
8542 network_graph_conv.inner = untag_ptr(network_graph);
8543 network_graph_conv.is_owned = ptr_is_owned(network_graph);
8544 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
8545 network_graph_conv.is_owned = false;
8546 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8547 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
8548 return tag_ptr(ret_conv, true);
8551 uint64_t __attribute__((export_name("TS_Persister_persist_scorer"))) TS_Persister_persist_scorer(uint64_t this_arg, uint64_t scorer) {
8552 void* this_arg_ptr = untag_ptr(this_arg);
8553 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8554 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8555 void* scorer_ptr = untag_ptr(scorer);
8556 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
8557 LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
8558 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8559 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
8560 return tag_ptr(ret_conv, true);
8563 typedef struct LDKFutureCallback_JCalls {
8564 atomic_size_t refcnt;
8565 uint32_t instance_ptr;
8566 } LDKFutureCallback_JCalls;
8567 static void LDKFutureCallback_JCalls_free(void* this_arg) {
8568 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
8569 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8573 void call_LDKFutureCallback_jcall(const void* this_arg) {
8574 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
8575 js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, 0, 0, 0, 0, 0, 0);
8577 static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
8578 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
8579 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8581 static inline LDKFutureCallback LDKFutureCallback_init (JSValue o) {
8582 LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
8583 atomic_init(&calls->refcnt, 1);
8584 calls->instance_ptr = o;
8586 LDKFutureCallback ret = {
8587 .this_arg = (void*) calls,
8588 .call = call_LDKFutureCallback_jcall,
8589 .free = LDKFutureCallback_JCalls_free,
8593 uint64_t __attribute__((export_name("TS_LDKFutureCallback_new"))) TS_LDKFutureCallback_new(JSValue o) {
8594 LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
8595 *res_ptr = LDKFutureCallback_init(o);
8596 return tag_ptr(res_ptr, true);
8598 void __attribute__((export_name("TS_FutureCallback_call"))) TS_FutureCallback_call(uint64_t this_arg) {
8599 void* this_arg_ptr = untag_ptr(this_arg);
8600 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8601 LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
8602 (this_arg_conv->call)(this_arg_conv->this_arg);
8605 typedef struct LDKListen_JCalls {
8606 atomic_size_t refcnt;
8607 uint32_t instance_ptr;
8609 static void LDKListen_JCalls_free(void* this_arg) {
8610 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8611 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8615 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8616 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8617 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8618 memcpy(header_arr->elems, *header, 80);
8619 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8620 uint64_tArray txdata_arr = NULL;
8621 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8622 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8623 for (size_t c = 0; c < txdata_var.datalen; c++) {
8624 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8625 *txdata_conv_28_conv = txdata_var.data[c];
8626 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8629 FREE(txdata_var.data);
8630 int32_t height_conv = height;
8631 js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8633 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
8634 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8635 LDKu8slice block_var = block;
8636 int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
8637 memcpy(block_arr->elems, block_var.data, block_var.datalen);
8638 int32_t height_conv = height;
8639 js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
8641 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8642 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8643 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8644 memcpy(header_arr->elems, *header, 80);
8645 int32_t height_conv = height;
8646 js_invoke_function_uuuuuu(j_calls->instance_ptr, 53, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8648 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
8649 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
8650 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8652 static inline LDKListen LDKListen_init (JSValue o) {
8653 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
8654 atomic_init(&calls->refcnt, 1);
8655 calls->instance_ptr = o;
8658 .this_arg = (void*) calls,
8659 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
8660 .block_connected = block_connected_LDKListen_jcall,
8661 .block_disconnected = block_disconnected_LDKListen_jcall,
8662 .free = LDKListen_JCalls_free,
8666 uint64_t __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue o) {
8667 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
8668 *res_ptr = LDKListen_init(o);
8669 return tag_ptr(res_ptr, true);
8671 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) {
8672 void* this_arg_ptr = untag_ptr(this_arg);
8673 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8674 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8675 unsigned char header_arr[80];
8676 CHECK(header->arr_len == 80);
8677 memcpy(header_arr, header->elems, 80); FREE(header);
8678 unsigned char (*header_ref)[80] = &header_arr;
8679 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8680 txdata_constr.datalen = txdata->arr_len;
8681 if (txdata_constr.datalen > 0)
8682 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8684 txdata_constr.data = NULL;
8685 uint64_t* txdata_vals = txdata->elems;
8686 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8687 uint64_t txdata_conv_28 = txdata_vals[c];
8688 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8689 CHECK_ACCESS(txdata_conv_28_ptr);
8690 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8691 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8692 txdata_constr.data[c] = txdata_conv_28_conv;
8695 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8698 void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint64_t this_arg, int8_tArray block, int32_t height) {
8699 void* this_arg_ptr = untag_ptr(this_arg);
8700 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8701 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8702 LDKu8slice block_ref;
8703 block_ref.datalen = block->arr_len;
8704 block_ref.data = block->elems;
8705 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
8709 void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height) {
8710 void* this_arg_ptr = untag_ptr(this_arg);
8711 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8712 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8713 unsigned char header_arr[80];
8714 CHECK(header->arr_len == 80);
8715 memcpy(header_arr, header->elems, 80); FREE(header);
8716 unsigned char (*header_ref)[80] = &header_arr;
8717 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
8720 typedef struct LDKConfirm_JCalls {
8721 atomic_size_t refcnt;
8722 uint32_t instance_ptr;
8723 } LDKConfirm_JCalls;
8724 static void LDKConfirm_JCalls_free(void* this_arg) {
8725 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8726 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8730 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8731 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8732 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8733 memcpy(header_arr->elems, *header, 80);
8734 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8735 uint64_tArray txdata_arr = NULL;
8736 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8737 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8738 for (size_t c = 0; c < txdata_var.datalen; c++) {
8739 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8740 *txdata_conv_28_conv = txdata_var.data[c];
8741 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8744 FREE(txdata_var.data);
8745 int32_t height_conv = height;
8746 js_invoke_function_uuuuuu(j_calls->instance_ptr, 54, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8748 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
8749 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8750 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
8751 memcpy(txid_arr->elems, *txid, 32);
8752 js_invoke_function_uuuuuu(j_calls->instance_ptr, 55, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
8754 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8755 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8756 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8757 memcpy(header_arr->elems, *header, 80);
8758 int32_t height_conv = height;
8759 js_invoke_function_uuuuuu(j_calls->instance_ptr, 56, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8761 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
8762 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8763 ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, 0, 0, 0, 0, 0, 0);
8764 LDKCVec_TxidZ ret_constr;
8765 ret_constr.datalen = ret->arr_len;
8766 if (ret_constr.datalen > 0)
8767 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
8769 ret_constr.data = NULL;
8770 int8_tArray* ret_vals = (void*) ret->elems;
8771 for (size_t m = 0; m < ret_constr.datalen; m++) {
8772 int8_tArray ret_conv_12 = ret_vals[m];
8773 LDKThirtyTwoBytes ret_conv_12_ref;
8774 CHECK(ret_conv_12->arr_len == 32);
8775 memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
8776 ret_constr.data[m] = ret_conv_12_ref;
8781 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
8782 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
8783 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8785 static inline LDKConfirm LDKConfirm_init (JSValue o) {
8786 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
8787 atomic_init(&calls->refcnt, 1);
8788 calls->instance_ptr = o;
8791 .this_arg = (void*) calls,
8792 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
8793 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
8794 .best_block_updated = best_block_updated_LDKConfirm_jcall,
8795 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
8796 .free = LDKConfirm_JCalls_free,
8800 uint64_t __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValue o) {
8801 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
8802 *res_ptr = LDKConfirm_init(o);
8803 return tag_ptr(res_ptr, true);
8805 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) {
8806 void* this_arg_ptr = untag_ptr(this_arg);
8807 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8808 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8809 unsigned char header_arr[80];
8810 CHECK(header->arr_len == 80);
8811 memcpy(header_arr, header->elems, 80); FREE(header);
8812 unsigned char (*header_ref)[80] = &header_arr;
8813 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8814 txdata_constr.datalen = txdata->arr_len;
8815 if (txdata_constr.datalen > 0)
8816 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8818 txdata_constr.data = NULL;
8819 uint64_t* txdata_vals = txdata->elems;
8820 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8821 uint64_t txdata_conv_28 = txdata_vals[c];
8822 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8823 CHECK_ACCESS(txdata_conv_28_ptr);
8824 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8825 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8826 txdata_constr.data[c] = txdata_conv_28_conv;
8829 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8832 void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid) {
8833 void* this_arg_ptr = untag_ptr(this_arg);
8834 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8835 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8836 unsigned char txid_arr[32];
8837 CHECK(txid->arr_len == 32);
8838 memcpy(txid_arr, txid->elems, 32); FREE(txid);
8839 unsigned char (*txid_ref)[32] = &txid_arr;
8840 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
8843 void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height) {
8844 void* this_arg_ptr = untag_ptr(this_arg);
8845 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8846 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8847 unsigned char header_arr[80];
8848 CHECK(header->arr_len == 80);
8849 memcpy(header_arr, header->elems, 80); FREE(header);
8850 unsigned char (*header_ref)[80] = &header_arr;
8851 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
8854 ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
8855 void* this_arg_ptr = untag_ptr(this_arg);
8856 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8857 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8858 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
8859 ptrArray ret_arr = NULL;
8860 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
8861 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
8862 for (size_t m = 0; m < ret_var.datalen; m++) {
8863 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
8864 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
8865 ret_arr_ptr[m] = ret_conv_12_arr;
8872 typedef struct LDKPersist_JCalls {
8873 atomic_size_t refcnt;
8874 uint32_t instance_ptr;
8875 } LDKPersist_JCalls;
8876 static void LDKPersist_JCalls_free(void* this_arg) {
8877 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8878 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8882 LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8883 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8884 LDKOutPoint channel_id_var = channel_id;
8885 uint64_t channel_id_ref = 0;
8886 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8887 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8888 LDKChannelMonitor data_var = *data;
8889 uint64_t data_ref = 0;
8890 data_var = ChannelMonitor_clone(&data_var);
8891 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8892 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8893 LDKMonitorUpdateId update_id_var = update_id;
8894 uint64_t update_id_ref = 0;
8895 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8896 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8897 uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 58, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
8898 void* ret_ptr = untag_ptr(ret);
8899 CHECK_ACCESS(ret_ptr);
8900 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8901 FREE(untag_ptr(ret));
8904 LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8905 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8906 LDKOutPoint channel_id_var = channel_id;
8907 uint64_t channel_id_ref = 0;
8908 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8909 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8910 LDKChannelMonitorUpdate update_var = *update;
8911 uint64_t update_ref = 0;
8912 update_var = ChannelMonitorUpdate_clone(&update_var);
8913 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
8914 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
8915 LDKChannelMonitor data_var = *data;
8916 uint64_t data_ref = 0;
8917 data_var = ChannelMonitor_clone(&data_var);
8918 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8919 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8920 LDKMonitorUpdateId update_id_var = update_id;
8921 uint64_t update_id_ref = 0;
8922 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8923 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8924 uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 59, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
8925 void* ret_ptr = untag_ptr(ret);
8926 CHECK_ACCESS(ret_ptr);
8927 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8928 FREE(untag_ptr(ret));
8931 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
8932 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
8933 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8935 static inline LDKPersist LDKPersist_init (JSValue o) {
8936 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
8937 atomic_init(&calls->refcnt, 1);
8938 calls->instance_ptr = o;
8941 .this_arg = (void*) calls,
8942 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
8943 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
8944 .free = LDKPersist_JCalls_free,
8948 uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValue o) {
8949 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
8950 *res_ptr = LDKPersist_init(o);
8951 return tag_ptr(res_ptr, true);
8953 uint64_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) {
8954 void* this_arg_ptr = untag_ptr(this_arg);
8955 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8956 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8957 LDKOutPoint channel_id_conv;
8958 channel_id_conv.inner = untag_ptr(channel_id);
8959 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8960 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8961 channel_id_conv = OutPoint_clone(&channel_id_conv);
8962 LDKChannelMonitor data_conv;
8963 data_conv.inner = untag_ptr(data);
8964 data_conv.is_owned = ptr_is_owned(data);
8965 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8966 data_conv.is_owned = false;
8967 LDKMonitorUpdateId update_id_conv;
8968 update_id_conv.inner = untag_ptr(update_id);
8969 update_id_conv.is_owned = ptr_is_owned(update_id);
8970 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8971 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8972 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8973 *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
8974 return tag_ptr(ret_conv, true);
8977 uint64_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) {
8978 void* this_arg_ptr = untag_ptr(this_arg);
8979 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8980 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8981 LDKOutPoint channel_id_conv;
8982 channel_id_conv.inner = untag_ptr(channel_id);
8983 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8984 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8985 channel_id_conv = OutPoint_clone(&channel_id_conv);
8986 LDKChannelMonitorUpdate update_conv;
8987 update_conv.inner = untag_ptr(update);
8988 update_conv.is_owned = ptr_is_owned(update);
8989 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
8990 update_conv.is_owned = false;
8991 LDKChannelMonitor data_conv;
8992 data_conv.inner = untag_ptr(data);
8993 data_conv.is_owned = ptr_is_owned(data);
8994 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8995 data_conv.is_owned = false;
8996 LDKMonitorUpdateId update_id_conv;
8997 update_id_conv.inner = untag_ptr(update_id);
8998 update_id_conv.is_owned = ptr_is_owned(update_id);
8999 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
9000 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
9001 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
9002 *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
9003 return tag_ptr(ret_conv, true);
9006 typedef struct LDKChannelMessageHandler_JCalls {
9007 atomic_size_t refcnt;
9008 uint32_t instance_ptr;
9009 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9010 } LDKChannelMessageHandler_JCalls;
9011 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
9012 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9013 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9017 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
9018 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9019 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9020 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9021 LDKInitFeatures their_features_var = their_features;
9022 uint64_t their_features_ref = 0;
9023 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9024 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9025 LDKOpenChannel msg_var = *msg;
9026 uint64_t msg_ref = 0;
9027 msg_var = OpenChannel_clone(&msg_var);
9028 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9029 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9030 js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9032 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
9033 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9034 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9035 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9036 LDKInitFeatures their_features_var = their_features;
9037 uint64_t their_features_ref = 0;
9038 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9039 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9040 LDKAcceptChannel msg_var = *msg;
9041 uint64_t msg_ref = 0;
9042 msg_var = AcceptChannel_clone(&msg_var);
9043 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9044 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9045 js_invoke_function_ubbuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9047 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
9048 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9049 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9050 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9051 LDKFundingCreated msg_var = *msg;
9052 uint64_t msg_ref = 0;
9053 msg_var = FundingCreated_clone(&msg_var);
9054 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9055 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9056 js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9058 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
9059 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9060 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9061 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9062 LDKFundingSigned msg_var = *msg;
9063 uint64_t msg_ref = 0;
9064 msg_var = FundingSigned_clone(&msg_var);
9065 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9066 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9067 js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9069 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
9070 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9071 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9072 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9073 LDKChannelReady msg_var = *msg;
9074 uint64_t msg_ref = 0;
9075 msg_var = ChannelReady_clone(&msg_var);
9076 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9077 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9078 js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9080 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
9081 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9082 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9083 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9084 LDKInitFeatures their_features_var = *their_features;
9085 uint64_t their_features_ref = 0;
9086 their_features_var = InitFeatures_clone(&their_features_var);
9087 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
9088 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
9089 LDKShutdown msg_var = *msg;
9090 uint64_t msg_ref = 0;
9091 msg_var = Shutdown_clone(&msg_var);
9092 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9093 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9094 js_invoke_function_ubbuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
9096 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
9097 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9098 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9099 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9100 LDKClosingSigned msg_var = *msg;
9101 uint64_t msg_ref = 0;
9102 msg_var = ClosingSigned_clone(&msg_var);
9103 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9104 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9105 js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9107 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
9108 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9109 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9110 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9111 LDKUpdateAddHTLC msg_var = *msg;
9112 uint64_t msg_ref = 0;
9113 msg_var = UpdateAddHTLC_clone(&msg_var);
9114 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9115 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9116 js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9118 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
9119 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9120 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9121 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9122 LDKUpdateFulfillHTLC msg_var = *msg;
9123 uint64_t msg_ref = 0;
9124 msg_var = UpdateFulfillHTLC_clone(&msg_var);
9125 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9126 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9127 js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9129 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
9130 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9131 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9132 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9133 LDKUpdateFailHTLC msg_var = *msg;
9134 uint64_t msg_ref = 0;
9135 msg_var = UpdateFailHTLC_clone(&msg_var);
9136 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9137 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9138 js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9140 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
9141 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9142 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9143 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9144 LDKUpdateFailMalformedHTLC msg_var = *msg;
9145 uint64_t msg_ref = 0;
9146 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
9147 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9148 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9149 js_invoke_function_ubuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9151 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
9152 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9153 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9154 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9155 LDKCommitmentSigned msg_var = *msg;
9156 uint64_t msg_ref = 0;
9157 msg_var = CommitmentSigned_clone(&msg_var);
9158 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9159 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9160 js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9162 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
9163 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9164 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9165 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9166 LDKRevokeAndACK msg_var = *msg;
9167 uint64_t msg_ref = 0;
9168 msg_var = RevokeAndACK_clone(&msg_var);
9169 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9170 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9171 js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9173 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
9174 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9175 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9176 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9177 LDKUpdateFee msg_var = *msg;
9178 uint64_t msg_ref = 0;
9179 msg_var = UpdateFee_clone(&msg_var);
9180 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9181 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9182 js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9184 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
9185 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9186 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9187 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9188 LDKAnnouncementSignatures msg_var = *msg;
9189 uint64_t msg_ref = 0;
9190 msg_var = AnnouncementSignatures_clone(&msg_var);
9191 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9192 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9193 js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9195 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
9196 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9197 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9198 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9199 jboolean no_connection_possible_conv = no_connection_possible;
9200 js_invoke_function_uuuuuu(j_calls->instance_ptr, 75, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
9202 void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
9203 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9204 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9205 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9206 LDKInit msg_var = *msg;
9207 uint64_t msg_ref = 0;
9208 msg_var = Init_clone(&msg_var);
9209 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9210 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9211 js_invoke_function_ubuuuu(j_calls->instance_ptr, 76, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9213 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
9214 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9215 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9216 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9217 LDKChannelReestablish msg_var = *msg;
9218 uint64_t msg_ref = 0;
9219 msg_var = ChannelReestablish_clone(&msg_var);
9220 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9221 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9222 js_invoke_function_ubuuuu(j_calls->instance_ptr, 77, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9224 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
9225 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9226 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9227 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9228 LDKChannelUpdate msg_var = *msg;
9229 uint64_t msg_ref = 0;
9230 msg_var = ChannelUpdate_clone(&msg_var);
9231 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9232 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9233 js_invoke_function_ubuuuu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9235 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
9236 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9237 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9238 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9239 LDKErrorMessage msg_var = *msg;
9240 uint64_t msg_ref = 0;
9241 msg_var = ErrorMessage_clone(&msg_var);
9242 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9243 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9244 js_invoke_function_ubuuuu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9246 LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
9247 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9248 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 80, 0, 0, 0, 0, 0, 0);
9249 LDKNodeFeatures ret_conv;
9250 ret_conv.inner = untag_ptr(ret);
9251 ret_conv.is_owned = ptr_is_owned(ret);
9252 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9255 LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
9256 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
9257 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9258 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9259 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
9260 LDKInitFeatures ret_conv;
9261 ret_conv.inner = untag_ptr(ret);
9262 ret_conv.is_owned = ptr_is_owned(ret);
9263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9266 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
9267 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
9268 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9269 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9271 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9272 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
9273 atomic_init(&calls->refcnt, 1);
9274 calls->instance_ptr = o;
9276 LDKChannelMessageHandler ret = {
9277 .this_arg = (void*) calls,
9278 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
9279 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
9280 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
9281 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
9282 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
9283 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
9284 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
9285 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
9286 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
9287 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
9288 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
9289 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
9290 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
9291 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
9292 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
9293 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
9294 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
9295 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
9296 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
9297 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
9298 .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
9299 .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
9300 .free = LDKChannelMessageHandler_JCalls_free,
9301 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9303 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9306 uint64_t __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChannelMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9307 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
9308 *res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
9309 return tag_ptr(res_ptr, true);
9311 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) {
9312 void* this_arg_ptr = untag_ptr(this_arg);
9313 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9314 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9315 LDKPublicKey their_node_id_ref;
9316 CHECK(their_node_id->arr_len == 33);
9317 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9318 LDKInitFeatures their_features_conv;
9319 their_features_conv.inner = untag_ptr(their_features);
9320 their_features_conv.is_owned = ptr_is_owned(their_features);
9321 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9322 their_features_conv = InitFeatures_clone(&their_features_conv);
9323 LDKOpenChannel msg_conv;
9324 msg_conv.inner = untag_ptr(msg);
9325 msg_conv.is_owned = ptr_is_owned(msg);
9326 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9327 msg_conv.is_owned = false;
9328 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
9331 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) {
9332 void* this_arg_ptr = untag_ptr(this_arg);
9333 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9334 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9335 LDKPublicKey their_node_id_ref;
9336 CHECK(their_node_id->arr_len == 33);
9337 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9338 LDKInitFeatures their_features_conv;
9339 their_features_conv.inner = untag_ptr(their_features);
9340 their_features_conv.is_owned = ptr_is_owned(their_features);
9341 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9342 their_features_conv = InitFeatures_clone(&their_features_conv);
9343 LDKAcceptChannel msg_conv;
9344 msg_conv.inner = untag_ptr(msg);
9345 msg_conv.is_owned = ptr_is_owned(msg);
9346 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9347 msg_conv.is_owned = false;
9348 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
9351 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) {
9352 void* this_arg_ptr = untag_ptr(this_arg);
9353 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9354 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9355 LDKPublicKey their_node_id_ref;
9356 CHECK(their_node_id->arr_len == 33);
9357 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9358 LDKFundingCreated msg_conv;
9359 msg_conv.inner = untag_ptr(msg);
9360 msg_conv.is_owned = ptr_is_owned(msg);
9361 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9362 msg_conv.is_owned = false;
9363 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9366 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) {
9367 void* this_arg_ptr = untag_ptr(this_arg);
9368 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9369 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9370 LDKPublicKey their_node_id_ref;
9371 CHECK(their_node_id->arr_len == 33);
9372 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9373 LDKFundingSigned msg_conv;
9374 msg_conv.inner = untag_ptr(msg);
9375 msg_conv.is_owned = ptr_is_owned(msg);
9376 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9377 msg_conv.is_owned = false;
9378 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9381 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) {
9382 void* this_arg_ptr = untag_ptr(this_arg);
9383 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9384 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9385 LDKPublicKey their_node_id_ref;
9386 CHECK(their_node_id->arr_len == 33);
9387 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9388 LDKChannelReady msg_conv;
9389 msg_conv.inner = untag_ptr(msg);
9390 msg_conv.is_owned = ptr_is_owned(msg);
9391 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9392 msg_conv.is_owned = false;
9393 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9396 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) {
9397 void* this_arg_ptr = untag_ptr(this_arg);
9398 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9399 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9400 LDKPublicKey their_node_id_ref;
9401 CHECK(their_node_id->arr_len == 33);
9402 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9403 LDKInitFeatures their_features_conv;
9404 their_features_conv.inner = untag_ptr(their_features);
9405 their_features_conv.is_owned = ptr_is_owned(their_features);
9406 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
9407 their_features_conv.is_owned = false;
9408 LDKShutdown msg_conv;
9409 msg_conv.inner = untag_ptr(msg);
9410 msg_conv.is_owned = ptr_is_owned(msg);
9411 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9412 msg_conv.is_owned = false;
9413 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
9416 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) {
9417 void* this_arg_ptr = untag_ptr(this_arg);
9418 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9419 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9420 LDKPublicKey their_node_id_ref;
9421 CHECK(their_node_id->arr_len == 33);
9422 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9423 LDKClosingSigned msg_conv;
9424 msg_conv.inner = untag_ptr(msg);
9425 msg_conv.is_owned = ptr_is_owned(msg);
9426 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9427 msg_conv.is_owned = false;
9428 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9431 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) {
9432 void* this_arg_ptr = untag_ptr(this_arg);
9433 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9434 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9435 LDKPublicKey their_node_id_ref;
9436 CHECK(their_node_id->arr_len == 33);
9437 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9438 LDKUpdateAddHTLC msg_conv;
9439 msg_conv.inner = untag_ptr(msg);
9440 msg_conv.is_owned = ptr_is_owned(msg);
9441 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9442 msg_conv.is_owned = false;
9443 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9446 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) {
9447 void* this_arg_ptr = untag_ptr(this_arg);
9448 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9449 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9450 LDKPublicKey their_node_id_ref;
9451 CHECK(their_node_id->arr_len == 33);
9452 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9453 LDKUpdateFulfillHTLC msg_conv;
9454 msg_conv.inner = untag_ptr(msg);
9455 msg_conv.is_owned = ptr_is_owned(msg);
9456 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9457 msg_conv.is_owned = false;
9458 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9461 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) {
9462 void* this_arg_ptr = untag_ptr(this_arg);
9463 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9464 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9465 LDKPublicKey their_node_id_ref;
9466 CHECK(their_node_id->arr_len == 33);
9467 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9468 LDKUpdateFailHTLC msg_conv;
9469 msg_conv.inner = untag_ptr(msg);
9470 msg_conv.is_owned = ptr_is_owned(msg);
9471 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9472 msg_conv.is_owned = false;
9473 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9476 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) {
9477 void* this_arg_ptr = untag_ptr(this_arg);
9478 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9479 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9480 LDKPublicKey their_node_id_ref;
9481 CHECK(their_node_id->arr_len == 33);
9482 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9483 LDKUpdateFailMalformedHTLC msg_conv;
9484 msg_conv.inner = untag_ptr(msg);
9485 msg_conv.is_owned = ptr_is_owned(msg);
9486 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9487 msg_conv.is_owned = false;
9488 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9491 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) {
9492 void* this_arg_ptr = untag_ptr(this_arg);
9493 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9494 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9495 LDKPublicKey their_node_id_ref;
9496 CHECK(their_node_id->arr_len == 33);
9497 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9498 LDKCommitmentSigned msg_conv;
9499 msg_conv.inner = untag_ptr(msg);
9500 msg_conv.is_owned = ptr_is_owned(msg);
9501 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9502 msg_conv.is_owned = false;
9503 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9506 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) {
9507 void* this_arg_ptr = untag_ptr(this_arg);
9508 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9509 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9510 LDKPublicKey their_node_id_ref;
9511 CHECK(their_node_id->arr_len == 33);
9512 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9513 LDKRevokeAndACK msg_conv;
9514 msg_conv.inner = untag_ptr(msg);
9515 msg_conv.is_owned = ptr_is_owned(msg);
9516 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9517 msg_conv.is_owned = false;
9518 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9521 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) {
9522 void* this_arg_ptr = untag_ptr(this_arg);
9523 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9524 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9525 LDKPublicKey their_node_id_ref;
9526 CHECK(their_node_id->arr_len == 33);
9527 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9528 LDKUpdateFee msg_conv;
9529 msg_conv.inner = untag_ptr(msg);
9530 msg_conv.is_owned = ptr_is_owned(msg);
9531 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9532 msg_conv.is_owned = false;
9533 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9536 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) {
9537 void* this_arg_ptr = untag_ptr(this_arg);
9538 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9539 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9540 LDKPublicKey their_node_id_ref;
9541 CHECK(their_node_id->arr_len == 33);
9542 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9543 LDKAnnouncementSignatures msg_conv;
9544 msg_conv.inner = untag_ptr(msg);
9545 msg_conv.is_owned = ptr_is_owned(msg);
9546 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9547 msg_conv.is_owned = false;
9548 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9551 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) {
9552 void* this_arg_ptr = untag_ptr(this_arg);
9553 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9554 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9555 LDKPublicKey their_node_id_ref;
9556 CHECK(their_node_id->arr_len == 33);
9557 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9558 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
9561 void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9562 void* this_arg_ptr = untag_ptr(this_arg);
9563 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9564 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9565 LDKPublicKey their_node_id_ref;
9566 CHECK(their_node_id->arr_len == 33);
9567 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9569 msg_conv.inner = untag_ptr(msg);
9570 msg_conv.is_owned = ptr_is_owned(msg);
9571 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9572 msg_conv.is_owned = false;
9573 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9576 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) {
9577 void* this_arg_ptr = untag_ptr(this_arg);
9578 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9579 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9580 LDKPublicKey their_node_id_ref;
9581 CHECK(their_node_id->arr_len == 33);
9582 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9583 LDKChannelReestablish msg_conv;
9584 msg_conv.inner = untag_ptr(msg);
9585 msg_conv.is_owned = ptr_is_owned(msg);
9586 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9587 msg_conv.is_owned = false;
9588 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9591 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) {
9592 void* this_arg_ptr = untag_ptr(this_arg);
9593 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9594 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9595 LDKPublicKey their_node_id_ref;
9596 CHECK(their_node_id->arr_len == 33);
9597 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9598 LDKChannelUpdate msg_conv;
9599 msg_conv.inner = untag_ptr(msg);
9600 msg_conv.is_owned = ptr_is_owned(msg);
9601 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9602 msg_conv.is_owned = false;
9603 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9606 void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9607 void* this_arg_ptr = untag_ptr(this_arg);
9608 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9609 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9610 LDKPublicKey their_node_id_ref;
9611 CHECK(their_node_id->arr_len == 33);
9612 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9613 LDKErrorMessage msg_conv;
9614 msg_conv.inner = untag_ptr(msg);
9615 msg_conv.is_owned = ptr_is_owned(msg);
9616 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9617 msg_conv.is_owned = false;
9618 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9621 uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_node_features"))) TS_ChannelMessageHandler_provided_node_features(uint64_t this_arg) {
9622 void* this_arg_ptr = untag_ptr(this_arg);
9623 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9624 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9625 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
9626 uint64_t ret_ref = 0;
9627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9632 uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_init_features"))) TS_ChannelMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
9633 void* this_arg_ptr = untag_ptr(this_arg);
9634 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9635 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9636 LDKPublicKey their_node_id_ref;
9637 CHECK(their_node_id->arr_len == 33);
9638 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9639 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
9640 uint64_t ret_ref = 0;
9641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9646 typedef struct LDKRoutingMessageHandler_JCalls {
9647 atomic_size_t refcnt;
9648 uint32_t instance_ptr;
9649 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9650 } LDKRoutingMessageHandler_JCalls;
9651 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
9652 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9653 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9657 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
9658 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9659 LDKNodeAnnouncement msg_var = *msg;
9660 uint64_t msg_ref = 0;
9661 msg_var = NodeAnnouncement_clone(&msg_var);
9662 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9663 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9664 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 82, msg_ref, 0, 0, 0, 0, 0);
9665 void* ret_ptr = untag_ptr(ret);
9666 CHECK_ACCESS(ret_ptr);
9667 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9668 FREE(untag_ptr(ret));
9671 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
9672 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9673 LDKChannelAnnouncement msg_var = *msg;
9674 uint64_t msg_ref = 0;
9675 msg_var = ChannelAnnouncement_clone(&msg_var);
9676 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9677 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9678 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 83, msg_ref, 0, 0, 0, 0, 0);
9679 void* ret_ptr = untag_ptr(ret);
9680 CHECK_ACCESS(ret_ptr);
9681 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9682 FREE(untag_ptr(ret));
9685 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
9686 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9687 LDKChannelUpdate msg_var = *msg;
9688 uint64_t msg_ref = 0;
9689 msg_var = ChannelUpdate_clone(&msg_var);
9690 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9691 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9692 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 84, msg_ref, 0, 0, 0, 0, 0);
9693 void* ret_ptr = untag_ptr(ret);
9694 CHECK_ACCESS(ret_ptr);
9695 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9696 FREE(untag_ptr(ret));
9699 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
9700 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9701 int64_t starting_point_conv = starting_point;
9702 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 85, starting_point_conv, 0, 0, 0, 0, 0);
9703 void* ret_ptr = untag_ptr(ret);
9704 CHECK_ACCESS(ret_ptr);
9705 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
9706 FREE(untag_ptr(ret));
9709 LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point) {
9710 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9711 int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
9712 memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
9713 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 86, (uint32_t)starting_point_arr, 0, 0, 0, 0, 0);
9714 LDKNodeAnnouncement ret_conv;
9715 ret_conv.inner = untag_ptr(ret);
9716 ret_conv.is_owned = ptr_is_owned(ret);
9717 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9720 void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
9721 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9722 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9723 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9724 LDKInit init_var = *init;
9725 uint64_t init_ref = 0;
9726 init_var = Init_clone(&init_var);
9727 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
9728 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
9729 js_invoke_function_ubuuuu(j_calls->instance_ptr, 87, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
9731 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
9732 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9733 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9734 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9735 LDKReplyChannelRange msg_var = msg;
9736 uint64_t msg_ref = 0;
9737 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9738 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9739 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 88, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9740 void* ret_ptr = untag_ptr(ret);
9741 CHECK_ACCESS(ret_ptr);
9742 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9743 FREE(untag_ptr(ret));
9746 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
9747 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9748 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9749 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9750 LDKReplyShortChannelIdsEnd msg_var = msg;
9751 uint64_t msg_ref = 0;
9752 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9753 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9754 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 89, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9755 void* ret_ptr = untag_ptr(ret);
9756 CHECK_ACCESS(ret_ptr);
9757 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9758 FREE(untag_ptr(ret));
9761 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
9762 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9763 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9764 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9765 LDKQueryChannelRange msg_var = msg;
9766 uint64_t msg_ref = 0;
9767 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9768 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9769 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 90, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9770 void* ret_ptr = untag_ptr(ret);
9771 CHECK_ACCESS(ret_ptr);
9772 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9773 FREE(untag_ptr(ret));
9776 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
9777 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9778 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9779 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9780 LDKQueryShortChannelIds msg_var = msg;
9781 uint64_t msg_ref = 0;
9782 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9783 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9784 uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 91, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9785 void* ret_ptr = untag_ptr(ret);
9786 CHECK_ACCESS(ret_ptr);
9787 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9788 FREE(untag_ptr(ret));
9791 LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
9792 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9793 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0);
9794 LDKNodeFeatures ret_conv;
9795 ret_conv.inner = untag_ptr(ret);
9796 ret_conv.is_owned = ptr_is_owned(ret);
9797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9800 LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
9801 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9802 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9803 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9804 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
9805 LDKInitFeatures ret_conv;
9806 ret_conv.inner = untag_ptr(ret);
9807 ret_conv.is_owned = ptr_is_owned(ret);
9808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
9811 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
9812 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
9813 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9814 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9816 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9817 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
9818 atomic_init(&calls->refcnt, 1);
9819 calls->instance_ptr = o;
9821 LDKRoutingMessageHandler ret = {
9822 .this_arg = (void*) calls,
9823 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
9824 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
9825 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
9826 .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
9827 .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
9828 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
9829 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
9830 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
9831 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
9832 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
9833 .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
9834 .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
9835 .free = LDKRoutingMessageHandler_JCalls_free,
9836 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9838 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9841 uint64_t __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRoutingMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9842 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9843 *res_ptr = LDKRoutingMessageHandler_init(o, MessageSendEventsProvider);
9844 return tag_ptr(res_ptr, true);
9846 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint64_t this_arg, uint64_t msg) {
9847 void* this_arg_ptr = untag_ptr(this_arg);
9848 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9849 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9850 LDKNodeAnnouncement msg_conv;
9851 msg_conv.inner = untag_ptr(msg);
9852 msg_conv.is_owned = ptr_is_owned(msg);
9853 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9854 msg_conv.is_owned = false;
9855 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9856 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
9857 return tag_ptr(ret_conv, true);
9860 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint64_t this_arg, uint64_t msg) {
9861 void* this_arg_ptr = untag_ptr(this_arg);
9862 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9863 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9864 LDKChannelAnnouncement msg_conv;
9865 msg_conv.inner = untag_ptr(msg);
9866 msg_conv.is_owned = ptr_is_owned(msg);
9867 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9868 msg_conv.is_owned = false;
9869 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9870 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
9871 return tag_ptr(ret_conv, true);
9874 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint64_t this_arg, uint64_t msg) {
9875 void* this_arg_ptr = untag_ptr(this_arg);
9876 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9877 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9878 LDKChannelUpdate msg_conv;
9879 msg_conv.inner = untag_ptr(msg);
9880 msg_conv.is_owned = ptr_is_owned(msg);
9881 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9882 msg_conv.is_owned = false;
9883 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9884 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
9885 return tag_ptr(ret_conv, true);
9888 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) {
9889 void* this_arg_ptr = untag_ptr(this_arg);
9890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9891 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9892 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
9893 *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
9894 uint64_t ret_ref = tag_ptr(ret_copy, true);
9898 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) {
9899 void* this_arg_ptr = untag_ptr(this_arg);
9900 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9901 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9902 LDKPublicKey starting_point_ref;
9903 CHECK(starting_point->arr_len == 33);
9904 memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
9905 LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_ref);
9906 uint64_t ret_ref = 0;
9907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9912 void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
9913 void* this_arg_ptr = untag_ptr(this_arg);
9914 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9915 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9916 LDKPublicKey their_node_id_ref;
9917 CHECK(their_node_id->arr_len == 33);
9918 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9920 init_conv.inner = untag_ptr(init);
9921 init_conv.is_owned = ptr_is_owned(init);
9922 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
9923 init_conv.is_owned = false;
9924 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
9927 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) {
9928 void* this_arg_ptr = untag_ptr(this_arg);
9929 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9930 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9931 LDKPublicKey their_node_id_ref;
9932 CHECK(their_node_id->arr_len == 33);
9933 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9934 LDKReplyChannelRange msg_conv;
9935 msg_conv.inner = untag_ptr(msg);
9936 msg_conv.is_owned = ptr_is_owned(msg);
9937 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9938 msg_conv = ReplyChannelRange_clone(&msg_conv);
9939 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9940 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9941 return tag_ptr(ret_conv, true);
9944 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) {
9945 void* this_arg_ptr = untag_ptr(this_arg);
9946 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9947 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9948 LDKPublicKey their_node_id_ref;
9949 CHECK(their_node_id->arr_len == 33);
9950 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9951 LDKReplyShortChannelIdsEnd msg_conv;
9952 msg_conv.inner = untag_ptr(msg);
9953 msg_conv.is_owned = ptr_is_owned(msg);
9954 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9955 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
9956 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9957 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9958 return tag_ptr(ret_conv, true);
9961 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) {
9962 void* this_arg_ptr = untag_ptr(this_arg);
9963 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9964 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9965 LDKPublicKey their_node_id_ref;
9966 CHECK(their_node_id->arr_len == 33);
9967 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9968 LDKQueryChannelRange msg_conv;
9969 msg_conv.inner = untag_ptr(msg);
9970 msg_conv.is_owned = ptr_is_owned(msg);
9971 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9972 msg_conv = QueryChannelRange_clone(&msg_conv);
9973 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9974 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9975 return tag_ptr(ret_conv, true);
9978 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) {
9979 void* this_arg_ptr = untag_ptr(this_arg);
9980 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9981 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9982 LDKPublicKey their_node_id_ref;
9983 CHECK(their_node_id->arr_len == 33);
9984 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9985 LDKQueryShortChannelIds msg_conv;
9986 msg_conv.inner = untag_ptr(msg);
9987 msg_conv.is_owned = ptr_is_owned(msg);
9988 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9989 msg_conv = QueryShortChannelIds_clone(&msg_conv);
9990 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9991 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9992 return tag_ptr(ret_conv, true);
9995 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_node_features"))) TS_RoutingMessageHandler_provided_node_features(uint64_t this_arg) {
9996 void* this_arg_ptr = untag_ptr(this_arg);
9997 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9998 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9999 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
10000 uint64_t ret_ref = 0;
10001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10006 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_init_features"))) TS_RoutingMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
10007 void* this_arg_ptr = untag_ptr(this_arg);
10008 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10009 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
10010 LDKPublicKey their_node_id_ref;
10011 CHECK(their_node_id->arr_len == 33);
10012 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10013 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
10014 uint64_t ret_ref = 0;
10015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10020 typedef struct LDKOnionMessageHandler_JCalls {
10021 atomic_size_t refcnt;
10022 uint32_t instance_ptr;
10023 LDKOnionMessageProvider_JCalls* OnionMessageProvider;
10024 } LDKOnionMessageHandler_JCalls;
10025 static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
10026 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10027 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10031 void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
10032 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10033 int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
10034 memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
10035 LDKOnionMessage msg_var = *msg;
10036 uint64_t msg_ref = 0;
10037 msg_var = OnionMessage_clone(&msg_var);
10038 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10039 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10040 js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0);
10042 void peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
10043 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10044 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10045 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10046 LDKInit init_var = *init;
10047 uint64_t init_ref = 0;
10048 init_var = Init_clone(&init_var);
10049 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
10050 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
10051 js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
10053 void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
10054 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10055 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10056 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10057 jboolean no_connection_possible_conv = no_connection_possible;
10058 js_invoke_function_uuuuuu(j_calls->instance_ptr, 96, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
10060 LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
10061 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10062 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 97, 0, 0, 0, 0, 0, 0);
10063 LDKNodeFeatures ret_conv;
10064 ret_conv.inner = untag_ptr(ret);
10065 ret_conv.is_owned = ptr_is_owned(ret);
10066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
10069 LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
10070 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
10071 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
10072 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
10073 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
10074 LDKInitFeatures ret_conv;
10075 ret_conv.inner = untag_ptr(ret);
10076 ret_conv.is_owned = ptr_is_owned(ret);
10077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
10080 static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
10081 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
10082 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10083 atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
10085 static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JSValue o, JSValue OnionMessageProvider) {
10086 LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
10087 atomic_init(&calls->refcnt, 1);
10088 calls->instance_ptr = o;
10090 LDKOnionMessageHandler ret = {
10091 .this_arg = (void*) calls,
10092 .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
10093 .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
10094 .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
10095 .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
10096 .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
10097 .free = LDKOnionMessageHandler_JCalls_free,
10098 .OnionMessageProvider = LDKOnionMessageProvider_init(OnionMessageProvider),
10100 calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
10103 uint64_t __attribute__((export_name("TS_LDKOnionMessageHandler_new"))) TS_LDKOnionMessageHandler_new(JSValue o, JSValue OnionMessageProvider) {
10104 LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
10105 *res_ptr = LDKOnionMessageHandler_init(o, OnionMessageProvider);
10106 return tag_ptr(res_ptr, true);
10108 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) {
10109 void* this_arg_ptr = untag_ptr(this_arg);
10110 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10111 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10112 LDKPublicKey peer_node_id_ref;
10113 CHECK(peer_node_id->arr_len == 33);
10114 memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
10115 LDKOnionMessage msg_conv;
10116 msg_conv.inner = untag_ptr(msg);
10117 msg_conv.is_owned = ptr_is_owned(msg);
10118 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
10119 msg_conv.is_owned = false;
10120 (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
10123 void __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_OnionMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
10124 void* this_arg_ptr = untag_ptr(this_arg);
10125 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10126 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10127 LDKPublicKey their_node_id_ref;
10128 CHECK(their_node_id->arr_len == 33);
10129 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10131 init_conv.inner = untag_ptr(init);
10132 init_conv.is_owned = ptr_is_owned(init);
10133 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
10134 init_conv.is_owned = false;
10135 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
10138 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) {
10139 void* this_arg_ptr = untag_ptr(this_arg);
10140 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10141 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10142 LDKPublicKey their_node_id_ref;
10143 CHECK(their_node_id->arr_len == 33);
10144 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10145 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
10148 uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_node_features"))) TS_OnionMessageHandler_provided_node_features(uint64_t this_arg) {
10149 void* this_arg_ptr = untag_ptr(this_arg);
10150 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10151 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10152 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
10153 uint64_t ret_ref = 0;
10154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10159 uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_init_features"))) TS_OnionMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
10160 void* this_arg_ptr = untag_ptr(this_arg);
10161 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10162 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
10163 LDKPublicKey their_node_id_ref;
10164 CHECK(their_node_id->arr_len == 33);
10165 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
10166 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
10167 uint64_t ret_ref = 0;
10168 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10169 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10173 typedef struct LDKCustomMessageReader_JCalls {
10174 atomic_size_t refcnt;
10175 uint32_t instance_ptr;
10176 } LDKCustomMessageReader_JCalls;
10177 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
10178 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
10179 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10183 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
10184 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
10185 int16_t message_type_conv = message_type;
10186 LDKu8slice buffer_var = buffer;
10187 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
10188 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
10189 uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 99, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
10190 void* ret_ptr = untag_ptr(ret);
10191 CHECK_ACCESS(ret_ptr);
10192 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
10193 FREE(untag_ptr(ret));
10196 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
10197 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
10198 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10200 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JSValue o) {
10201 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
10202 atomic_init(&calls->refcnt, 1);
10203 calls->instance_ptr = o;
10205 LDKCustomMessageReader ret = {
10206 .this_arg = (void*) calls,
10207 .read = read_LDKCustomMessageReader_jcall,
10208 .free = LDKCustomMessageReader_JCalls_free,
10212 uint64_t __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustomMessageReader_new(JSValue o) {
10213 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
10214 *res_ptr = LDKCustomMessageReader_init(o);
10215 return tag_ptr(res_ptr, true);
10217 uint64_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint64_t this_arg, int16_t message_type, int8_tArray buffer) {
10218 void* this_arg_ptr = untag_ptr(this_arg);
10219 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10220 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
10221 LDKu8slice buffer_ref;
10222 buffer_ref.datalen = buffer->arr_len;
10223 buffer_ref.data = buffer->elems;
10224 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
10225 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
10227 return tag_ptr(ret_conv, true);
10230 typedef struct LDKCustomMessageHandler_JCalls {
10231 atomic_size_t refcnt;
10232 uint32_t instance_ptr;
10233 LDKCustomMessageReader_JCalls* CustomMessageReader;
10234 } LDKCustomMessageHandler_JCalls;
10235 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
10236 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10237 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10241 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
10242 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10243 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
10245 int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
10246 memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
10247 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 100, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0);
10248 void* ret_ptr = untag_ptr(ret);
10249 CHECK_ACCESS(ret_ptr);
10250 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
10251 FREE(untag_ptr(ret));
10254 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
10255 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
10256 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 101, 0, 0, 0, 0, 0, 0);
10257 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
10258 ret_constr.datalen = ret->arr_len;
10259 if (ret_constr.datalen > 0)
10260 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
10262 ret_constr.data = NULL;
10263 uint64_t* ret_vals = ret->elems;
10264 for (size_t z = 0; z < ret_constr.datalen; z++) {
10265 uint64_t ret_conv_25 = ret_vals[z];
10266 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
10267 CHECK_ACCESS(ret_conv_25_ptr);
10268 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
10269 FREE(untag_ptr(ret_conv_25));
10270 ret_constr.data[z] = ret_conv_25_conv;
10275 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
10276 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
10277 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10278 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
10280 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JSValue o, JSValue CustomMessageReader) {
10281 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
10282 atomic_init(&calls->refcnt, 1);
10283 calls->instance_ptr = o;
10285 LDKCustomMessageHandler ret = {
10286 .this_arg = (void*) calls,
10287 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
10288 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
10289 .free = LDKCustomMessageHandler_JCalls_free,
10290 .CustomMessageReader = LDKCustomMessageReader_init(CustomMessageReader),
10292 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
10295 uint64_t __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCustomMessageHandler_new(JSValue o, JSValue CustomMessageReader) {
10296 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
10297 *res_ptr = LDKCustomMessageHandler_init(o, CustomMessageReader);
10298 return tag_ptr(res_ptr, true);
10300 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) {
10301 void* this_arg_ptr = untag_ptr(this_arg);
10302 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10303 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
10304 void* msg_ptr = untag_ptr(msg);
10305 CHECK_ACCESS(msg_ptr);
10306 LDKType msg_conv = *(LDKType*)(msg_ptr);
10307 if (msg_conv.free == LDKType_JCalls_free) {
10308 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
10309 LDKType_JCalls_cloned(&msg_conv);
10311 LDKPublicKey sender_node_id_ref;
10312 CHECK(sender_node_id->arr_len == 33);
10313 memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id);
10314 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
10315 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
10316 return tag_ptr(ret_conv, true);
10319 uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint64_t this_arg) {
10320 void* this_arg_ptr = untag_ptr(this_arg);
10321 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10322 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
10323 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
10324 uint64_tArray ret_arr = NULL;
10325 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10326 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10327 for (size_t z = 0; z < ret_var.datalen; z++) {
10328 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
10329 *ret_conv_25_conv = ret_var.data[z];
10330 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
10333 FREE(ret_var.data);
10337 typedef struct LDKSocketDescriptor_JCalls {
10338 atomic_size_t refcnt;
10339 uint32_t instance_ptr;
10340 } LDKSocketDescriptor_JCalls;
10341 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
10342 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10343 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10347 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
10348 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10349 LDKu8slice data_var = data;
10350 int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
10351 memcpy(data_arr->elems, data_var.data, data_var.datalen);
10352 jboolean resume_read_conv = resume_read;
10353 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 102, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
10355 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
10356 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10357 js_invoke_function_uuuuuu(j_calls->instance_ptr, 103, 0, 0, 0, 0, 0, 0);
10359 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
10360 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10361 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
10362 *other_arg_clone = SocketDescriptor_clone(other_arg);
10363 return js_invoke_function_buuuuu(j_calls->instance_ptr, 104, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
10365 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
10366 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
10367 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 105, 0, 0, 0, 0, 0, 0);
10369 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
10370 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
10371 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10373 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JSValue o) {
10374 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
10375 atomic_init(&calls->refcnt, 1);
10376 calls->instance_ptr = o;
10378 LDKSocketDescriptor ret = {
10379 .this_arg = (void*) calls,
10380 .send_data = send_data_LDKSocketDescriptor_jcall,
10381 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
10382 .eq = eq_LDKSocketDescriptor_jcall,
10383 .hash = hash_LDKSocketDescriptor_jcall,
10384 .cloned = LDKSocketDescriptor_JCalls_cloned,
10385 .free = LDKSocketDescriptor_JCalls_free,
10389 uint64_t __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDescriptor_new(JSValue o) {
10390 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
10391 *res_ptr = LDKSocketDescriptor_init(o);
10392 return tag_ptr(res_ptr, true);
10394 uint32_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint64_t this_arg, int8_tArray data, jboolean resume_read) {
10395 void* this_arg_ptr = untag_ptr(this_arg);
10396 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10397 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10398 LDKu8slice data_ref;
10399 data_ref.datalen = data->arr_len;
10400 data_ref.data = data->elems;
10401 uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
10406 void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint64_t this_arg) {
10407 void* this_arg_ptr = untag_ptr(this_arg);
10408 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10409 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10410 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
10413 int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint64_t this_arg) {
10414 void* this_arg_ptr = untag_ptr(this_arg);
10415 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10416 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
10417 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
10421 uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) {
10422 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10424 case LDKEffectiveCapacity_ExactLiquidity: return 0;
10425 case LDKEffectiveCapacity_MaximumHTLC: return 1;
10426 case LDKEffectiveCapacity_Total: return 2;
10427 case LDKEffectiveCapacity_Infinite: return 3;
10428 case LDKEffectiveCapacity_Unknown: return 4;
10432 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat"))) TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(uint64_t ptr) {
10433 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10434 assert(obj->tag == LDKEffectiveCapacity_ExactLiquidity);
10435 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
10436 return liquidity_msat_conv;
10438 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat"))) TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(uint64_t ptr) {
10439 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10440 assert(obj->tag == LDKEffectiveCapacity_MaximumHTLC);
10441 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
10442 return amount_msat_conv;
10444 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_capacity_msat"))) TS_LDKEffectiveCapacity_Total_get_capacity_msat(uint64_t ptr) {
10445 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10446 assert(obj->tag == LDKEffectiveCapacity_Total);
10447 int64_t capacity_msat_conv = obj->total.capacity_msat;
10448 return capacity_msat_conv;
10450 uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
10451 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
10452 assert(obj->tag == LDKEffectiveCapacity_Total);
10453 uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
10454 return htlc_maximum_msat_ref;
10456 uint32_t __attribute__((export_name("TS_LDKDestination_ty_from_ptr"))) TS_LDKDestination_ty_from_ptr(uint64_t ptr) {
10457 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10459 case LDKDestination_Node: return 0;
10460 case LDKDestination_BlindedRoute: return 1;
10464 int8_tArray __attribute__((export_name("TS_LDKDestination_Node_get_node"))) TS_LDKDestination_Node_get_node(uint64_t ptr) {
10465 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10466 assert(obj->tag == LDKDestination_Node);
10467 int8_tArray node_arr = init_int8_tArray(33, __LINE__);
10468 memcpy(node_arr->elems, obj->node.compressed_form, 33);
10471 uint64_t __attribute__((export_name("TS_LDKDestination_BlindedRoute_get_blinded_route"))) TS_LDKDestination_BlindedRoute_get_blinded_route(uint64_t ptr) {
10472 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
10473 assert(obj->tag == LDKDestination_BlindedRoute);
10474 LDKBlindedRoute blinded_route_var = obj->blinded_route;
10475 uint64_t blinded_route_ref = 0;
10476 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_var);
10477 blinded_route_ref = tag_ptr(blinded_route_var.inner, false);
10478 return blinded_route_ref;
10480 uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
10481 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10483 case LDKFallback_SegWitProgram: return 0;
10484 case LDKFallback_PubKeyHash: return 1;
10485 case LDKFallback_ScriptHash: return 2;
10489 int8_t __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_version"))) TS_LDKFallback_SegWitProgram_get_version(uint64_t ptr) {
10490 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10491 assert(obj->tag == LDKFallback_SegWitProgram);
10492 uint8_t version_val = obj->seg_wit_program.version._0;
10493 return version_val;
10495 int8_tArray __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_program"))) TS_LDKFallback_SegWitProgram_get_program(uint64_t ptr) {
10496 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10497 assert(obj->tag == LDKFallback_SegWitProgram);
10498 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
10499 int8_tArray program_arr = init_int8_tArray(program_var.datalen, __LINE__);
10500 memcpy(program_arr->elems, program_var.data, program_var.datalen);
10501 return program_arr;
10503 int8_tArray __attribute__((export_name("TS_LDKFallback_PubKeyHash_get_pub_key_hash"))) TS_LDKFallback_PubKeyHash_get_pub_key_hash(uint64_t ptr) {
10504 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10505 assert(obj->tag == LDKFallback_PubKeyHash);
10506 int8_tArray pub_key_hash_arr = init_int8_tArray(20, __LINE__);
10507 memcpy(pub_key_hash_arr->elems, obj->pub_key_hash.data, 20);
10508 return pub_key_hash_arr;
10510 int8_tArray __attribute__((export_name("TS_LDKFallback_ScriptHash_get_script_hash"))) TS_LDKFallback_ScriptHash_get_script_hash(uint64_t ptr) {
10511 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
10512 assert(obj->tag == LDKFallback_ScriptHash);
10513 int8_tArray script_hash_arr = init_int8_tArray(20, __LINE__);
10514 memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
10515 return script_hash_arr;
10517 typedef struct LDKPayer_JCalls {
10518 atomic_size_t refcnt;
10519 uint32_t instance_ptr;
10521 static void LDKPayer_JCalls_free(void* this_arg) {
10522 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10523 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10527 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
10528 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10529 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 106, 0, 0, 0, 0, 0, 0);
10530 LDKPublicKey ret_ref;
10531 CHECK(ret->arr_len == 33);
10532 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
10535 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
10536 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10537 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 107, 0, 0, 0, 0, 0, 0);
10538 LDKCVec_ChannelDetailsZ ret_constr;
10539 ret_constr.datalen = ret->arr_len;
10540 if (ret_constr.datalen > 0)
10541 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
10543 ret_constr.data = NULL;
10544 uint64_t* ret_vals = ret->elems;
10545 for (size_t q = 0; q < ret_constr.datalen; q++) {
10546 uint64_t ret_conv_16 = ret_vals[q];
10547 LDKChannelDetails ret_conv_16_conv;
10548 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
10549 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
10550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
10551 ret_constr.data[q] = ret_conv_16_conv;
10556 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
10557 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10558 LDKRoute route_var = *route;
10559 uint64_t route_ref = 0;
10560 route_var = Route_clone(&route_var);
10561 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10562 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10563 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10564 memcpy(payment_hash_arr->elems, payment_hash.data, 32);
10565 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
10566 memcpy(payment_secret_arr->elems, payment_secret.data, 32);
10567 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 108, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0);
10568 void* ret_ptr = untag_ptr(ret);
10569 CHECK_ACCESS(ret_ptr);
10570 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
10571 FREE(untag_ptr(ret));
10574 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
10575 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10576 LDKRoute route_var = *route;
10577 uint64_t route_ref = 0;
10578 route_var = Route_clone(&route_var);
10579 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10580 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10581 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
10582 memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
10583 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 109, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
10584 void* ret_ptr = untag_ptr(ret);
10585 CHECK_ACCESS(ret_ptr);
10586 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
10587 FREE(untag_ptr(ret));
10590 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
10591 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10592 LDKRoute route_var = *route;
10593 uint64_t route_ref = 0;
10594 route_var = Route_clone(&route_var);
10595 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
10596 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
10597 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
10598 memcpy(payment_id_arr->elems, payment_id.data, 32);
10599 uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 110, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
10600 void* ret_ptr = untag_ptr(ret);
10601 CHECK_ACCESS(ret_ptr);
10602 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
10603 FREE(untag_ptr(ret));
10606 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
10607 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
10608 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
10609 memcpy(payment_id_arr->elems, payment_id.data, 32);
10610 js_invoke_function_uuuuuu(j_calls->instance_ptr, 111, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
10612 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
10613 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
10614 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10616 static inline LDKPayer LDKPayer_init (JSValue o) {
10617 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
10618 atomic_init(&calls->refcnt, 1);
10619 calls->instance_ptr = o;
10622 .this_arg = (void*) calls,
10623 .node_id = node_id_LDKPayer_jcall,
10624 .first_hops = first_hops_LDKPayer_jcall,
10625 .send_payment = send_payment_LDKPayer_jcall,
10626 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
10627 .retry_payment = retry_payment_LDKPayer_jcall,
10628 .abandon_payment = abandon_payment_LDKPayer_jcall,
10629 .free = LDKPayer_JCalls_free,
10633 uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
10634 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
10635 *res_ptr = LDKPayer_init(o);
10636 return tag_ptr(res_ptr, true);
10638 int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
10639 void* this_arg_ptr = untag_ptr(this_arg);
10640 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10641 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10642 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
10643 memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
10647 uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
10648 void* this_arg_ptr = untag_ptr(this_arg);
10649 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10650 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10651 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
10652 uint64_tArray ret_arr = NULL;
10653 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10654 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10655 for (size_t q = 0; q < ret_var.datalen; q++) {
10656 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
10657 uint64_t ret_conv_16_ref = 0;
10658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
10659 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
10660 ret_arr_ptr[q] = ret_conv_16_ref;
10663 FREE(ret_var.data);
10667 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) {
10668 void* this_arg_ptr = untag_ptr(this_arg);
10669 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10670 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10671 LDKRoute route_conv;
10672 route_conv.inner = untag_ptr(route);
10673 route_conv.is_owned = ptr_is_owned(route);
10674 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10675 route_conv.is_owned = false;
10676 LDKThirtyTwoBytes payment_hash_ref;
10677 CHECK(payment_hash->arr_len == 32);
10678 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
10679 LDKThirtyTwoBytes payment_secret_ref;
10680 CHECK(payment_secret->arr_len == 32);
10681 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
10682 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10683 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
10684 return tag_ptr(ret_conv, true);
10687 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) {
10688 void* this_arg_ptr = untag_ptr(this_arg);
10689 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10690 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10691 LDKRoute route_conv;
10692 route_conv.inner = untag_ptr(route);
10693 route_conv.is_owned = ptr_is_owned(route);
10694 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10695 route_conv.is_owned = false;
10696 LDKThirtyTwoBytes payment_preimage_ref;
10697 CHECK(payment_preimage->arr_len == 32);
10698 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
10699 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10700 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
10701 return tag_ptr(ret_conv, true);
10704 uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
10705 void* this_arg_ptr = untag_ptr(this_arg);
10706 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10707 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10708 LDKRoute route_conv;
10709 route_conv.inner = untag_ptr(route);
10710 route_conv.is_owned = ptr_is_owned(route);
10711 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10712 route_conv.is_owned = false;
10713 LDKThirtyTwoBytes payment_id_ref;
10714 CHECK(payment_id->arr_len == 32);
10715 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10716 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
10717 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
10718 return tag_ptr(ret_conv, true);
10721 void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
10722 void* this_arg_ptr = untag_ptr(this_arg);
10723 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10724 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10725 LDKThirtyTwoBytes payment_id_ref;
10726 CHECK(payment_id->arr_len == 32);
10727 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10728 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
10731 typedef struct LDKRouter_JCalls {
10732 atomic_size_t refcnt;
10733 uint32_t instance_ptr;
10734 } LDKRouter_JCalls;
10735 static void LDKRouter_JCalls_free(void* this_arg) {
10736 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10737 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10741 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) {
10742 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10743 int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
10744 memcpy(payer_arr->elems, payer.compressed_form, 33);
10745 LDKRouteParameters route_params_var = *route_params;
10746 uint64_t route_params_ref = 0;
10747 route_params_var = RouteParameters_clone(&route_params_var);
10748 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
10749 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
10750 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10751 memcpy(payment_hash_arr->elems, *payment_hash, 32);
10752 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
10753 uint64_tArray first_hops_arr = NULL;
10754 if (first_hops != NULL) {
10755 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
10756 first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
10757 uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
10758 for (size_t q = 0; q < first_hops_var.datalen; q++) {
10759 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
10760 uint64_t first_hops_conv_16_ref = 0;
10761 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
10762 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
10763 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
10767 LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs;
10768 uint64_t inflight_htlcs_ref = 0;
10769 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
10770 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
10771 uint64_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 112, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, inflight_htlcs_ref, 0);
10772 void* ret_ptr = untag_ptr(ret);
10773 CHECK_ACCESS(ret_ptr);
10774 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
10775 FREE(untag_ptr(ret));
10778 void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
10779 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10780 LDKCVec_RouteHopZ path_var = path;
10781 uint64_tArray path_arr = NULL;
10782 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10783 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10784 for (size_t k = 0; k < path_var.datalen; k++) {
10785 LDKRouteHop path_conv_10_var = path_var.data[k];
10786 uint64_t path_conv_10_ref = 0;
10787 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10788 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10789 path_arr_ptr[k] = path_conv_10_ref;
10792 FREE(path_var.data);
10793 int64_t short_channel_id_conv = short_channel_id;
10794 js_invoke_function_ubuuuu(j_calls->instance_ptr, 113, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
10796 void notify_payment_path_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
10797 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10798 LDKCVec_RouteHopZ path_var = path;
10799 uint64_tArray path_arr = NULL;
10800 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10801 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10802 for (size_t k = 0; k < path_var.datalen; k++) {
10803 LDKRouteHop path_conv_10_var = path_var.data[k];
10804 uint64_t path_conv_10_ref = 0;
10805 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10806 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10807 path_arr_ptr[k] = path_conv_10_ref;
10810 FREE(path_var.data);
10811 js_invoke_function_uuuuuu(j_calls->instance_ptr, 114, (uint32_t)path_arr, 0, 0, 0, 0, 0);
10813 void notify_payment_probe_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
10814 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10815 LDKCVec_RouteHopZ path_var = path;
10816 uint64_tArray path_arr = NULL;
10817 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10818 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10819 for (size_t k = 0; k < path_var.datalen; k++) {
10820 LDKRouteHop path_conv_10_var = path_var.data[k];
10821 uint64_t path_conv_10_ref = 0;
10822 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10823 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10824 path_arr_ptr[k] = path_conv_10_ref;
10827 FREE(path_var.data);
10828 js_invoke_function_uuuuuu(j_calls->instance_ptr, 115, (uint32_t)path_arr, 0, 0, 0, 0, 0);
10830 void notify_payment_probe_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
10831 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10832 LDKCVec_RouteHopZ path_var = path;
10833 uint64_tArray path_arr = NULL;
10834 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
10835 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
10836 for (size_t k = 0; k < path_var.datalen; k++) {
10837 LDKRouteHop path_conv_10_var = path_var.data[k];
10838 uint64_t path_conv_10_ref = 0;
10839 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
10840 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
10841 path_arr_ptr[k] = path_conv_10_ref;
10844 FREE(path_var.data);
10845 int64_t short_channel_id_conv = short_channel_id;
10846 js_invoke_function_ubuuuu(j_calls->instance_ptr, 116, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
10848 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
10849 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
10850 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10852 static inline LDKRouter LDKRouter_init (JSValue o) {
10853 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
10854 atomic_init(&calls->refcnt, 1);
10855 calls->instance_ptr = o;
10858 .this_arg = (void*) calls,
10859 .find_route = find_route_LDKRouter_jcall,
10860 .notify_payment_path_failed = notify_payment_path_failed_LDKRouter_jcall,
10861 .notify_payment_path_successful = notify_payment_path_successful_LDKRouter_jcall,
10862 .notify_payment_probe_successful = notify_payment_probe_successful_LDKRouter_jcall,
10863 .notify_payment_probe_failed = notify_payment_probe_failed_LDKRouter_jcall,
10864 .free = LDKRouter_JCalls_free,
10868 uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
10869 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
10870 *res_ptr = LDKRouter_init(o);
10871 return tag_ptr(res_ptr, true);
10873 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) {
10874 void* this_arg_ptr = untag_ptr(this_arg);
10875 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10876 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10877 LDKPublicKey payer_ref;
10878 CHECK(payer->arr_len == 33);
10879 memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
10880 LDKRouteParameters route_params_conv;
10881 route_params_conv.inner = untag_ptr(route_params);
10882 route_params_conv.is_owned = ptr_is_owned(route_params);
10883 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
10884 route_params_conv.is_owned = false;
10885 unsigned char payment_hash_arr[32];
10886 CHECK(payment_hash->arr_len == 32);
10887 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
10888 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
10889 LDKCVec_ChannelDetailsZ first_hops_constr;
10890 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
10891 if (first_hops != 0) {
10892 first_hops_constr.datalen = first_hops->arr_len;
10893 if (first_hops_constr.datalen > 0)
10894 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
10896 first_hops_constr.data = NULL;
10897 uint64_t* first_hops_vals = first_hops->elems;
10898 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
10899 uint64_t first_hops_conv_16 = first_hops_vals[q];
10900 LDKChannelDetails first_hops_conv_16_conv;
10901 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
10902 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
10903 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
10904 first_hops_conv_16_conv.is_owned = false;
10905 first_hops_constr.data[q] = first_hops_conv_16_conv;
10908 first_hops_ptr = &first_hops_constr;
10910 LDKInFlightHtlcs inflight_htlcs_conv;
10911 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
10912 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
10913 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
10914 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
10916 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
10917 *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);
10918 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
10919 return tag_ptr(ret_conv, true);
10922 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) {
10923 void* this_arg_ptr = untag_ptr(this_arg);
10924 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10925 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10926 LDKCVec_RouteHopZ path_constr;
10927 path_constr.datalen = path->arr_len;
10928 if (path_constr.datalen > 0)
10929 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
10931 path_constr.data = NULL;
10932 uint64_t* path_vals = path->elems;
10933 for (size_t k = 0; k < path_constr.datalen; k++) {
10934 uint64_t path_conv_10 = path_vals[k];
10935 LDKRouteHop path_conv_10_conv;
10936 path_conv_10_conv.inner = untag_ptr(path_conv_10);
10937 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
10938 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
10939 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
10940 path_constr.data[k] = path_conv_10_conv;
10943 (this_arg_conv->notify_payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
10946 void __attribute__((export_name("TS_Router_notify_payment_path_successful"))) TS_Router_notify_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
10947 void* this_arg_ptr = untag_ptr(this_arg);
10948 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10949 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10950 LDKCVec_RouteHopZ path_constr;
10951 path_constr.datalen = path->arr_len;
10952 if (path_constr.datalen > 0)
10953 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
10955 path_constr.data = NULL;
10956 uint64_t* path_vals = path->elems;
10957 for (size_t k = 0; k < path_constr.datalen; k++) {
10958 uint64_t path_conv_10 = path_vals[k];
10959 LDKRouteHop path_conv_10_conv;
10960 path_conv_10_conv.inner = untag_ptr(path_conv_10);
10961 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
10962 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
10963 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
10964 path_constr.data[k] = path_conv_10_conv;
10967 (this_arg_conv->notify_payment_path_successful)(this_arg_conv->this_arg, path_constr);
10970 void __attribute__((export_name("TS_Router_notify_payment_probe_successful"))) TS_Router_notify_payment_probe_successful(uint64_t this_arg, uint64_tArray path) {
10971 void* this_arg_ptr = untag_ptr(this_arg);
10972 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10973 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10974 LDKCVec_RouteHopZ path_constr;
10975 path_constr.datalen = path->arr_len;
10976 if (path_constr.datalen > 0)
10977 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
10979 path_constr.data = NULL;
10980 uint64_t* path_vals = path->elems;
10981 for (size_t k = 0; k < path_constr.datalen; k++) {
10982 uint64_t path_conv_10 = path_vals[k];
10983 LDKRouteHop path_conv_10_conv;
10984 path_conv_10_conv.inner = untag_ptr(path_conv_10);
10985 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
10986 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
10987 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
10988 path_constr.data[k] = path_conv_10_conv;
10991 (this_arg_conv->notify_payment_probe_successful)(this_arg_conv->this_arg, path_constr);
10994 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) {
10995 void* this_arg_ptr = untag_ptr(this_arg);
10996 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10997 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10998 LDKCVec_RouteHopZ path_constr;
10999 path_constr.datalen = path->arr_len;
11000 if (path_constr.datalen > 0)
11001 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11003 path_constr.data = NULL;
11004 uint64_t* path_vals = path->elems;
11005 for (size_t k = 0; k < path_constr.datalen; k++) {
11006 uint64_t path_conv_10 = path_vals[k];
11007 LDKRouteHop path_conv_10_conv;
11008 path_conv_10_conv.inner = untag_ptr(path_conv_10);
11009 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
11010 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
11011 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
11012 path_constr.data[k] = path_conv_10_conv;
11015 (this_arg_conv->notify_payment_probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
11018 uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
11019 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
11021 case LDKRetry_Attempts: return 0;
11025 uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
11026 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
11027 assert(obj->tag == LDKRetry_Attempts);
11028 uint32_t attempts_conv = obj->attempts;
11029 return attempts_conv;
11031 jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
11032 LDKStr ret_str = _ldk_get_compiled_version();
11033 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
11038 jstring __attribute__((export_name("TS__ldk_c_bindings_get_compiled_version"))) TS__ldk_c_bindings_get_compiled_version() {
11039 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
11040 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
11045 uint64_t __attribute__((export_name("TS_BigEndianScalar_new"))) TS_BigEndianScalar_new(int8_tArray big_endian_bytes) {
11046 LDKThirtyTwoBytes big_endian_bytes_ref;
11047 CHECK(big_endian_bytes->arr_len == 32);
11048 memcpy(big_endian_bytes_ref.data, big_endian_bytes->elems, 32); FREE(big_endian_bytes);
11049 LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
11050 *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
11051 return tag_ptr(ret_ref, true);
11054 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
11055 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
11056 *ret_copy = Bech32Error_clone(arg);
11057 uint64_t ret_ref = tag_ptr(ret_copy, true);
11060 int64_t __attribute__((export_name("TS_Bech32Error_clone_ptr"))) TS_Bech32Error_clone_ptr(uint64_t arg) {
11061 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
11062 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
11066 uint64_t __attribute__((export_name("TS_Bech32Error_clone"))) TS_Bech32Error_clone(uint64_t orig) {
11067 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
11068 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
11069 *ret_copy = Bech32Error_clone(orig_conv);
11070 uint64_t ret_ref = tag_ptr(ret_copy, true);
11074 void __attribute__((export_name("TS_Bech32Error_free"))) TS_Bech32Error_free(uint64_t o) {
11075 if (!ptr_is_owned(o)) return;
11076 void* o_ptr = untag_ptr(o);
11077 CHECK_ACCESS(o_ptr);
11078 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
11079 FREE(untag_ptr(o));
11080 Bech32Error_free(o_conv);
11083 void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(int8_tArray _res) {
11084 LDKTransaction _res_ref;
11085 _res_ref.datalen = _res->arr_len;
11086 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
11087 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
11088 _res_ref.data_is_owned = true;
11089 Transaction_free(_res_ref);
11092 uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
11093 LDKCVec_u8Z script_pubkey_ref;
11094 script_pubkey_ref.datalen = script_pubkey->arr_len;
11095 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
11096 memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey);
11097 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11098 *ret_ref = TxOut_new(script_pubkey_ref, value);
11099 return tag_ptr(ret_ref, true);
11102 void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint64_t _res) {
11103 if (!ptr_is_owned(_res)) return;
11104 void* _res_ptr = untag_ptr(_res);
11105 CHECK_ACCESS(_res_ptr);
11106 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
11107 FREE(untag_ptr(_res));
11108 TxOut_free(_res_conv);
11111 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
11112 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11113 *ret_ref = TxOut_clone(arg);
11114 return tag_ptr(ret_ref, true);
11116 int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint64_t arg) {
11117 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
11118 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
11122 uint64_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint64_t orig) {
11123 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
11124 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
11125 *ret_ref = TxOut_clone(orig_conv);
11126 return tag_ptr(ret_ref, true);
11129 void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) {
11130 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
11134 void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
11135 LDKCVec_PublicKeyZ _res_constr;
11136 _res_constr.datalen = _res->arr_len;
11137 if (_res_constr.datalen > 0)
11138 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
11140 _res_constr.data = NULL;
11141 int8_tArray* _res_vals = (void*) _res->elems;
11142 for (size_t m = 0; m < _res_constr.datalen; m++) {
11143 int8_tArray _res_conv_12 = _res_vals[m];
11144 LDKPublicKey _res_conv_12_ref;
11145 CHECK(_res_conv_12->arr_len == 33);
11146 memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
11147 _res_constr.data[m] = _res_conv_12_ref;
11150 CVec_PublicKeyZ_free(_res_constr);
11153 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_ok"))) TS_CResult_BlindedRouteNoneZ_ok(uint64_t o) {
11154 LDKBlindedRoute o_conv;
11155 o_conv.inner = untag_ptr(o);
11156 o_conv.is_owned = ptr_is_owned(o);
11157 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11158 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
11160 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
11161 *ret_conv = CResult_BlindedRouteNoneZ_ok(o_conv);
11162 return tag_ptr(ret_conv, true);
11165 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_err"))) TS_CResult_BlindedRouteNoneZ_err() {
11166 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
11167 *ret_conv = CResult_BlindedRouteNoneZ_err();
11168 return tag_ptr(ret_conv, true);
11171 jboolean __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_is_ok"))) TS_CResult_BlindedRouteNoneZ_is_ok(uint64_t o) {
11172 LDKCResult_BlindedRouteNoneZ* o_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(o);
11173 jboolean ret_conv = CResult_BlindedRouteNoneZ_is_ok(o_conv);
11177 void __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_free"))) TS_CResult_BlindedRouteNoneZ_free(uint64_t _res) {
11178 if (!ptr_is_owned(_res)) return;
11179 void* _res_ptr = untag_ptr(_res);
11180 CHECK_ACCESS(_res_ptr);
11181 LDKCResult_BlindedRouteNoneZ _res_conv = *(LDKCResult_BlindedRouteNoneZ*)(_res_ptr);
11182 FREE(untag_ptr(_res));
11183 CResult_BlindedRouteNoneZ_free(_res_conv);
11186 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_ok(uint64_t o) {
11187 LDKBlindedRoute o_conv;
11188 o_conv.inner = untag_ptr(o);
11189 o_conv.is_owned = ptr_is_owned(o);
11190 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11191 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
11193 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
11194 *ret_conv = CResult_BlindedRouteDecodeErrorZ_ok(o_conv);
11195 return tag_ptr(ret_conv, true);
11198 uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_err"))) TS_CResult_BlindedRouteDecodeErrorZ_err(uint64_t e) {
11199 LDKDecodeError e_conv;
11200 e_conv.inner = untag_ptr(e);
11201 e_conv.is_owned = ptr_is_owned(e);
11202 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11203 e_conv = DecodeError_clone(&e_conv);
11204 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
11205 *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv);
11206 return tag_ptr(ret_conv, true);
11209 jboolean __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_is_ok"))) TS_CResult_BlindedRouteDecodeErrorZ_is_ok(uint64_t o) {
11210 LDKCResult_BlindedRouteDecodeErrorZ* o_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(o);
11211 jboolean ret_conv = CResult_BlindedRouteDecodeErrorZ_is_ok(o_conv);
11215 void __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_free"))) TS_CResult_BlindedRouteDecodeErrorZ_free(uint64_t _res) {
11216 if (!ptr_is_owned(_res)) return;
11217 void* _res_ptr = untag_ptr(_res);
11218 CHECK_ACCESS(_res_ptr);
11219 LDKCResult_BlindedRouteDecodeErrorZ _res_conv = *(LDKCResult_BlindedRouteDecodeErrorZ*)(_res_ptr);
11220 FREE(untag_ptr(_res));
11221 CResult_BlindedRouteDecodeErrorZ_free(_res_conv);
11224 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_ok"))) TS_CResult_BlindedHopDecodeErrorZ_ok(uint64_t o) {
11225 LDKBlindedHop o_conv;
11226 o_conv.inner = untag_ptr(o);
11227 o_conv.is_owned = ptr_is_owned(o);
11228 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11229 // WARNING: we need a move here but no clone is available for LDKBlindedHop
11231 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
11232 *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
11233 return tag_ptr(ret_conv, true);
11236 uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_err"))) TS_CResult_BlindedHopDecodeErrorZ_err(uint64_t e) {
11237 LDKDecodeError e_conv;
11238 e_conv.inner = untag_ptr(e);
11239 e_conv.is_owned = ptr_is_owned(e);
11240 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11241 e_conv = DecodeError_clone(&e_conv);
11242 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
11243 *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
11244 return tag_ptr(ret_conv, true);
11247 jboolean __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_is_ok"))) TS_CResult_BlindedHopDecodeErrorZ_is_ok(uint64_t o) {
11248 LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
11249 jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
11253 void __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_free"))) TS_CResult_BlindedHopDecodeErrorZ_free(uint64_t _res) {
11254 if (!ptr_is_owned(_res)) return;
11255 void* _res_ptr = untag_ptr(_res);
11256 CHECK_ACCESS(_res_ptr);
11257 LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
11258 FREE(untag_ptr(_res));
11259 CResult_BlindedHopDecodeErrorZ_free(_res_conv);
11262 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
11263 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11264 *ret_conv = CResult_NoneNoneZ_ok();
11265 return tag_ptr(ret_conv, true);
11268 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() {
11269 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11270 *ret_conv = CResult_NoneNoneZ_err();
11271 return tag_ptr(ret_conv, true);
11274 jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint64_t o) {
11275 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
11276 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
11280 void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint64_t _res) {
11281 if (!ptr_is_owned(_res)) return;
11282 void* _res_ptr = untag_ptr(_res);
11283 CHECK_ACCESS(_res_ptr);
11284 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
11285 FREE(untag_ptr(_res));
11286 CResult_NoneNoneZ_free(_res_conv);
11289 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
11290 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11291 *ret_conv = CResult_NoneNoneZ_clone(arg);
11292 return tag_ptr(ret_conv, true);
11294 int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint64_t arg) {
11295 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
11296 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
11300 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_NoneNoneZ_clone(uint64_t orig) {
11301 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
11302 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
11303 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
11304 return tag_ptr(ret_conv, true);
11307 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) {
11308 LDKCounterpartyCommitmentSecrets o_conv;
11309 o_conv.inner = untag_ptr(o);
11310 o_conv.is_owned = ptr_is_owned(o);
11311 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11312 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
11313 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11314 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
11315 return tag_ptr(ret_conv, true);
11318 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
11319 LDKDecodeError e_conv;
11320 e_conv.inner = untag_ptr(e);
11321 e_conv.is_owned = ptr_is_owned(e);
11322 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11323 e_conv = DecodeError_clone(&e_conv);
11324 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11325 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
11326 return tag_ptr(ret_conv, true);
11329 jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) {
11330 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
11331 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
11335 void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) {
11336 if (!ptr_is_owned(_res)) return;
11337 void* _res_ptr = untag_ptr(_res);
11338 CHECK_ACCESS(_res_ptr);
11339 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
11340 FREE(untag_ptr(_res));
11341 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
11344 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
11345 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11346 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
11347 return tag_ptr(ret_conv, true);
11349 int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) {
11350 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
11351 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
11355 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) {
11356 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
11357 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
11358 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
11359 return tag_ptr(ret_conv, true);
11362 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
11363 LDKSecretKey o_ref;
11364 CHECK(o->arr_len == 32);
11365 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
11366 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11367 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
11368 return tag_ptr(ret_conv, true);
11371 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
11372 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11373 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11374 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
11375 return tag_ptr(ret_conv, true);
11378 jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
11379 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
11380 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
11384 void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
11385 if (!ptr_is_owned(_res)) return;
11386 void* _res_ptr = untag_ptr(_res);
11387 CHECK_ACCESS(_res_ptr);
11388 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
11389 FREE(untag_ptr(_res));
11390 CResult_SecretKeyErrorZ_free(_res_conv);
11393 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
11394 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11395 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
11396 return tag_ptr(ret_conv, true);
11398 int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
11399 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
11400 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
11404 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
11405 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
11406 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
11407 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
11408 return tag_ptr(ret_conv, true);
11411 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
11412 LDKPublicKey o_ref;
11413 CHECK(o->arr_len == 33);
11414 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
11415 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11416 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
11417 return tag_ptr(ret_conv, true);
11420 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
11421 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11422 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11423 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
11424 return tag_ptr(ret_conv, true);
11427 jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
11428 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
11429 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
11433 void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
11434 if (!ptr_is_owned(_res)) return;
11435 void* _res_ptr = untag_ptr(_res);
11436 CHECK_ACCESS(_res_ptr);
11437 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
11438 FREE(untag_ptr(_res));
11439 CResult_PublicKeyErrorZ_free(_res_conv);
11442 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
11443 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11444 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
11445 return tag_ptr(ret_conv, true);
11447 int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
11448 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
11449 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
11453 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
11454 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
11455 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
11456 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
11457 return tag_ptr(ret_conv, true);
11460 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
11461 LDKTxCreationKeys o_conv;
11462 o_conv.inner = untag_ptr(o);
11463 o_conv.is_owned = ptr_is_owned(o);
11464 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11465 o_conv = TxCreationKeys_clone(&o_conv);
11466 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11467 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
11468 return tag_ptr(ret_conv, true);
11471 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
11472 LDKDecodeError e_conv;
11473 e_conv.inner = untag_ptr(e);
11474 e_conv.is_owned = ptr_is_owned(e);
11475 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11476 e_conv = DecodeError_clone(&e_conv);
11477 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11478 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
11479 return tag_ptr(ret_conv, true);
11482 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
11483 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
11484 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
11488 void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
11489 if (!ptr_is_owned(_res)) return;
11490 void* _res_ptr = untag_ptr(_res);
11491 CHECK_ACCESS(_res_ptr);
11492 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
11493 FREE(untag_ptr(_res));
11494 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
11497 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
11498 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11499 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
11500 return tag_ptr(ret_conv, true);
11502 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
11503 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
11504 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
11508 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
11509 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
11510 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
11511 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
11512 return tag_ptr(ret_conv, true);
11515 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
11516 LDKChannelPublicKeys o_conv;
11517 o_conv.inner = untag_ptr(o);
11518 o_conv.is_owned = ptr_is_owned(o);
11519 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11520 o_conv = ChannelPublicKeys_clone(&o_conv);
11521 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11522 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
11523 return tag_ptr(ret_conv, true);
11526 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
11527 LDKDecodeError e_conv;
11528 e_conv.inner = untag_ptr(e);
11529 e_conv.is_owned = ptr_is_owned(e);
11530 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11531 e_conv = DecodeError_clone(&e_conv);
11532 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11533 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
11534 return tag_ptr(ret_conv, true);
11537 jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) {
11538 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
11539 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
11543 void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) {
11544 if (!ptr_is_owned(_res)) return;
11545 void* _res_ptr = untag_ptr(_res);
11546 CHECK_ACCESS(_res_ptr);
11547 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
11548 FREE(untag_ptr(_res));
11549 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
11552 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
11553 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11554 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
11555 return tag_ptr(ret_conv, true);
11557 int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
11558 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
11559 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
11563 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) {
11564 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
11565 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
11566 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
11567 return tag_ptr(ret_conv, true);
11570 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
11571 LDKTxCreationKeys o_conv;
11572 o_conv.inner = untag_ptr(o);
11573 o_conv.is_owned = ptr_is_owned(o);
11574 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11575 o_conv = TxCreationKeys_clone(&o_conv);
11576 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11577 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
11578 return tag_ptr(ret_conv, true);
11581 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
11582 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
11583 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11584 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
11585 return tag_ptr(ret_conv, true);
11588 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
11589 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
11590 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
11594 void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
11595 if (!ptr_is_owned(_res)) return;
11596 void* _res_ptr = untag_ptr(_res);
11597 CHECK_ACCESS(_res_ptr);
11598 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
11599 FREE(untag_ptr(_res));
11600 CResult_TxCreationKeysErrorZ_free(_res_conv);
11603 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
11604 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11605 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
11606 return tag_ptr(ret_conv, true);
11608 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
11609 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
11610 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
11614 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
11615 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
11616 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
11617 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
11618 return tag_ptr(ret_conv, true);
11621 uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
11622 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11623 *ret_copy = COption_u32Z_some(o);
11624 uint64_t ret_ref = tag_ptr(ret_copy, true);
11628 uint64_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() {
11629 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11630 *ret_copy = COption_u32Z_none();
11631 uint64_t ret_ref = tag_ptr(ret_copy, true);
11635 void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint64_t _res) {
11636 if (!ptr_is_owned(_res)) return;
11637 void* _res_ptr = untag_ptr(_res);
11638 CHECK_ACCESS(_res_ptr);
11639 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
11640 FREE(untag_ptr(_res));
11641 COption_u32Z_free(_res_conv);
11644 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
11645 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11646 *ret_copy = COption_u32Z_clone(arg);
11647 uint64_t ret_ref = tag_ptr(ret_copy, true);
11650 int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint64_t arg) {
11651 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
11652 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
11656 uint64_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_clone(uint64_t orig) {
11657 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
11658 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
11659 *ret_copy = COption_u32Z_clone(orig_conv);
11660 uint64_t ret_ref = tag_ptr(ret_copy, true);
11664 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) {
11665 LDKHTLCOutputInCommitment o_conv;
11666 o_conv.inner = untag_ptr(o);
11667 o_conv.is_owned = ptr_is_owned(o);
11668 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11669 o_conv = HTLCOutputInCommitment_clone(&o_conv);
11670 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11671 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
11672 return tag_ptr(ret_conv, true);
11675 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
11676 LDKDecodeError e_conv;
11677 e_conv.inner = untag_ptr(e);
11678 e_conv.is_owned = ptr_is_owned(e);
11679 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11680 e_conv = DecodeError_clone(&e_conv);
11681 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11682 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
11683 return tag_ptr(ret_conv, true);
11686 jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) {
11687 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
11688 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
11692 void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) {
11693 if (!ptr_is_owned(_res)) return;
11694 void* _res_ptr = untag_ptr(_res);
11695 CHECK_ACCESS(_res_ptr);
11696 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
11697 FREE(untag_ptr(_res));
11698 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
11701 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
11702 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11703 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
11704 return tag_ptr(ret_conv, true);
11706 int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) {
11707 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
11708 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
11712 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) {
11713 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
11714 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
11715 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
11716 return tag_ptr(ret_conv, true);
11719 uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() {
11720 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
11724 uint32_t __attribute__((export_name("TS_COption_NoneZ_none"))) TS_COption_NoneZ_none() {
11725 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
11729 void __attribute__((export_name("TS_COption_NoneZ_free"))) TS_COption_NoneZ_free(uint32_t _res) {
11730 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
11731 COption_NoneZ_free(_res_conv);
11734 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
11735 LDKCounterpartyChannelTransactionParameters o_conv;
11736 o_conv.inner = untag_ptr(o);
11737 o_conv.is_owned = ptr_is_owned(o);
11738 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11739 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
11740 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11741 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
11742 return tag_ptr(ret_conv, true);
11745 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
11746 LDKDecodeError e_conv;
11747 e_conv.inner = untag_ptr(e);
11748 e_conv.is_owned = ptr_is_owned(e);
11749 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11750 e_conv = DecodeError_clone(&e_conv);
11751 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11752 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
11753 return tag_ptr(ret_conv, true);
11756 jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
11757 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
11758 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
11762 void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
11763 if (!ptr_is_owned(_res)) return;
11764 void* _res_ptr = untag_ptr(_res);
11765 CHECK_ACCESS(_res_ptr);
11766 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
11767 FREE(untag_ptr(_res));
11768 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
11771 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
11772 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11773 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
11774 return tag_ptr(ret_conv, true);
11776 int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11777 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
11778 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
11782 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
11783 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
11784 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
11785 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
11786 return tag_ptr(ret_conv, true);
11789 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
11790 LDKChannelTransactionParameters o_conv;
11791 o_conv.inner = untag_ptr(o);
11792 o_conv.is_owned = ptr_is_owned(o);
11793 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11794 o_conv = ChannelTransactionParameters_clone(&o_conv);
11795 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11796 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
11797 return tag_ptr(ret_conv, true);
11800 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
11801 LDKDecodeError e_conv;
11802 e_conv.inner = untag_ptr(e);
11803 e_conv.is_owned = ptr_is_owned(e);
11804 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11805 e_conv = DecodeError_clone(&e_conv);
11806 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11807 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
11808 return tag_ptr(ret_conv, true);
11811 jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
11812 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
11813 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
11817 void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
11818 if (!ptr_is_owned(_res)) return;
11819 void* _res_ptr = untag_ptr(_res);
11820 CHECK_ACCESS(_res_ptr);
11821 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
11822 FREE(untag_ptr(_res));
11823 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
11826 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
11827 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11828 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
11829 return tag_ptr(ret_conv, true);
11831 int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11832 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
11833 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
11837 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
11838 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
11839 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
11840 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
11841 return tag_ptr(ret_conv, true);
11844 void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) {
11845 LDKCVec_SignatureZ _res_constr;
11846 _res_constr.datalen = _res->arr_len;
11847 if (_res_constr.datalen > 0)
11848 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
11850 _res_constr.data = NULL;
11851 int8_tArray* _res_vals = (void*) _res->elems;
11852 for (size_t m = 0; m < _res_constr.datalen; m++) {
11853 int8_tArray _res_conv_12 = _res_vals[m];
11854 LDKSignature _res_conv_12_ref;
11855 CHECK(_res_conv_12->arr_len == 64);
11856 memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
11857 _res_constr.data[m] = _res_conv_12_ref;
11860 CVec_SignatureZ_free(_res_constr);
11863 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
11864 LDKHolderCommitmentTransaction o_conv;
11865 o_conv.inner = untag_ptr(o);
11866 o_conv.is_owned = ptr_is_owned(o);
11867 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11868 o_conv = HolderCommitmentTransaction_clone(&o_conv);
11869 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11870 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
11871 return tag_ptr(ret_conv, true);
11874 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
11875 LDKDecodeError e_conv;
11876 e_conv.inner = untag_ptr(e);
11877 e_conv.is_owned = ptr_is_owned(e);
11878 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11879 e_conv = DecodeError_clone(&e_conv);
11880 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11881 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
11882 return tag_ptr(ret_conv, true);
11885 jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
11886 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
11887 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
11891 void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
11892 if (!ptr_is_owned(_res)) return;
11893 void* _res_ptr = untag_ptr(_res);
11894 CHECK_ACCESS(_res_ptr);
11895 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
11896 FREE(untag_ptr(_res));
11897 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
11900 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
11901 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11902 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
11903 return tag_ptr(ret_conv, true);
11905 int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
11906 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
11907 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11911 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11912 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11913 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
11914 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
11915 return tag_ptr(ret_conv, true);
11918 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
11919 LDKBuiltCommitmentTransaction o_conv;
11920 o_conv.inner = untag_ptr(o);
11921 o_conv.is_owned = ptr_is_owned(o);
11922 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11923 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
11924 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11925 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
11926 return tag_ptr(ret_conv, true);
11929 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
11930 LDKDecodeError e_conv;
11931 e_conv.inner = untag_ptr(e);
11932 e_conv.is_owned = ptr_is_owned(e);
11933 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11934 e_conv = DecodeError_clone(&e_conv);
11935 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11936 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
11937 return tag_ptr(ret_conv, true);
11940 jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
11941 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
11942 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
11946 void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
11947 if (!ptr_is_owned(_res)) return;
11948 void* _res_ptr = untag_ptr(_res);
11949 CHECK_ACCESS(_res_ptr);
11950 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
11951 FREE(untag_ptr(_res));
11952 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
11955 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
11956 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11957 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
11958 return tag_ptr(ret_conv, true);
11960 int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
11961 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
11962 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11966 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11967 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11968 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11969 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
11970 return tag_ptr(ret_conv, true);
11973 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) {
11974 LDKTrustedClosingTransaction o_conv;
11975 o_conv.inner = untag_ptr(o);
11976 o_conv.is_owned = ptr_is_owned(o);
11977 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11978 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
11980 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11981 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
11982 return tag_ptr(ret_conv, true);
11985 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() {
11986 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11987 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
11988 return tag_ptr(ret_conv, true);
11991 jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) {
11992 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
11993 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
11997 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) {
11998 if (!ptr_is_owned(_res)) return;
11999 void* _res_ptr = untag_ptr(_res);
12000 CHECK_ACCESS(_res_ptr);
12001 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
12002 FREE(untag_ptr(_res));
12003 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
12006 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
12007 LDKCommitmentTransaction o_conv;
12008 o_conv.inner = untag_ptr(o);
12009 o_conv.is_owned = ptr_is_owned(o);
12010 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12011 o_conv = CommitmentTransaction_clone(&o_conv);
12012 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12013 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
12014 return tag_ptr(ret_conv, true);
12017 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
12018 LDKDecodeError e_conv;
12019 e_conv.inner = untag_ptr(e);
12020 e_conv.is_owned = ptr_is_owned(e);
12021 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12022 e_conv = DecodeError_clone(&e_conv);
12023 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12024 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
12025 return tag_ptr(ret_conv, true);
12028 jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
12029 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
12030 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
12034 void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
12035 if (!ptr_is_owned(_res)) return;
12036 void* _res_ptr = untag_ptr(_res);
12037 CHECK_ACCESS(_res_ptr);
12038 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
12039 FREE(untag_ptr(_res));
12040 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
12043 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
12044 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12045 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
12046 return tag_ptr(ret_conv, true);
12048 int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
12049 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
12050 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
12054 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
12055 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
12056 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
12057 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
12058 return tag_ptr(ret_conv, true);
12061 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) {
12062 LDKTrustedCommitmentTransaction o_conv;
12063 o_conv.inner = untag_ptr(o);
12064 o_conv.is_owned = ptr_is_owned(o);
12065 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12066 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
12068 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
12069 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
12070 return tag_ptr(ret_conv, true);
12073 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() {
12074 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
12075 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
12076 return tag_ptr(ret_conv, true);
12079 jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) {
12080 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
12081 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
12085 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) {
12086 if (!ptr_is_owned(_res)) return;
12087 void* _res_ptr = untag_ptr(_res);
12088 CHECK_ACCESS(_res_ptr);
12089 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
12090 FREE(untag_ptr(_res));
12091 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
12094 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_CResult_CVec_SignatureZNoneZ_ok(ptrArray o) {
12095 LDKCVec_SignatureZ o_constr;
12096 o_constr.datalen = o->arr_len;
12097 if (o_constr.datalen > 0)
12098 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
12100 o_constr.data = NULL;
12101 int8_tArray* o_vals = (void*) o->elems;
12102 for (size_t m = 0; m < o_constr.datalen; m++) {
12103 int8_tArray o_conv_12 = o_vals[m];
12104 LDKSignature o_conv_12_ref;
12105 CHECK(o_conv_12->arr_len == 64);
12106 memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
12107 o_constr.data[m] = o_conv_12_ref;
12110 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12111 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
12112 return tag_ptr(ret_conv, true);
12115 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() {
12116 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12117 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
12118 return tag_ptr(ret_conv, true);
12121 jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint64_t o) {
12122 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
12123 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
12127 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint64_t _res) {
12128 if (!ptr_is_owned(_res)) return;
12129 void* _res_ptr = untag_ptr(_res);
12130 CHECK_ACCESS(_res_ptr);
12131 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
12132 FREE(untag_ptr(_res));
12133 CResult_CVec_SignatureZNoneZ_free(_res_conv);
12136 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
12137 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12138 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
12139 return tag_ptr(ret_conv, true);
12141 int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint64_t arg) {
12142 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
12143 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
12147 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint64_t orig) {
12148 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
12149 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
12150 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
12151 return tag_ptr(ret_conv, true);
12154 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) {
12155 LDKShutdownScript o_conv;
12156 o_conv.inner = untag_ptr(o);
12157 o_conv.is_owned = ptr_is_owned(o);
12158 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12159 o_conv = ShutdownScript_clone(&o_conv);
12160 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12161 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
12162 return tag_ptr(ret_conv, true);
12165 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
12166 LDKDecodeError e_conv;
12167 e_conv.inner = untag_ptr(e);
12168 e_conv.is_owned = ptr_is_owned(e);
12169 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12170 e_conv = DecodeError_clone(&e_conv);
12171 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12172 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
12173 return tag_ptr(ret_conv, true);
12176 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) {
12177 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
12178 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
12182 void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) {
12183 if (!ptr_is_owned(_res)) return;
12184 void* _res_ptr = untag_ptr(_res);
12185 CHECK_ACCESS(_res_ptr);
12186 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
12187 FREE(untag_ptr(_res));
12188 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
12191 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
12192 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12193 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
12194 return tag_ptr(ret_conv, true);
12196 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) {
12197 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
12198 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
12202 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) {
12203 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
12204 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
12205 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
12206 return tag_ptr(ret_conv, true);
12209 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) {
12210 LDKShutdownScript o_conv;
12211 o_conv.inner = untag_ptr(o);
12212 o_conv.is_owned = ptr_is_owned(o);
12213 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12214 o_conv = ShutdownScript_clone(&o_conv);
12215 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12216 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
12217 return tag_ptr(ret_conv, true);
12220 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) {
12221 LDKInvalidShutdownScript e_conv;
12222 e_conv.inner = untag_ptr(e);
12223 e_conv.is_owned = ptr_is_owned(e);
12224 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12225 e_conv = InvalidShutdownScript_clone(&e_conv);
12226 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12227 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
12228 return tag_ptr(ret_conv, true);
12231 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) {
12232 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
12233 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
12237 void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) {
12238 if (!ptr_is_owned(_res)) return;
12239 void* _res_ptr = untag_ptr(_res);
12240 CHECK_ACCESS(_res_ptr);
12241 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
12242 FREE(untag_ptr(_res));
12243 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
12246 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
12247 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12248 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
12249 return tag_ptr(ret_conv, true);
12251 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) {
12252 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
12253 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
12257 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) {
12258 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
12259 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
12260 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
12261 return tag_ptr(ret_conv, true);
12264 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
12265 LDKRouteHop o_conv;
12266 o_conv.inner = untag_ptr(o);
12267 o_conv.is_owned = ptr_is_owned(o);
12268 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12269 o_conv = RouteHop_clone(&o_conv);
12270 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12271 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
12272 return tag_ptr(ret_conv, true);
12275 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
12276 LDKDecodeError e_conv;
12277 e_conv.inner = untag_ptr(e);
12278 e_conv.is_owned = ptr_is_owned(e);
12279 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12280 e_conv = DecodeError_clone(&e_conv);
12281 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12282 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
12283 return tag_ptr(ret_conv, true);
12286 jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
12287 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
12288 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
12292 void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
12293 if (!ptr_is_owned(_res)) return;
12294 void* _res_ptr = untag_ptr(_res);
12295 CHECK_ACCESS(_res_ptr);
12296 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
12297 FREE(untag_ptr(_res));
12298 CResult_RouteHopDecodeErrorZ_free(_res_conv);
12301 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
12302 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12303 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
12304 return tag_ptr(ret_conv, true);
12306 int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
12307 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
12308 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
12312 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
12313 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
12314 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
12315 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
12316 return tag_ptr(ret_conv, true);
12319 void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) {
12320 LDKCVec_RouteHopZ _res_constr;
12321 _res_constr.datalen = _res->arr_len;
12322 if (_res_constr.datalen > 0)
12323 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
12325 _res_constr.data = NULL;
12326 uint64_t* _res_vals = _res->elems;
12327 for (size_t k = 0; k < _res_constr.datalen; k++) {
12328 uint64_t _res_conv_10 = _res_vals[k];
12329 LDKRouteHop _res_conv_10_conv;
12330 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
12331 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
12332 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
12333 _res_constr.data[k] = _res_conv_10_conv;
12336 CVec_RouteHopZ_free(_res_constr);
12339 void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
12340 LDKCVec_CVec_RouteHopZZ _res_constr;
12341 _res_constr.datalen = _res->arr_len;
12342 if (_res_constr.datalen > 0)
12343 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
12345 _res_constr.data = NULL;
12346 uint64_tArray* _res_vals = (void*) _res->elems;
12347 for (size_t m = 0; m < _res_constr.datalen; m++) {
12348 uint64_tArray _res_conv_12 = _res_vals[m];
12349 LDKCVec_RouteHopZ _res_conv_12_constr;
12350 _res_conv_12_constr.datalen = _res_conv_12->arr_len;
12351 if (_res_conv_12_constr.datalen > 0)
12352 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
12354 _res_conv_12_constr.data = NULL;
12355 uint64_t* _res_conv_12_vals = _res_conv_12->elems;
12356 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
12357 uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
12358 LDKRouteHop _res_conv_12_conv_10_conv;
12359 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
12360 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
12361 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
12362 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
12364 FREE(_res_conv_12);
12365 _res_constr.data[m] = _res_conv_12_constr;
12368 CVec_CVec_RouteHopZZ_free(_res_constr);
12371 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) {
12373 o_conv.inner = untag_ptr(o);
12374 o_conv.is_owned = ptr_is_owned(o);
12375 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12376 o_conv = Route_clone(&o_conv);
12377 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12378 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
12379 return tag_ptr(ret_conv, true);
12382 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
12383 LDKDecodeError e_conv;
12384 e_conv.inner = untag_ptr(e);
12385 e_conv.is_owned = ptr_is_owned(e);
12386 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12387 e_conv = DecodeError_clone(&e_conv);
12388 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12389 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
12390 return tag_ptr(ret_conv, true);
12393 jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint64_t o) {
12394 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
12395 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
12399 void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint64_t _res) {
12400 if (!ptr_is_owned(_res)) return;
12401 void* _res_ptr = untag_ptr(_res);
12402 CHECK_ACCESS(_res_ptr);
12403 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
12404 FREE(untag_ptr(_res));
12405 CResult_RouteDecodeErrorZ_free(_res_conv);
12408 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
12409 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12410 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
12411 return tag_ptr(ret_conv, true);
12413 int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint64_t arg) {
12414 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
12415 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
12419 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_CResult_RouteDecodeErrorZ_clone(uint64_t orig) {
12420 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
12421 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
12422 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
12423 return tag_ptr(ret_conv, true);
12426 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint64_t o) {
12427 LDKRouteParameters o_conv;
12428 o_conv.inner = untag_ptr(o);
12429 o_conv.is_owned = ptr_is_owned(o);
12430 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12431 o_conv = RouteParameters_clone(&o_conv);
12432 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12433 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
12434 return tag_ptr(ret_conv, true);
12437 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
12438 LDKDecodeError e_conv;
12439 e_conv.inner = untag_ptr(e);
12440 e_conv.is_owned = ptr_is_owned(e);
12441 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12442 e_conv = DecodeError_clone(&e_conv);
12443 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12444 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
12445 return tag_ptr(ret_conv, true);
12448 jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint64_t o) {
12449 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
12450 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
12454 void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint64_t _res) {
12455 if (!ptr_is_owned(_res)) return;
12456 void* _res_ptr = untag_ptr(_res);
12457 CHECK_ACCESS(_res_ptr);
12458 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
12459 FREE(untag_ptr(_res));
12460 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
12463 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
12464 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12465 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
12466 return tag_ptr(ret_conv, true);
12468 int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
12469 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
12470 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
12474 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint64_t orig) {
12475 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
12476 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
12477 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
12478 return tag_ptr(ret_conv, true);
12481 void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) {
12482 LDKCVec_RouteHintZ _res_constr;
12483 _res_constr.datalen = _res->arr_len;
12484 if (_res_constr.datalen > 0)
12485 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
12487 _res_constr.data = NULL;
12488 uint64_t* _res_vals = _res->elems;
12489 for (size_t l = 0; l < _res_constr.datalen; l++) {
12490 uint64_t _res_conv_11 = _res_vals[l];
12491 LDKRouteHint _res_conv_11_conv;
12492 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
12493 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
12494 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
12495 _res_constr.data[l] = _res_conv_11_conv;
12498 CVec_RouteHintZ_free(_res_constr);
12501 uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
12502 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12503 *ret_copy = COption_u64Z_some(o);
12504 uint64_t ret_ref = tag_ptr(ret_copy, true);
12508 uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
12509 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12510 *ret_copy = COption_u64Z_none();
12511 uint64_t ret_ref = tag_ptr(ret_copy, true);
12515 void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
12516 if (!ptr_is_owned(_res)) return;
12517 void* _res_ptr = untag_ptr(_res);
12518 CHECK_ACCESS(_res_ptr);
12519 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
12520 FREE(untag_ptr(_res));
12521 COption_u64Z_free(_res_conv);
12524 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
12525 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12526 *ret_copy = COption_u64Z_clone(arg);
12527 uint64_t ret_ref = tag_ptr(ret_copy, true);
12530 int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
12531 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
12532 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
12536 uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
12537 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
12538 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
12539 *ret_copy = COption_u64Z_clone(orig_conv);
12540 uint64_t ret_ref = tag_ptr(ret_copy, true);
12544 void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
12545 LDKCVec_u64Z _res_constr;
12546 _res_constr.datalen = _res->arr_len;
12547 if (_res_constr.datalen > 0)
12548 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
12550 _res_constr.data = NULL;
12551 int64_t* _res_vals = _res->elems;
12552 for (size_t i = 0; i < _res_constr.datalen; i++) {
12553 int64_t _res_conv_8 = _res_vals[i];
12554 _res_constr.data[i] = _res_conv_8;
12557 CVec_u64Z_free(_res_constr);
12560 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_ok(uint64_t o) {
12561 LDKPaymentParameters o_conv;
12562 o_conv.inner = untag_ptr(o);
12563 o_conv.is_owned = ptr_is_owned(o);
12564 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12565 o_conv = PaymentParameters_clone(&o_conv);
12566 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12567 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
12568 return tag_ptr(ret_conv, true);
12571 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
12572 LDKDecodeError e_conv;
12573 e_conv.inner = untag_ptr(e);
12574 e_conv.is_owned = ptr_is_owned(e);
12575 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12576 e_conv = DecodeError_clone(&e_conv);
12577 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12578 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
12579 return tag_ptr(ret_conv, true);
12582 jboolean __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_is_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_is_ok(uint64_t o) {
12583 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
12584 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
12588 void __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_free"))) TS_CResult_PaymentParametersDecodeErrorZ_free(uint64_t _res) {
12589 if (!ptr_is_owned(_res)) return;
12590 void* _res_ptr = untag_ptr(_res);
12591 CHECK_ACCESS(_res_ptr);
12592 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
12593 FREE(untag_ptr(_res));
12594 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
12597 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
12598 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12599 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
12600 return tag_ptr(ret_conv, true);
12602 int64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
12603 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
12604 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
12608 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone"))) TS_CResult_PaymentParametersDecodeErrorZ_clone(uint64_t orig) {
12609 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
12610 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
12611 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
12612 return tag_ptr(ret_conv, true);
12615 void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) {
12616 LDKCVec_RouteHintHopZ _res_constr;
12617 _res_constr.datalen = _res->arr_len;
12618 if (_res_constr.datalen > 0)
12619 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
12621 _res_constr.data = NULL;
12622 uint64_t* _res_vals = _res->elems;
12623 for (size_t o = 0; o < _res_constr.datalen; o++) {
12624 uint64_t _res_conv_14 = _res_vals[o];
12625 LDKRouteHintHop _res_conv_14_conv;
12626 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
12627 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
12628 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
12629 _res_constr.data[o] = _res_conv_14_conv;
12632 CVec_RouteHintHopZ_free(_res_constr);
12635 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint64_t o) {
12636 LDKRouteHint o_conv;
12637 o_conv.inner = untag_ptr(o);
12638 o_conv.is_owned = ptr_is_owned(o);
12639 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12640 o_conv = RouteHint_clone(&o_conv);
12641 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12642 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
12643 return tag_ptr(ret_conv, true);
12646 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
12647 LDKDecodeError e_conv;
12648 e_conv.inner = untag_ptr(e);
12649 e_conv.is_owned = ptr_is_owned(e);
12650 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12651 e_conv = DecodeError_clone(&e_conv);
12652 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12653 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
12654 return tag_ptr(ret_conv, true);
12657 jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint64_t o) {
12658 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
12659 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
12663 void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint64_t _res) {
12664 if (!ptr_is_owned(_res)) return;
12665 void* _res_ptr = untag_ptr(_res);
12666 CHECK_ACCESS(_res_ptr);
12667 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
12668 FREE(untag_ptr(_res));
12669 CResult_RouteHintDecodeErrorZ_free(_res_conv);
12672 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
12673 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12674 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
12675 return tag_ptr(ret_conv, true);
12677 int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint64_t arg) {
12678 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
12679 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
12683 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint64_t orig) {
12684 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
12685 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
12686 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
12687 return tag_ptr(ret_conv, true);
12690 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint64_t o) {
12691 LDKRouteHintHop o_conv;
12692 o_conv.inner = untag_ptr(o);
12693 o_conv.is_owned = ptr_is_owned(o);
12694 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12695 o_conv = RouteHintHop_clone(&o_conv);
12696 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12697 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
12698 return tag_ptr(ret_conv, true);
12701 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
12702 LDKDecodeError e_conv;
12703 e_conv.inner = untag_ptr(e);
12704 e_conv.is_owned = ptr_is_owned(e);
12705 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12706 e_conv = DecodeError_clone(&e_conv);
12707 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12708 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
12709 return tag_ptr(ret_conv, true);
12712 jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint64_t o) {
12713 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
12714 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
12718 void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint64_t _res) {
12719 if (!ptr_is_owned(_res)) return;
12720 void* _res_ptr = untag_ptr(_res);
12721 CHECK_ACCESS(_res_ptr);
12722 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
12723 FREE(untag_ptr(_res));
12724 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
12727 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
12728 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12729 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
12730 return tag_ptr(ret_conv, true);
12732 int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint64_t arg) {
12733 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
12734 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
12738 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint64_t orig) {
12739 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
12740 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
12741 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
12742 return tag_ptr(ret_conv, true);
12745 void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
12746 LDKCVec_ChannelDetailsZ _res_constr;
12747 _res_constr.datalen = _res->arr_len;
12748 if (_res_constr.datalen > 0)
12749 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
12751 _res_constr.data = NULL;
12752 uint64_t* _res_vals = _res->elems;
12753 for (size_t q = 0; q < _res_constr.datalen; q++) {
12754 uint64_t _res_conv_16 = _res_vals[q];
12755 LDKChannelDetails _res_conv_16_conv;
12756 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
12757 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
12758 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
12759 _res_constr.data[q] = _res_conv_16_conv;
12762 CVec_ChannelDetailsZ_free(_res_constr);
12765 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
12767 o_conv.inner = untag_ptr(o);
12768 o_conv.is_owned = ptr_is_owned(o);
12769 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12770 o_conv = Route_clone(&o_conv);
12771 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12772 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
12773 return tag_ptr(ret_conv, true);
12776 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
12777 LDKLightningError e_conv;
12778 e_conv.inner = untag_ptr(e);
12779 e_conv.is_owned = ptr_is_owned(e);
12780 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12781 e_conv = LightningError_clone(&e_conv);
12782 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12783 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
12784 return tag_ptr(ret_conv, true);
12787 jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
12788 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
12789 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
12793 void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
12794 if (!ptr_is_owned(_res)) return;
12795 void* _res_ptr = untag_ptr(_res);
12796 CHECK_ACCESS(_res_ptr);
12797 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
12798 FREE(untag_ptr(_res));
12799 CResult_RouteLightningErrorZ_free(_res_conv);
12802 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
12803 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12804 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
12805 return tag_ptr(ret_conv, true);
12807 int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
12808 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
12809 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
12813 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
12814 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
12815 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
12816 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
12817 return tag_ptr(ret_conv, true);
12820 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
12821 void* o_ptr = untag_ptr(o);
12822 CHECK_ACCESS(o_ptr);
12823 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
12824 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
12825 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12826 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
12827 return tag_ptr(ret_conv, true);
12830 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
12831 LDKDecodeError e_conv;
12832 e_conv.inner = untag_ptr(e);
12833 e_conv.is_owned = ptr_is_owned(e);
12834 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12835 e_conv = DecodeError_clone(&e_conv);
12836 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12837 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
12838 return tag_ptr(ret_conv, true);
12841 jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
12842 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
12843 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
12847 void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
12848 if (!ptr_is_owned(_res)) return;
12849 void* _res_ptr = untag_ptr(_res);
12850 CHECK_ACCESS(_res_ptr);
12851 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
12852 FREE(untag_ptr(_res));
12853 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
12856 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
12857 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12858 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
12859 return tag_ptr(ret_conv, true);
12861 int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
12862 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
12863 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
12867 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
12868 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
12869 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
12870 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
12871 return tag_ptr(ret_conv, true);
12874 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) {
12875 void* o_ptr = untag_ptr(o);
12876 CHECK_ACCESS(o_ptr);
12877 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
12878 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
12879 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12880 *ret_copy = COption_ClosureReasonZ_some(o_conv);
12881 uint64_t ret_ref = tag_ptr(ret_copy, true);
12885 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() {
12886 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12887 *ret_copy = COption_ClosureReasonZ_none();
12888 uint64_t ret_ref = tag_ptr(ret_copy, true);
12892 void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) {
12893 if (!ptr_is_owned(_res)) return;
12894 void* _res_ptr = untag_ptr(_res);
12895 CHECK_ACCESS(_res_ptr);
12896 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
12897 FREE(untag_ptr(_res));
12898 COption_ClosureReasonZ_free(_res_conv);
12901 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
12902 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12903 *ret_copy = COption_ClosureReasonZ_clone(arg);
12904 uint64_t ret_ref = tag_ptr(ret_copy, true);
12907 int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) {
12908 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
12909 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
12913 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) {
12914 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
12915 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
12916 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
12917 uint64_t ret_ref = tag_ptr(ret_copy, true);
12921 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) {
12922 void* o_ptr = untag_ptr(o);
12923 CHECK_ACCESS(o_ptr);
12924 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
12925 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
12926 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12927 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
12928 return tag_ptr(ret_conv, true);
12931 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
12932 LDKDecodeError e_conv;
12933 e_conv.inner = untag_ptr(e);
12934 e_conv.is_owned = ptr_is_owned(e);
12935 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12936 e_conv = DecodeError_clone(&e_conv);
12937 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12938 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
12939 return tag_ptr(ret_conv, true);
12942 jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) {
12943 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
12944 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
12948 void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) {
12949 if (!ptr_is_owned(_res)) return;
12950 void* _res_ptr = untag_ptr(_res);
12951 CHECK_ACCESS(_res_ptr);
12952 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
12953 FREE(untag_ptr(_res));
12954 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
12957 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
12958 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12959 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
12960 return tag_ptr(ret_conv, true);
12962 int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) {
12963 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
12964 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
12968 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) {
12969 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
12970 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12971 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
12972 return tag_ptr(ret_conv, true);
12975 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) {
12976 void* o_ptr = untag_ptr(o);
12977 CHECK_ACCESS(o_ptr);
12978 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
12979 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
12980 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12981 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
12982 uint64_t ret_ref = tag_ptr(ret_copy, true);
12986 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() {
12987 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12988 *ret_copy = COption_HTLCDestinationZ_none();
12989 uint64_t ret_ref = tag_ptr(ret_copy, true);
12993 void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) {
12994 if (!ptr_is_owned(_res)) return;
12995 void* _res_ptr = untag_ptr(_res);
12996 CHECK_ACCESS(_res_ptr);
12997 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
12998 FREE(untag_ptr(_res));
12999 COption_HTLCDestinationZ_free(_res_conv);
13002 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
13003 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13004 *ret_copy = COption_HTLCDestinationZ_clone(arg);
13005 uint64_t ret_ref = tag_ptr(ret_copy, true);
13008 int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) {
13009 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
13010 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
13014 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) {
13015 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
13016 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
13017 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
13018 uint64_t ret_ref = tag_ptr(ret_copy, true);
13022 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) {
13023 void* o_ptr = untag_ptr(o);
13024 CHECK_ACCESS(o_ptr);
13025 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
13026 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
13027 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13028 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
13029 return tag_ptr(ret_conv, true);
13032 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
13033 LDKDecodeError e_conv;
13034 e_conv.inner = untag_ptr(e);
13035 e_conv.is_owned = ptr_is_owned(e);
13036 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13037 e_conv = DecodeError_clone(&e_conv);
13038 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13039 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
13040 return tag_ptr(ret_conv, true);
13043 jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) {
13044 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
13045 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
13049 void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) {
13050 if (!ptr_is_owned(_res)) return;
13051 void* _res_ptr = untag_ptr(_res);
13052 CHECK_ACCESS(_res_ptr);
13053 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
13054 FREE(untag_ptr(_res));
13055 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
13058 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
13059 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13060 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
13061 return tag_ptr(ret_conv, true);
13063 int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) {
13064 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
13065 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
13069 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) {
13070 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
13071 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
13072 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
13073 return tag_ptr(ret_conv, true);
13076 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
13077 void* o_ptr = untag_ptr(o);
13078 CHECK_ACCESS(o_ptr);
13079 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
13080 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
13081 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13082 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
13083 uint64_t ret_ref = tag_ptr(ret_copy, true);
13087 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
13088 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13089 *ret_copy = COption_NetworkUpdateZ_none();
13090 uint64_t ret_ref = tag_ptr(ret_copy, true);
13094 void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
13095 if (!ptr_is_owned(_res)) return;
13096 void* _res_ptr = untag_ptr(_res);
13097 CHECK_ACCESS(_res_ptr);
13098 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
13099 FREE(untag_ptr(_res));
13100 COption_NetworkUpdateZ_free(_res_conv);
13103 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
13104 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13105 *ret_copy = COption_NetworkUpdateZ_clone(arg);
13106 uint64_t ret_ref = tag_ptr(ret_copy, true);
13109 int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
13110 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
13111 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
13115 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
13116 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
13117 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
13118 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
13119 uint64_t ret_ref = tag_ptr(ret_copy, true);
13123 void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) {
13124 LDKCVec_SpendableOutputDescriptorZ _res_constr;
13125 _res_constr.datalen = _res->arr_len;
13126 if (_res_constr.datalen > 0)
13127 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
13129 _res_constr.data = NULL;
13130 uint64_t* _res_vals = _res->elems;
13131 for (size_t b = 0; b < _res_constr.datalen; b++) {
13132 uint64_t _res_conv_27 = _res_vals[b];
13133 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
13134 CHECK_ACCESS(_res_conv_27_ptr);
13135 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
13136 FREE(untag_ptr(_res_conv_27));
13137 _res_constr.data[b] = _res_conv_27_conv;
13140 CVec_SpendableOutputDescriptorZ_free(_res_constr);
13143 uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) {
13144 void* o_ptr = untag_ptr(o);
13145 CHECK_ACCESS(o_ptr);
13146 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
13147 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
13148 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13149 *ret_copy = COption_EventZ_some(o_conv);
13150 uint64_t ret_ref = tag_ptr(ret_copy, true);
13154 uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() {
13155 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13156 *ret_copy = COption_EventZ_none();
13157 uint64_t ret_ref = tag_ptr(ret_copy, true);
13161 void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) {
13162 if (!ptr_is_owned(_res)) return;
13163 void* _res_ptr = untag_ptr(_res);
13164 CHECK_ACCESS(_res_ptr);
13165 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
13166 FREE(untag_ptr(_res));
13167 COption_EventZ_free(_res_conv);
13170 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
13171 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13172 *ret_copy = COption_EventZ_clone(arg);
13173 uint64_t ret_ref = tag_ptr(ret_copy, true);
13176 int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) {
13177 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
13178 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
13182 uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) {
13183 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
13184 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
13185 *ret_copy = COption_EventZ_clone(orig_conv);
13186 uint64_t ret_ref = tag_ptr(ret_copy, true);
13190 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) {
13191 void* o_ptr = untag_ptr(o);
13192 CHECK_ACCESS(o_ptr);
13193 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
13194 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
13195 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13196 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
13197 return tag_ptr(ret_conv, true);
13200 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
13201 LDKDecodeError e_conv;
13202 e_conv.inner = untag_ptr(e);
13203 e_conv.is_owned = ptr_is_owned(e);
13204 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13205 e_conv = DecodeError_clone(&e_conv);
13206 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13207 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
13208 return tag_ptr(ret_conv, true);
13211 jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) {
13212 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
13213 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
13217 void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) {
13218 if (!ptr_is_owned(_res)) return;
13219 void* _res_ptr = untag_ptr(_res);
13220 CHECK_ACCESS(_res_ptr);
13221 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
13222 FREE(untag_ptr(_res));
13223 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
13226 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
13227 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13228 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
13229 return tag_ptr(ret_conv, true);
13231 int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) {
13232 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
13233 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
13237 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) {
13238 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
13239 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
13240 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
13241 return tag_ptr(ret_conv, true);
13244 void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) {
13245 LDKCVec_MessageSendEventZ _res_constr;
13246 _res_constr.datalen = _res->arr_len;
13247 if (_res_constr.datalen > 0)
13248 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
13250 _res_constr.data = NULL;
13251 uint64_t* _res_vals = _res->elems;
13252 for (size_t s = 0; s < _res_constr.datalen; s++) {
13253 uint64_t _res_conv_18 = _res_vals[s];
13254 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
13255 CHECK_ACCESS(_res_conv_18_ptr);
13256 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
13257 FREE(untag_ptr(_res_conv_18));
13258 _res_constr.data[s] = _res_conv_18_conv;
13261 CVec_MessageSendEventZ_free(_res_constr);
13264 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
13265 void* o_ptr = untag_ptr(o);
13266 CHECK_ACCESS(o_ptr);
13267 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
13268 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
13269 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13270 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
13271 return tag_ptr(ret_conv, true);
13274 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
13275 LDKAccessError e_conv = LDKAccessError_from_js(e);
13276 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13277 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
13278 return tag_ptr(ret_conv, true);
13281 jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
13282 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
13283 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
13287 void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
13288 if (!ptr_is_owned(_res)) return;
13289 void* _res_ptr = untag_ptr(_res);
13290 CHECK_ACCESS(_res_ptr);
13291 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
13292 FREE(untag_ptr(_res));
13293 CResult_TxOutAccessErrorZ_free(_res_conv);
13296 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
13297 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13298 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
13299 return tag_ptr(ret_conv, true);
13301 int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
13302 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
13303 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
13307 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
13308 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
13309 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
13310 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
13311 return tag_ptr(ret_conv, true);
13314 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
13315 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13316 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
13317 return tag_ptr(ret_conv, true);
13319 int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) {
13320 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
13321 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
13325 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) {
13326 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
13327 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13328 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
13329 return tag_ptr(ret_conv, true);
13332 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) {
13333 LDKTransaction b_ref;
13334 b_ref.datalen = b->arr_len;
13335 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
13336 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
13337 b_ref.data_is_owned = true;
13338 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
13339 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
13340 return tag_ptr(ret_conv, true);
13343 void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) {
13344 if (!ptr_is_owned(_res)) return;
13345 void* _res_ptr = untag_ptr(_res);
13346 CHECK_ACCESS(_res_ptr);
13347 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
13348 FREE(untag_ptr(_res));
13349 C2Tuple_usizeTransactionZ_free(_res_conv);
13352 void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) {
13353 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
13354 _res_constr.datalen = _res->arr_len;
13355 if (_res_constr.datalen > 0)
13356 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
13358 _res_constr.data = NULL;
13359 uint64_t* _res_vals = _res->elems;
13360 for (size_t c = 0; c < _res_constr.datalen; c++) {
13361 uint64_t _res_conv_28 = _res_vals[c];
13362 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
13363 CHECK_ACCESS(_res_conv_28_ptr);
13364 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
13365 FREE(untag_ptr(_res_conv_28));
13366 _res_constr.data[c] = _res_conv_28_conv;
13369 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
13372 void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
13373 LDKCVec_TxidZ _res_constr;
13374 _res_constr.datalen = _res->arr_len;
13375 if (_res_constr.datalen > 0)
13376 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
13378 _res_constr.data = NULL;
13379 int8_tArray* _res_vals = (void*) _res->elems;
13380 for (size_t m = 0; m < _res_constr.datalen; m++) {
13381 int8_tArray _res_conv_12 = _res_vals[m];
13382 LDKThirtyTwoBytes _res_conv_12_ref;
13383 CHECK(_res_conv_12->arr_len == 32);
13384 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
13385 _res_constr.data[m] = _res_conv_12_ref;
13388 CVec_TxidZ_free(_res_constr);
13391 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() {
13392 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
13393 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
13394 return tag_ptr(ret_conv, true);
13397 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) {
13398 LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e);
13399 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
13400 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
13401 return tag_ptr(ret_conv, true);
13404 jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) {
13405 LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
13406 jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
13410 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) {
13411 if (!ptr_is_owned(_res)) return;
13412 void* _res_ptr = untag_ptr(_res);
13413 CHECK_ACCESS(_res_ptr);
13414 LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
13415 FREE(untag_ptr(_res));
13416 CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
13419 static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
13420 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
13421 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
13422 return tag_ptr(ret_conv, true);
13424 int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) {
13425 LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
13426 int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
13430 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) {
13431 LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
13432 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
13433 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
13434 return tag_ptr(ret_conv, true);
13437 void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
13438 LDKCVec_MonitorEventZ _res_constr;
13439 _res_constr.datalen = _res->arr_len;
13440 if (_res_constr.datalen > 0)
13441 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
13443 _res_constr.data = NULL;
13444 uint64_t* _res_vals = _res->elems;
13445 for (size_t o = 0; o < _res_constr.datalen; o++) {
13446 uint64_t _res_conv_14 = _res_vals[o];
13447 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
13448 CHECK_ACCESS(_res_conv_14_ptr);
13449 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
13450 FREE(untag_ptr(_res_conv_14));
13451 _res_constr.data[o] = _res_conv_14_conv;
13454 CVec_MonitorEventZ_free(_res_constr);
13457 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
13458 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13459 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
13460 return tag_ptr(ret_conv, true);
13462 int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) {
13463 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
13464 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
13468 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) {
13469 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
13470 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13471 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
13472 return tag_ptr(ret_conv, true);
13475 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) {
13476 LDKOutPoint a_conv;
13477 a_conv.inner = untag_ptr(a);
13478 a_conv.is_owned = ptr_is_owned(a);
13479 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
13480 a_conv = OutPoint_clone(&a_conv);
13481 LDKCVec_MonitorEventZ b_constr;
13482 b_constr.datalen = b->arr_len;
13483 if (b_constr.datalen > 0)
13484 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
13486 b_constr.data = NULL;
13487 uint64_t* b_vals = b->elems;
13488 for (size_t o = 0; o < b_constr.datalen; o++) {
13489 uint64_t b_conv_14 = b_vals[o];
13490 void* b_conv_14_ptr = untag_ptr(b_conv_14);
13491 CHECK_ACCESS(b_conv_14_ptr);
13492 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
13493 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
13494 b_constr.data[o] = b_conv_14_conv;
13497 LDKPublicKey c_ref;
13498 CHECK(c->arr_len == 33);
13499 memcpy(c_ref.compressed_form, c->elems, 33); FREE(c);
13500 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
13501 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
13502 return tag_ptr(ret_conv, true);
13505 void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) {
13506 if (!ptr_is_owned(_res)) return;
13507 void* _res_ptr = untag_ptr(_res);
13508 CHECK_ACCESS(_res_ptr);
13509 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
13510 FREE(untag_ptr(_res));
13511 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
13514 void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) {
13515 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
13516 _res_constr.datalen = _res->arr_len;
13517 if (_res_constr.datalen > 0)
13518 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
13520 _res_constr.data = NULL;
13521 uint64_t* _res_vals = _res->elems;
13522 for (size_t x = 0; x < _res_constr.datalen; x++) {
13523 uint64_t _res_conv_49 = _res_vals[x];
13524 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
13525 CHECK_ACCESS(_res_conv_49_ptr);
13526 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
13527 FREE(untag_ptr(_res_conv_49));
13528 _res_constr.data[x] = _res_conv_49_conv;
13531 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
13534 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
13535 LDKFixedPenaltyScorer o_conv;
13536 o_conv.inner = untag_ptr(o);
13537 o_conv.is_owned = ptr_is_owned(o);
13538 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13539 o_conv = FixedPenaltyScorer_clone(&o_conv);
13540 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13541 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
13542 return tag_ptr(ret_conv, true);
13545 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
13546 LDKDecodeError e_conv;
13547 e_conv.inner = untag_ptr(e);
13548 e_conv.is_owned = ptr_is_owned(e);
13549 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13550 e_conv = DecodeError_clone(&e_conv);
13551 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13552 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
13553 return tag_ptr(ret_conv, true);
13556 jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) {
13557 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
13558 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
13562 void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) {
13563 if (!ptr_is_owned(_res)) return;
13564 void* _res_ptr = untag_ptr(_res);
13565 CHECK_ACCESS(_res_ptr);
13566 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
13567 FREE(untag_ptr(_res));
13568 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
13571 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
13572 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13573 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
13574 return tag_ptr(ret_conv, true);
13576 int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) {
13577 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
13578 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
13582 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) {
13583 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
13584 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
13585 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
13586 return tag_ptr(ret_conv, true);
13589 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
13590 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13591 *ret_conv = C2Tuple_u64u64Z_clone(arg);
13592 return tag_ptr(ret_conv, true);
13594 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) {
13595 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
13596 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
13600 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) {
13601 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
13602 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13603 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
13604 return tag_ptr(ret_conv, true);
13607 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
13608 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
13609 *ret_conv = C2Tuple_u64u64Z_new(a, b);
13610 return tag_ptr(ret_conv, true);
13613 void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) {
13614 if (!ptr_is_owned(_res)) return;
13615 void* _res_ptr = untag_ptr(_res);
13616 CHECK_ACCESS(_res_ptr);
13617 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
13618 FREE(untag_ptr(_res));
13619 C2Tuple_u64u64Z_free(_res_conv);
13622 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) {
13623 void* o_ptr = untag_ptr(o);
13624 CHECK_ACCESS(o_ptr);
13625 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
13626 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
13627 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13628 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
13629 uint64_t ret_ref = tag_ptr(ret_copy, true);
13633 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() {
13634 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13635 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
13636 uint64_t ret_ref = tag_ptr(ret_copy, true);
13640 void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) {
13641 if (!ptr_is_owned(_res)) return;
13642 void* _res_ptr = untag_ptr(_res);
13643 CHECK_ACCESS(_res_ptr);
13644 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
13645 FREE(untag_ptr(_res));
13646 COption_C2Tuple_u64u64ZZ_free(_res_conv);
13649 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
13650 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13651 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
13652 uint64_t ret_ref = tag_ptr(ret_copy, true);
13655 int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) {
13656 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
13657 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
13661 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) {
13662 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
13663 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
13664 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
13665 uint64_t ret_ref = tag_ptr(ret_copy, true);
13669 void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
13670 LDKCVec_NodeIdZ _res_constr;
13671 _res_constr.datalen = _res->arr_len;
13672 if (_res_constr.datalen > 0)
13673 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
13675 _res_constr.data = NULL;
13676 uint64_t* _res_vals = _res->elems;
13677 for (size_t i = 0; i < _res_constr.datalen; i++) {
13678 uint64_t _res_conv_8 = _res_vals[i];
13679 LDKNodeId _res_conv_8_conv;
13680 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
13681 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
13682 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
13683 _res_constr.data[i] = _res_conv_8_conv;
13686 CVec_NodeIdZ_free(_res_constr);
13689 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) {
13690 LDKProbabilisticScorer o_conv;
13691 o_conv.inner = untag_ptr(o);
13692 o_conv.is_owned = ptr_is_owned(o);
13693 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13694 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
13696 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
13697 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
13698 return tag_ptr(ret_conv, true);
13701 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
13702 LDKDecodeError e_conv;
13703 e_conv.inner = untag_ptr(e);
13704 e_conv.is_owned = ptr_is_owned(e);
13705 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13706 e_conv = DecodeError_clone(&e_conv);
13707 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
13708 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
13709 return tag_ptr(ret_conv, true);
13712 jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) {
13713 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
13714 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
13718 void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) {
13719 if (!ptr_is_owned(_res)) return;
13720 void* _res_ptr = untag_ptr(_res);
13721 CHECK_ACCESS(_res_ptr);
13722 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
13723 FREE(untag_ptr(_res));
13724 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
13727 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) {
13728 LDKInitFeatures o_conv;
13729 o_conv.inner = untag_ptr(o);
13730 o_conv.is_owned = ptr_is_owned(o);
13731 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13732 o_conv = InitFeatures_clone(&o_conv);
13733 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13734 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
13735 return tag_ptr(ret_conv, true);
13738 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
13739 LDKDecodeError e_conv;
13740 e_conv.inner = untag_ptr(e);
13741 e_conv.is_owned = ptr_is_owned(e);
13742 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13743 e_conv = DecodeError_clone(&e_conv);
13744 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13745 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
13746 return tag_ptr(ret_conv, true);
13749 jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13750 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
13751 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
13755 void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) {
13756 if (!ptr_is_owned(_res)) return;
13757 void* _res_ptr = untag_ptr(_res);
13758 CHECK_ACCESS(_res_ptr);
13759 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
13760 FREE(untag_ptr(_res));
13761 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
13764 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13765 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13766 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
13767 return tag_ptr(ret_conv, true);
13769 int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13770 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
13771 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13775 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) {
13776 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
13777 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
13778 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
13779 return tag_ptr(ret_conv, true);
13782 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) {
13783 LDKChannelFeatures o_conv;
13784 o_conv.inner = untag_ptr(o);
13785 o_conv.is_owned = ptr_is_owned(o);
13786 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13787 o_conv = ChannelFeatures_clone(&o_conv);
13788 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13789 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
13790 return tag_ptr(ret_conv, true);
13793 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
13794 LDKDecodeError e_conv;
13795 e_conv.inner = untag_ptr(e);
13796 e_conv.is_owned = ptr_is_owned(e);
13797 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13798 e_conv = DecodeError_clone(&e_conv);
13799 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13800 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
13801 return tag_ptr(ret_conv, true);
13804 jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13805 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
13806 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
13810 void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) {
13811 if (!ptr_is_owned(_res)) return;
13812 void* _res_ptr = untag_ptr(_res);
13813 CHECK_ACCESS(_res_ptr);
13814 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
13815 FREE(untag_ptr(_res));
13816 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
13819 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13820 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13821 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
13822 return tag_ptr(ret_conv, true);
13824 int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13825 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
13826 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13830 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) {
13831 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
13832 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
13833 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
13834 return tag_ptr(ret_conv, true);
13837 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) {
13838 LDKNodeFeatures o_conv;
13839 o_conv.inner = untag_ptr(o);
13840 o_conv.is_owned = ptr_is_owned(o);
13841 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13842 o_conv = NodeFeatures_clone(&o_conv);
13843 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13844 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
13845 return tag_ptr(ret_conv, true);
13848 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
13849 LDKDecodeError e_conv;
13850 e_conv.inner = untag_ptr(e);
13851 e_conv.is_owned = ptr_is_owned(e);
13852 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13853 e_conv = DecodeError_clone(&e_conv);
13854 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13855 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
13856 return tag_ptr(ret_conv, true);
13859 jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13860 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
13861 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
13865 void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) {
13866 if (!ptr_is_owned(_res)) return;
13867 void* _res_ptr = untag_ptr(_res);
13868 CHECK_ACCESS(_res_ptr);
13869 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
13870 FREE(untag_ptr(_res));
13871 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
13874 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13875 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13876 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
13877 return tag_ptr(ret_conv, true);
13879 int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13880 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
13881 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13885 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) {
13886 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
13887 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
13888 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
13889 return tag_ptr(ret_conv, true);
13892 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) {
13893 LDKInvoiceFeatures o_conv;
13894 o_conv.inner = untag_ptr(o);
13895 o_conv.is_owned = ptr_is_owned(o);
13896 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13897 o_conv = InvoiceFeatures_clone(&o_conv);
13898 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13899 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
13900 return tag_ptr(ret_conv, true);
13903 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
13904 LDKDecodeError e_conv;
13905 e_conv.inner = untag_ptr(e);
13906 e_conv.is_owned = ptr_is_owned(e);
13907 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13908 e_conv = DecodeError_clone(&e_conv);
13909 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13910 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
13911 return tag_ptr(ret_conv, true);
13914 jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13915 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
13916 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
13920 void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) {
13921 if (!ptr_is_owned(_res)) return;
13922 void* _res_ptr = untag_ptr(_res);
13923 CHECK_ACCESS(_res_ptr);
13924 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
13925 FREE(untag_ptr(_res));
13926 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
13929 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13930 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13931 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
13932 return tag_ptr(ret_conv, true);
13934 int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13935 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
13936 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13940 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) {
13941 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
13942 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13943 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
13944 return tag_ptr(ret_conv, true);
13947 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
13948 LDKChannelTypeFeatures o_conv;
13949 o_conv.inner = untag_ptr(o);
13950 o_conv.is_owned = ptr_is_owned(o);
13951 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13952 o_conv = ChannelTypeFeatures_clone(&o_conv);
13953 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13954 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
13955 return tag_ptr(ret_conv, true);
13958 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
13959 LDKDecodeError e_conv;
13960 e_conv.inner = untag_ptr(e);
13961 e_conv.is_owned = ptr_is_owned(e);
13962 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13963 e_conv = DecodeError_clone(&e_conv);
13964 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13965 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
13966 return tag_ptr(ret_conv, true);
13969 jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13970 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
13971 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
13975 void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) {
13976 if (!ptr_is_owned(_res)) return;
13977 void* _res_ptr = untag_ptr(_res);
13978 CHECK_ACCESS(_res_ptr);
13979 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
13980 FREE(untag_ptr(_res));
13981 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
13984 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13985 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13986 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
13987 return tag_ptr(ret_conv, true);
13989 int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13990 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
13991 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13995 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) {
13996 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
13997 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13998 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
13999 return tag_ptr(ret_conv, true);
14002 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) {
14004 o_conv.inner = untag_ptr(o);
14005 o_conv.is_owned = ptr_is_owned(o);
14006 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14007 o_conv = NodeId_clone(&o_conv);
14008 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14009 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
14010 return tag_ptr(ret_conv, true);
14013 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
14014 LDKDecodeError e_conv;
14015 e_conv.inner = untag_ptr(e);
14016 e_conv.is_owned = ptr_is_owned(e);
14017 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14018 e_conv = DecodeError_clone(&e_conv);
14019 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14020 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
14021 return tag_ptr(ret_conv, true);
14024 jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) {
14025 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
14026 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
14030 void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) {
14031 if (!ptr_is_owned(_res)) return;
14032 void* _res_ptr = untag_ptr(_res);
14033 CHECK_ACCESS(_res_ptr);
14034 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
14035 FREE(untag_ptr(_res));
14036 CResult_NodeIdDecodeErrorZ_free(_res_conv);
14039 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
14040 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14041 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
14042 return tag_ptr(ret_conv, true);
14044 int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) {
14045 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
14046 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
14050 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint64_t orig) {
14051 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
14052 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
14053 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
14054 return tag_ptr(ret_conv, true);
14057 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint64_t o) {
14058 void* o_ptr = untag_ptr(o);
14059 CHECK_ACCESS(o_ptr);
14060 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
14061 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
14062 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14063 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
14064 return tag_ptr(ret_conv, true);
14067 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
14068 LDKDecodeError e_conv;
14069 e_conv.inner = untag_ptr(e);
14070 e_conv.is_owned = ptr_is_owned(e);
14071 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14072 e_conv = DecodeError_clone(&e_conv);
14073 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14074 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
14075 return tag_ptr(ret_conv, true);
14078 jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint64_t o) {
14079 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
14080 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
14084 void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint64_t _res) {
14085 if (!ptr_is_owned(_res)) return;
14086 void* _res_ptr = untag_ptr(_res);
14087 CHECK_ACCESS(_res_ptr);
14088 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
14089 FREE(untag_ptr(_res));
14090 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
14093 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
14094 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14095 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
14096 return tag_ptr(ret_conv, true);
14098 int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint64_t arg) {
14099 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
14100 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
14104 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint64_t orig) {
14105 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
14106 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
14107 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
14108 return tag_ptr(ret_conv, true);
14111 uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
14112 void* o_ptr = untag_ptr(o);
14113 CHECK_ACCESS(o_ptr);
14114 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
14115 if (o_conv.free == LDKAccess_JCalls_free) {
14116 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14117 LDKAccess_JCalls_cloned(&o_conv);
14119 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
14120 *ret_copy = COption_AccessZ_some(o_conv);
14121 uint64_t ret_ref = tag_ptr(ret_copy, true);
14125 uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
14126 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
14127 *ret_copy = COption_AccessZ_none();
14128 uint64_t ret_ref = tag_ptr(ret_copy, true);
14132 void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
14133 if (!ptr_is_owned(_res)) return;
14134 void* _res_ptr = untag_ptr(_res);
14135 CHECK_ACCESS(_res_ptr);
14136 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
14137 FREE(untag_ptr(_res));
14138 COption_AccessZ_free(_res_conv);
14141 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
14142 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14143 *ret_conv = CResult_boolLightningErrorZ_ok(o);
14144 return tag_ptr(ret_conv, true);
14147 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint64_t e) {
14148 LDKLightningError e_conv;
14149 e_conv.inner = untag_ptr(e);
14150 e_conv.is_owned = ptr_is_owned(e);
14151 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14152 e_conv = LightningError_clone(&e_conv);
14153 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14154 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
14155 return tag_ptr(ret_conv, true);
14158 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint64_t o) {
14159 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
14160 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
14164 void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint64_t _res) {
14165 if (!ptr_is_owned(_res)) return;
14166 void* _res_ptr = untag_ptr(_res);
14167 CHECK_ACCESS(_res_ptr);
14168 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
14169 FREE(untag_ptr(_res));
14170 CResult_boolLightningErrorZ_free(_res_conv);
14173 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
14174 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14175 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
14176 return tag_ptr(ret_conv, true);
14178 int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint64_t arg) {
14179 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
14180 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
14184 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) TS_CResult_boolLightningErrorZ_clone(uint64_t orig) {
14185 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
14186 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14187 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
14188 return tag_ptr(ret_conv, true);
14191 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
14192 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14193 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
14194 return tag_ptr(ret_conv, true);
14196 int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint64_t arg) {
14197 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
14198 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
14202 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint64_t orig) {
14203 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
14204 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14205 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
14206 return tag_ptr(ret_conv, true);
14209 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint64_t a, uint64_t b, uint64_t c) {
14210 LDKChannelAnnouncement a_conv;
14211 a_conv.inner = untag_ptr(a);
14212 a_conv.is_owned = ptr_is_owned(a);
14213 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
14214 a_conv = ChannelAnnouncement_clone(&a_conv);
14215 LDKChannelUpdate b_conv;
14216 b_conv.inner = untag_ptr(b);
14217 b_conv.is_owned = ptr_is_owned(b);
14218 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
14219 b_conv = ChannelUpdate_clone(&b_conv);
14220 LDKChannelUpdate c_conv;
14221 c_conv.inner = untag_ptr(c);
14222 c_conv.is_owned = ptr_is_owned(c);
14223 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
14224 c_conv = ChannelUpdate_clone(&c_conv);
14225 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
14226 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
14227 return tag_ptr(ret_conv, true);
14230 void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint64_t _res) {
14231 if (!ptr_is_owned(_res)) return;
14232 void* _res_ptr = untag_ptr(_res);
14233 CHECK_ACCESS(_res_ptr);
14234 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
14235 FREE(untag_ptr(_res));
14236 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
14239 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(uint64_t o) {
14240 void* o_ptr = untag_ptr(o);
14241 CHECK_ACCESS(o_ptr);
14242 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
14243 o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
14244 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14245 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
14246 uint64_t ret_ref = tag_ptr(ret_copy, true);
14250 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none() {
14251 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14252 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
14253 uint64_t ret_ref = tag_ptr(ret_copy, true);
14257 void __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_t _res) {
14258 if (!ptr_is_owned(_res)) return;
14259 void* _res_ptr = untag_ptr(_res);
14260 CHECK_ACCESS(_res_ptr);
14261 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
14262 FREE(untag_ptr(_res));
14263 COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
14266 static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
14267 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14268 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
14269 uint64_t ret_ref = tag_ptr(ret_copy, true);
14272 int64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(uint64_t arg) {
14273 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
14274 int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
14278 uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(uint64_t orig) {
14279 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
14280 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14281 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
14282 uint64_t ret_ref = tag_ptr(ret_copy, true);
14286 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
14287 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14288 *ret_conv = CResult_NoneLightningErrorZ_ok();
14289 return tag_ptr(ret_conv, true);
14292 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint64_t e) {
14293 LDKLightningError e_conv;
14294 e_conv.inner = untag_ptr(e);
14295 e_conv.is_owned = ptr_is_owned(e);
14296 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14297 e_conv = LightningError_clone(&e_conv);
14298 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14299 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
14300 return tag_ptr(ret_conv, true);
14303 jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint64_t o) {
14304 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
14305 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
14309 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint64_t _res) {
14310 if (!ptr_is_owned(_res)) return;
14311 void* _res_ptr = untag_ptr(_res);
14312 CHECK_ACCESS(_res_ptr);
14313 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
14314 FREE(untag_ptr(_res));
14315 CResult_NoneLightningErrorZ_free(_res_conv);
14318 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
14319 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14320 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
14321 return tag_ptr(ret_conv, true);
14323 int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint64_t arg) {
14324 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
14325 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
14329 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) TS_CResult_NoneLightningErrorZ_clone(uint64_t orig) {
14330 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
14331 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14332 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
14333 return tag_ptr(ret_conv, true);
14336 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok(uint64_t o) {
14337 LDKChannelUpdateInfo o_conv;
14338 o_conv.inner = untag_ptr(o);
14339 o_conv.is_owned = ptr_is_owned(o);
14340 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14341 o_conv = ChannelUpdateInfo_clone(&o_conv);
14342 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14343 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
14344 return tag_ptr(ret_conv, true);
14347 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
14348 LDKDecodeError e_conv;
14349 e_conv.inner = untag_ptr(e);
14350 e_conv.is_owned = ptr_is_owned(e);
14351 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14352 e_conv = DecodeError_clone(&e_conv);
14353 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14354 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
14355 return tag_ptr(ret_conv, true);
14358 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(uint64_t o) {
14359 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
14360 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
14364 void __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_free"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_free(uint64_t _res) {
14365 if (!ptr_is_owned(_res)) return;
14366 void* _res_ptr = untag_ptr(_res);
14367 CHECK_ACCESS(_res_ptr);
14368 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
14369 FREE(untag_ptr(_res));
14370 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
14373 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
14374 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14375 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
14376 return tag_ptr(ret_conv, true);
14378 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14379 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
14380 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
14384 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone(uint64_t orig) {
14385 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
14386 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
14387 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
14388 return tag_ptr(ret_conv, true);
14391 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint64_t o) {
14392 LDKChannelInfo o_conv;
14393 o_conv.inner = untag_ptr(o);
14394 o_conv.is_owned = ptr_is_owned(o);
14395 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14396 o_conv = ChannelInfo_clone(&o_conv);
14397 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14398 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
14399 return tag_ptr(ret_conv, true);
14402 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
14403 LDKDecodeError e_conv;
14404 e_conv.inner = untag_ptr(e);
14405 e_conv.is_owned = ptr_is_owned(e);
14406 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14407 e_conv = DecodeError_clone(&e_conv);
14408 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14409 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
14410 return tag_ptr(ret_conv, true);
14413 jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint64_t o) {
14414 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
14415 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
14419 void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint64_t _res) {
14420 if (!ptr_is_owned(_res)) return;
14421 void* _res_ptr = untag_ptr(_res);
14422 CHECK_ACCESS(_res_ptr);
14423 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
14424 FREE(untag_ptr(_res));
14425 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
14428 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
14429 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14430 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
14431 return tag_ptr(ret_conv, true);
14433 int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14434 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
14435 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
14439 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint64_t orig) {
14440 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
14441 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
14442 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
14443 return tag_ptr(ret_conv, true);
14446 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint64_t o) {
14447 LDKRoutingFees o_conv;
14448 o_conv.inner = untag_ptr(o);
14449 o_conv.is_owned = ptr_is_owned(o);
14450 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14451 o_conv = RoutingFees_clone(&o_conv);
14452 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14453 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
14454 return tag_ptr(ret_conv, true);
14457 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
14458 LDKDecodeError e_conv;
14459 e_conv.inner = untag_ptr(e);
14460 e_conv.is_owned = ptr_is_owned(e);
14461 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14462 e_conv = DecodeError_clone(&e_conv);
14463 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14464 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
14465 return tag_ptr(ret_conv, true);
14468 jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint64_t o) {
14469 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
14470 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
14474 void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint64_t _res) {
14475 if (!ptr_is_owned(_res)) return;
14476 void* _res_ptr = untag_ptr(_res);
14477 CHECK_ACCESS(_res_ptr);
14478 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
14479 FREE(untag_ptr(_res));
14480 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
14483 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
14484 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14485 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
14486 return tag_ptr(ret_conv, true);
14488 int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint64_t arg) {
14489 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
14490 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
14494 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint64_t orig) {
14495 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
14496 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
14497 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
14498 return tag_ptr(ret_conv, true);
14501 void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint64_tArray _res) {
14502 LDKCVec_NetAddressZ _res_constr;
14503 _res_constr.datalen = _res->arr_len;
14504 if (_res_constr.datalen > 0)
14505 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
14507 _res_constr.data = NULL;
14508 uint64_t* _res_vals = _res->elems;
14509 for (size_t m = 0; m < _res_constr.datalen; m++) {
14510 uint64_t _res_conv_12 = _res_vals[m];
14511 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
14512 CHECK_ACCESS(_res_conv_12_ptr);
14513 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
14514 FREE(untag_ptr(_res_conv_12));
14515 _res_constr.data[m] = _res_conv_12_conv;
14518 CVec_NetAddressZ_free(_res_constr);
14521 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint64_t o) {
14522 LDKNodeAnnouncementInfo o_conv;
14523 o_conv.inner = untag_ptr(o);
14524 o_conv.is_owned = ptr_is_owned(o);
14525 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14526 o_conv = NodeAnnouncementInfo_clone(&o_conv);
14527 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14528 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
14529 return tag_ptr(ret_conv, true);
14532 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
14533 LDKDecodeError e_conv;
14534 e_conv.inner = untag_ptr(e);
14535 e_conv.is_owned = ptr_is_owned(e);
14536 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14537 e_conv = DecodeError_clone(&e_conv);
14538 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14539 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
14540 return tag_ptr(ret_conv, true);
14543 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint64_t o) {
14544 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
14545 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
14549 void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint64_t _res) {
14550 if (!ptr_is_owned(_res)) return;
14551 void* _res_ptr = untag_ptr(_res);
14552 CHECK_ACCESS(_res_ptr);
14553 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
14554 FREE(untag_ptr(_res));
14555 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
14558 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
14559 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14560 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
14561 return tag_ptr(ret_conv, true);
14563 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14564 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
14565 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
14569 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint64_t orig) {
14570 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
14571 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
14572 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
14573 return tag_ptr(ret_conv, true);
14576 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS_CResult_NodeAliasDecodeErrorZ_ok(uint64_t o) {
14577 LDKNodeAlias o_conv;
14578 o_conv.inner = untag_ptr(o);
14579 o_conv.is_owned = ptr_is_owned(o);
14580 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14581 o_conv = NodeAlias_clone(&o_conv);
14582 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14583 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
14584 return tag_ptr(ret_conv, true);
14587 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
14588 LDKDecodeError e_conv;
14589 e_conv.inner = untag_ptr(e);
14590 e_conv.is_owned = ptr_is_owned(e);
14591 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14592 e_conv = DecodeError_clone(&e_conv);
14593 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14594 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
14595 return tag_ptr(ret_conv, true);
14598 jboolean __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_is_ok"))) TS_CResult_NodeAliasDecodeErrorZ_is_ok(uint64_t o) {
14599 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
14600 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
14604 void __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_free"))) TS_CResult_NodeAliasDecodeErrorZ_free(uint64_t _res) {
14605 if (!ptr_is_owned(_res)) return;
14606 void* _res_ptr = untag_ptr(_res);
14607 CHECK_ACCESS(_res_ptr);
14608 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
14609 FREE(untag_ptr(_res));
14610 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
14613 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
14614 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14615 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
14616 return tag_ptr(ret_conv, true);
14618 int64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAliasDecodeErrorZ_clone_ptr(uint64_t arg) {
14619 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
14620 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
14624 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone"))) TS_CResult_NodeAliasDecodeErrorZ_clone(uint64_t orig) {
14625 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
14626 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
14627 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
14628 return tag_ptr(ret_conv, true);
14631 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_CResult_NodeInfoDecodeErrorZ_ok(uint64_t o) {
14632 LDKNodeInfo o_conv;
14633 o_conv.inner = untag_ptr(o);
14634 o_conv.is_owned = ptr_is_owned(o);
14635 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14636 o_conv = NodeInfo_clone(&o_conv);
14637 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14638 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
14639 return tag_ptr(ret_conv, true);
14642 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) {
14643 LDKDecodeError e_conv;
14644 e_conv.inner = untag_ptr(e);
14645 e_conv.is_owned = ptr_is_owned(e);
14646 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14647 e_conv = DecodeError_clone(&e_conv);
14648 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14649 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
14650 return tag_ptr(ret_conv, true);
14653 jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint64_t o) {
14654 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
14655 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
14659 void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint64_t _res) {
14660 if (!ptr_is_owned(_res)) return;
14661 void* _res_ptr = untag_ptr(_res);
14662 CHECK_ACCESS(_res_ptr);
14663 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
14664 FREE(untag_ptr(_res));
14665 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
14668 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
14669 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14670 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
14671 return tag_ptr(ret_conv, true);
14673 int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
14674 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
14675 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
14679 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint64_t orig) {
14680 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
14681 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
14682 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
14683 return tag_ptr(ret_conv, true);
14686 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint64_t o) {
14687 LDKNetworkGraph o_conv;
14688 o_conv.inner = untag_ptr(o);
14689 o_conv.is_owned = ptr_is_owned(o);
14690 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14691 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
14693 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
14694 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
14695 return tag_ptr(ret_conv, true);
14698 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
14699 LDKDecodeError e_conv;
14700 e_conv.inner = untag_ptr(e);
14701 e_conv.is_owned = ptr_is_owned(e);
14702 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14703 e_conv = DecodeError_clone(&e_conv);
14704 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
14705 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
14706 return tag_ptr(ret_conv, true);
14709 jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint64_t o) {
14710 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
14711 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
14715 void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint64_t _res) {
14716 if (!ptr_is_owned(_res)) return;
14717 void* _res_ptr = untag_ptr(_res);
14718 CHECK_ACCESS(_res_ptr);
14719 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
14720 FREE(untag_ptr(_res));
14721 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
14724 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint64_tArray o) {
14725 LDKCVec_NetAddressZ o_constr;
14726 o_constr.datalen = o->arr_len;
14727 if (o_constr.datalen > 0)
14728 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
14730 o_constr.data = NULL;
14731 uint64_t* o_vals = o->elems;
14732 for (size_t m = 0; m < o_constr.datalen; m++) {
14733 uint64_t o_conv_12 = o_vals[m];
14734 void* o_conv_12_ptr = untag_ptr(o_conv_12);
14735 CHECK_ACCESS(o_conv_12_ptr);
14736 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
14737 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
14738 o_constr.data[m] = o_conv_12_conv;
14741 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14742 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
14743 uint64_t ret_ref = tag_ptr(ret_copy, true);
14747 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() {
14748 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14749 *ret_copy = COption_CVec_NetAddressZZ_none();
14750 uint64_t ret_ref = tag_ptr(ret_copy, true);
14754 void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint64_t _res) {
14755 if (!ptr_is_owned(_res)) return;
14756 void* _res_ptr = untag_ptr(_res);
14757 CHECK_ACCESS(_res_ptr);
14758 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
14759 FREE(untag_ptr(_res));
14760 COption_CVec_NetAddressZZ_free(_res_conv);
14763 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
14764 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14765 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
14766 uint64_t ret_ref = tag_ptr(ret_copy, true);
14769 int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint64_t arg) {
14770 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
14771 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
14775 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_COption_CVec_NetAddressZZ_clone(uint64_t orig) {
14776 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
14777 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
14778 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
14779 uint64_t ret_ref = tag_ptr(ret_copy, true);
14783 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14784 LDKDelayedPaymentOutputDescriptor o_conv;
14785 o_conv.inner = untag_ptr(o);
14786 o_conv.is_owned = ptr_is_owned(o);
14787 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14788 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
14789 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14790 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
14791 return tag_ptr(ret_conv, true);
14794 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14795 LDKDecodeError e_conv;
14796 e_conv.inner = untag_ptr(e);
14797 e_conv.is_owned = ptr_is_owned(e);
14798 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14799 e_conv = DecodeError_clone(&e_conv);
14800 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14801 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
14802 return tag_ptr(ret_conv, true);
14805 jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14806 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14807 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14811 void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14812 if (!ptr_is_owned(_res)) return;
14813 void* _res_ptr = untag_ptr(_res);
14814 CHECK_ACCESS(_res_ptr);
14815 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
14816 FREE(untag_ptr(_res));
14817 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
14820 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14821 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14822 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
14823 return tag_ptr(ret_conv, true);
14825 int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14826 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14827 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14831 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14832 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14833 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
14834 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
14835 return tag_ptr(ret_conv, true);
14838 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14839 LDKStaticPaymentOutputDescriptor o_conv;
14840 o_conv.inner = untag_ptr(o);
14841 o_conv.is_owned = ptr_is_owned(o);
14842 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14843 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
14844 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14845 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
14846 return tag_ptr(ret_conv, true);
14849 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14850 LDKDecodeError e_conv;
14851 e_conv.inner = untag_ptr(e);
14852 e_conv.is_owned = ptr_is_owned(e);
14853 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14854 e_conv = DecodeError_clone(&e_conv);
14855 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14856 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
14857 return tag_ptr(ret_conv, true);
14860 jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14861 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14862 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14866 void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14867 if (!ptr_is_owned(_res)) return;
14868 void* _res_ptr = untag_ptr(_res);
14869 CHECK_ACCESS(_res_ptr);
14870 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
14871 FREE(untag_ptr(_res));
14872 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
14875 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14876 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14877 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
14878 return tag_ptr(ret_conv, true);
14880 int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14881 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14882 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14886 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14887 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14888 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
14889 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
14890 return tag_ptr(ret_conv, true);
14893 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
14894 void* o_ptr = untag_ptr(o);
14895 CHECK_ACCESS(o_ptr);
14896 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
14897 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
14898 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14899 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
14900 return tag_ptr(ret_conv, true);
14903 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14904 LDKDecodeError e_conv;
14905 e_conv.inner = untag_ptr(e);
14906 e_conv.is_owned = ptr_is_owned(e);
14907 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14908 e_conv = DecodeError_clone(&e_conv);
14909 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14910 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
14911 return tag_ptr(ret_conv, true);
14914 jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14915 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14916 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14920 void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14921 if (!ptr_is_owned(_res)) return;
14922 void* _res_ptr = untag_ptr(_res);
14923 CHECK_ACCESS(_res_ptr);
14924 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
14925 FREE(untag_ptr(_res));
14926 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
14929 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14930 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14931 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
14932 return tag_ptr(ret_conv, true);
14934 int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14935 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14936 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14940 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14941 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14942 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14943 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
14944 return tag_ptr(ret_conv, true);
14947 void __attribute__((export_name("TS_CVec_PaymentPreimageZ_free"))) TS_CVec_PaymentPreimageZ_free(ptrArray _res) {
14948 LDKCVec_PaymentPreimageZ _res_constr;
14949 _res_constr.datalen = _res->arr_len;
14950 if (_res_constr.datalen > 0)
14951 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
14953 _res_constr.data = NULL;
14954 int8_tArray* _res_vals = (void*) _res->elems;
14955 for (size_t m = 0; m < _res_constr.datalen; m++) {
14956 int8_tArray _res_conv_12 = _res_vals[m];
14957 LDKThirtyTwoBytes _res_conv_12_ref;
14958 CHECK(_res_conv_12->arr_len == 32);
14959 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
14960 _res_constr.data[m] = _res_conv_12_ref;
14963 CVec_PaymentPreimageZ_free(_res_constr);
14966 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
14967 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14968 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
14969 return tag_ptr(ret_conv, true);
14971 int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint64_t arg) {
14972 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
14973 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
14977 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint64_t orig) {
14978 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
14979 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14980 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
14981 return tag_ptr(ret_conv, true);
14984 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
14985 LDKSignature a_ref;
14986 CHECK(a->arr_len == 64);
14987 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14988 LDKCVec_SignatureZ b_constr;
14989 b_constr.datalen = b->arr_len;
14990 if (b_constr.datalen > 0)
14991 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
14993 b_constr.data = NULL;
14994 int8_tArray* b_vals = (void*) b->elems;
14995 for (size_t m = 0; m < b_constr.datalen; m++) {
14996 int8_tArray b_conv_12 = b_vals[m];
14997 LDKSignature b_conv_12_ref;
14998 CHECK(b_conv_12->arr_len == 64);
14999 memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
15000 b_constr.data[m] = b_conv_12_ref;
15003 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
15004 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
15005 return tag_ptr(ret_conv, true);
15008 void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint64_t _res) {
15009 if (!ptr_is_owned(_res)) return;
15010 void* _res_ptr = untag_ptr(_res);
15011 CHECK_ACCESS(_res_ptr);
15012 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
15013 FREE(untag_ptr(_res));
15014 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
15017 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint64_t o) {
15018 void* o_ptr = untag_ptr(o);
15019 CHECK_ACCESS(o_ptr);
15020 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
15021 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
15022 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15023 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
15024 return tag_ptr(ret_conv, true);
15027 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() {
15028 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15029 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
15030 return tag_ptr(ret_conv, true);
15033 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint64_t o) {
15034 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
15035 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
15039 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint64_t _res) {
15040 if (!ptr_is_owned(_res)) return;
15041 void* _res_ptr = untag_ptr(_res);
15042 CHECK_ACCESS(_res_ptr);
15043 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
15044 FREE(untag_ptr(_res));
15045 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
15048 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
15049 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15050 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
15051 return tag_ptr(ret_conv, true);
15053 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint64_t arg) {
15054 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
15055 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
15059 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint64_t orig) {
15060 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
15061 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
15062 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
15063 return tag_ptr(ret_conv, true);
15066 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) {
15067 LDKSignature o_ref;
15068 CHECK(o->arr_len == 64);
15069 memcpy(o_ref.compact_form, o->elems, 64); FREE(o);
15070 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15071 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
15072 return tag_ptr(ret_conv, true);
15075 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() {
15076 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15077 *ret_conv = CResult_SignatureNoneZ_err();
15078 return tag_ptr(ret_conv, true);
15081 jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint64_t o) {
15082 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
15083 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
15087 void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint64_t _res) {
15088 if (!ptr_is_owned(_res)) return;
15089 void* _res_ptr = untag_ptr(_res);
15090 CHECK_ACCESS(_res_ptr);
15091 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
15092 FREE(untag_ptr(_res));
15093 CResult_SignatureNoneZ_free(_res_conv);
15096 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
15097 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15098 *ret_conv = CResult_SignatureNoneZ_clone(arg);
15099 return tag_ptr(ret_conv, true);
15101 int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint64_t arg) {
15102 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
15103 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
15107 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CResult_SignatureNoneZ_clone(uint64_t orig) {
15108 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
15109 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
15110 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
15111 return tag_ptr(ret_conv, true);
15114 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
15115 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15116 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
15117 return tag_ptr(ret_conv, true);
15119 int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
15120 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
15121 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
15125 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
15126 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
15127 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15128 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
15129 return tag_ptr(ret_conv, true);
15132 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
15133 LDKSignature a_ref;
15134 CHECK(a->arr_len == 64);
15135 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
15136 LDKSignature b_ref;
15137 CHECK(b->arr_len == 64);
15138 memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
15139 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
15140 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
15141 return tag_ptr(ret_conv, true);
15144 void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
15145 if (!ptr_is_owned(_res)) return;
15146 void* _res_ptr = untag_ptr(_res);
15147 CHECK_ACCESS(_res_ptr);
15148 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
15149 FREE(untag_ptr(_res));
15150 C2Tuple_SignatureSignatureZ_free(_res_conv);
15153 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
15154 void* o_ptr = untag_ptr(o);
15155 CHECK_ACCESS(o_ptr);
15156 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
15157 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
15158 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15159 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
15160 return tag_ptr(ret_conv, true);
15163 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
15164 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15165 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
15166 return tag_ptr(ret_conv, true);
15169 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
15170 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
15171 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
15175 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
15176 if (!ptr_is_owned(_res)) return;
15177 void* _res_ptr = untag_ptr(_res);
15178 CHECK_ACCESS(_res_ptr);
15179 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
15180 FREE(untag_ptr(_res));
15181 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
15184 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
15185 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15186 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
15187 return tag_ptr(ret_conv, true);
15189 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
15190 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
15191 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
15195 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
15196 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
15197 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
15198 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
15199 return tag_ptr(ret_conv, true);
15202 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
15203 LDKSecretKey o_ref;
15204 CHECK(o->arr_len == 32);
15205 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
15206 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15207 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
15208 return tag_ptr(ret_conv, true);
15211 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
15212 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15213 *ret_conv = CResult_SecretKeyNoneZ_err();
15214 return tag_ptr(ret_conv, true);
15217 jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
15218 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
15219 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
15223 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
15224 if (!ptr_is_owned(_res)) return;
15225 void* _res_ptr = untag_ptr(_res);
15226 CHECK_ACCESS(_res_ptr);
15227 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
15228 FREE(untag_ptr(_res));
15229 CResult_SecretKeyNoneZ_free(_res_conv);
15232 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
15233 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15234 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
15235 return tag_ptr(ret_conv, true);
15237 int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
15238 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
15239 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
15243 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
15244 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
15245 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
15246 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
15247 return tag_ptr(ret_conv, true);
15250 uint64_t __attribute__((export_name("TS_COption_ScalarZ_some"))) TS_COption_ScalarZ_some(uint64_t o) {
15251 void* o_ptr = untag_ptr(o);
15252 CHECK_ACCESS(o_ptr);
15253 LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
15254 // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
15255 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
15256 *ret_copy = COption_ScalarZ_some(o_conv);
15257 uint64_t ret_ref = tag_ptr(ret_copy, true);
15261 uint64_t __attribute__((export_name("TS_COption_ScalarZ_none"))) TS_COption_ScalarZ_none() {
15262 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
15263 *ret_copy = COption_ScalarZ_none();
15264 uint64_t ret_ref = tag_ptr(ret_copy, true);
15268 void __attribute__((export_name("TS_COption_ScalarZ_free"))) TS_COption_ScalarZ_free(uint64_t _res) {
15269 if (!ptr_is_owned(_res)) return;
15270 void* _res_ptr = untag_ptr(_res);
15271 CHECK_ACCESS(_res_ptr);
15272 LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
15273 FREE(untag_ptr(_res));
15274 COption_ScalarZ_free(_res_conv);
15277 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_ok"))) TS_CResult_SharedSecretNoneZ_ok(int8_tArray o) {
15278 LDKThirtyTwoBytes o_ref;
15279 CHECK(o->arr_len == 32);
15280 memcpy(o_ref.data, o->elems, 32); FREE(o);
15281 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15282 *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
15283 return tag_ptr(ret_conv, true);
15286 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_err"))) TS_CResult_SharedSecretNoneZ_err() {
15287 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15288 *ret_conv = CResult_SharedSecretNoneZ_err();
15289 return tag_ptr(ret_conv, true);
15292 jboolean __attribute__((export_name("TS_CResult_SharedSecretNoneZ_is_ok"))) TS_CResult_SharedSecretNoneZ_is_ok(uint64_t o) {
15293 LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
15294 jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
15298 void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_free"))) TS_CResult_SharedSecretNoneZ_free(uint64_t _res) {
15299 if (!ptr_is_owned(_res)) return;
15300 void* _res_ptr = untag_ptr(_res);
15301 CHECK_ACCESS(_res_ptr);
15302 LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
15303 FREE(untag_ptr(_res));
15304 CResult_SharedSecretNoneZ_free(_res_conv);
15307 static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
15308 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15309 *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
15310 return tag_ptr(ret_conv, true);
15312 int64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone_ptr"))) TS_CResult_SharedSecretNoneZ_clone_ptr(uint64_t arg) {
15313 LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
15314 int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
15318 uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone"))) TS_CResult_SharedSecretNoneZ_clone(uint64_t orig) {
15319 LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
15320 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
15321 *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
15322 return tag_ptr(ret_conv, true);
15325 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
15326 void* o_ptr = untag_ptr(o);
15327 CHECK_ACCESS(o_ptr);
15328 LDKSign o_conv = *(LDKSign*)(o_ptr);
15329 if (o_conv.free == LDKSign_JCalls_free) {
15330 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15331 LDKSign_JCalls_cloned(&o_conv);
15333 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15334 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
15335 return tag_ptr(ret_conv, true);
15338 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
15339 LDKDecodeError e_conv;
15340 e_conv.inner = untag_ptr(e);
15341 e_conv.is_owned = ptr_is_owned(e);
15342 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15343 e_conv = DecodeError_clone(&e_conv);
15344 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15345 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
15346 return tag_ptr(ret_conv, true);
15349 jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
15350 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
15351 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
15355 void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
15356 if (!ptr_is_owned(_res)) return;
15357 void* _res_ptr = untag_ptr(_res);
15358 CHECK_ACCESS(_res_ptr);
15359 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
15360 FREE(untag_ptr(_res));
15361 CResult_SignDecodeErrorZ_free(_res_conv);
15364 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
15365 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15366 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
15367 return tag_ptr(ret_conv, true);
15369 int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
15370 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
15371 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
15375 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
15376 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
15377 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
15378 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
15379 return tag_ptr(ret_conv, true);
15382 void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
15383 LDKCVec_u5Z _res_constr;
15384 _res_constr.datalen = _res->arr_len;
15385 if (_res_constr.datalen > 0)
15386 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
15388 _res_constr.data = NULL;
15389 int8_t* _res_vals = (void*) _res->elems;
15390 for (size_t h = 0; h < _res_constr.datalen; h++) {
15391 int8_t _res_conv_7 = _res_vals[h];
15393 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
15396 CVec_u5Z_free(_res_constr);
15399 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
15400 LDKRecoverableSignature o_ref;
15401 CHECK(o->arr_len == 68);
15402 memcpy(o_ref.serialized_form, o->elems, 68); FREE(o);
15403 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15404 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
15405 return tag_ptr(ret_conv, true);
15408 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() {
15409 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15410 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
15411 return tag_ptr(ret_conv, true);
15414 jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint64_t o) {
15415 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
15416 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
15420 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint64_t _res) {
15421 if (!ptr_is_owned(_res)) return;
15422 void* _res_ptr = untag_ptr(_res);
15423 CHECK_ACCESS(_res_ptr);
15424 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
15425 FREE(untag_ptr(_res));
15426 CResult_RecoverableSignatureNoneZ_free(_res_conv);
15429 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
15430 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15431 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
15432 return tag_ptr(ret_conv, true);
15434 int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint64_t arg) {
15435 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
15436 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
15440 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint64_t orig) {
15441 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
15442 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
15443 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
15444 return tag_ptr(ret_conv, true);
15447 void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
15448 LDKCVec_u8Z _res_ref;
15449 _res_ref.datalen = _res->arr_len;
15450 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
15451 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
15452 CVec_u8Z_free(_res_ref);
15455 void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
15456 LDKCVec_CVec_u8ZZ _res_constr;
15457 _res_constr.datalen = _res->arr_len;
15458 if (_res_constr.datalen > 0)
15459 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
15461 _res_constr.data = NULL;
15462 int8_tArray* _res_vals = (void*) _res->elems;
15463 for (size_t m = 0; m < _res_constr.datalen; m++) {
15464 int8_tArray _res_conv_12 = _res_vals[m];
15465 LDKCVec_u8Z _res_conv_12_ref;
15466 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
15467 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
15468 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
15469 _res_constr.data[m] = _res_conv_12_ref;
15472 CVec_CVec_u8ZZ_free(_res_constr);
15475 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
15476 LDKCVec_CVec_u8ZZ o_constr;
15477 o_constr.datalen = o->arr_len;
15478 if (o_constr.datalen > 0)
15479 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
15481 o_constr.data = NULL;
15482 int8_tArray* o_vals = (void*) o->elems;
15483 for (size_t m = 0; m < o_constr.datalen; m++) {
15484 int8_tArray o_conv_12 = o_vals[m];
15485 LDKCVec_u8Z o_conv_12_ref;
15486 o_conv_12_ref.datalen = o_conv_12->arr_len;
15487 o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
15488 memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
15489 o_constr.data[m] = o_conv_12_ref;
15492 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15493 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
15494 return tag_ptr(ret_conv, true);
15497 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
15498 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15499 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
15500 return tag_ptr(ret_conv, true);
15503 jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint64_t o) {
15504 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
15505 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
15509 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint64_t _res) {
15510 if (!ptr_is_owned(_res)) return;
15511 void* _res_ptr = untag_ptr(_res);
15512 CHECK_ACCESS(_res_ptr);
15513 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
15514 FREE(untag_ptr(_res));
15515 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
15518 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
15519 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15520 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
15521 return tag_ptr(ret_conv, true);
15523 int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint64_t arg) {
15524 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
15525 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
15529 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint64_t orig) {
15530 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
15531 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
15532 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
15533 return tag_ptr(ret_conv, true);
15536 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint64_t o) {
15537 LDKInMemorySigner o_conv;
15538 o_conv.inner = untag_ptr(o);
15539 o_conv.is_owned = ptr_is_owned(o);
15540 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15541 o_conv = InMemorySigner_clone(&o_conv);
15542 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15543 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
15544 return tag_ptr(ret_conv, true);
15547 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
15548 LDKDecodeError e_conv;
15549 e_conv.inner = untag_ptr(e);
15550 e_conv.is_owned = ptr_is_owned(e);
15551 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15552 e_conv = DecodeError_clone(&e_conv);
15553 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15554 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
15555 return tag_ptr(ret_conv, true);
15558 jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint64_t o) {
15559 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
15560 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
15564 void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint64_t _res) {
15565 if (!ptr_is_owned(_res)) return;
15566 void* _res_ptr = untag_ptr(_res);
15567 CHECK_ACCESS(_res_ptr);
15568 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
15569 FREE(untag_ptr(_res));
15570 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
15573 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
15574 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15575 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
15576 return tag_ptr(ret_conv, true);
15578 int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint64_t arg) {
15579 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
15580 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
15584 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint64_t orig) {
15585 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
15586 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
15587 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
15588 return tag_ptr(ret_conv, true);
15591 void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint64_tArray _res) {
15592 LDKCVec_TxOutZ _res_constr;
15593 _res_constr.datalen = _res->arr_len;
15594 if (_res_constr.datalen > 0)
15595 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
15597 _res_constr.data = NULL;
15598 uint64_t* _res_vals = _res->elems;
15599 for (size_t h = 0; h < _res_constr.datalen; h++) {
15600 uint64_t _res_conv_7 = _res_vals[h];
15601 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
15602 CHECK_ACCESS(_res_conv_7_ptr);
15603 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
15604 FREE(untag_ptr(_res_conv_7));
15605 _res_constr.data[h] = _res_conv_7_conv;
15608 CVec_TxOutZ_free(_res_constr);
15611 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
15612 LDKTransaction o_ref;
15613 o_ref.datalen = o->arr_len;
15614 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
15615 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
15616 o_ref.data_is_owned = true;
15617 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15618 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
15619 return tag_ptr(ret_conv, true);
15622 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() {
15623 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15624 *ret_conv = CResult_TransactionNoneZ_err();
15625 return tag_ptr(ret_conv, true);
15628 jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) {
15629 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
15630 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
15634 void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) {
15635 if (!ptr_is_owned(_res)) return;
15636 void* _res_ptr = untag_ptr(_res);
15637 CHECK_ACCESS(_res_ptr);
15638 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
15639 FREE(untag_ptr(_res));
15640 CResult_TransactionNoneZ_free(_res_conv);
15643 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
15644 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15645 *ret_conv = CResult_TransactionNoneZ_clone(arg);
15646 return tag_ptr(ret_conv, true);
15648 int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) {
15649 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
15650 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
15654 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) {
15655 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
15656 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
15657 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
15658 return tag_ptr(ret_conv, true);
15661 uint64_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) {
15662 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15663 *ret_copy = COption_u16Z_some(o);
15664 uint64_t ret_ref = tag_ptr(ret_copy, true);
15668 uint64_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() {
15669 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15670 *ret_copy = COption_u16Z_none();
15671 uint64_t ret_ref = tag_ptr(ret_copy, true);
15675 void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint64_t _res) {
15676 if (!ptr_is_owned(_res)) return;
15677 void* _res_ptr = untag_ptr(_res);
15678 CHECK_ACCESS(_res_ptr);
15679 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
15680 FREE(untag_ptr(_res));
15681 COption_u16Z_free(_res_conv);
15684 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
15685 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15686 *ret_copy = COption_u16Z_clone(arg);
15687 uint64_t ret_ref = tag_ptr(ret_copy, true);
15690 int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint64_t arg) {
15691 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
15692 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
15696 uint64_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_clone(uint64_t orig) {
15697 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
15698 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
15699 *ret_copy = COption_u16Z_clone(orig_conv);
15700 uint64_t ret_ref = tag_ptr(ret_copy, true);
15704 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
15705 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15706 *ret_conv = CResult_NoneAPIErrorZ_ok();
15707 return tag_ptr(ret_conv, true);
15710 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
15711 void* e_ptr = untag_ptr(e);
15712 CHECK_ACCESS(e_ptr);
15713 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15714 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15715 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15716 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
15717 return tag_ptr(ret_conv, true);
15720 jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
15721 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
15722 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
15726 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
15727 if (!ptr_is_owned(_res)) return;
15728 void* _res_ptr = untag_ptr(_res);
15729 CHECK_ACCESS(_res_ptr);
15730 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
15731 FREE(untag_ptr(_res));
15732 CResult_NoneAPIErrorZ_free(_res_conv);
15735 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
15736 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15737 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
15738 return tag_ptr(ret_conv, true);
15740 int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
15741 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
15742 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
15746 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
15747 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
15748 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15749 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
15750 return tag_ptr(ret_conv, true);
15753 void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
15754 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
15755 _res_constr.datalen = _res->arr_len;
15756 if (_res_constr.datalen > 0)
15757 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
15759 _res_constr.data = NULL;
15760 uint64_t* _res_vals = _res->elems;
15761 for (size_t w = 0; w < _res_constr.datalen; w++) {
15762 uint64_t _res_conv_22 = _res_vals[w];
15763 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
15764 CHECK_ACCESS(_res_conv_22_ptr);
15765 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
15766 FREE(untag_ptr(_res_conv_22));
15767 _res_constr.data[w] = _res_conv_22_conv;
15770 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
15773 void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
15774 LDKCVec_APIErrorZ _res_constr;
15775 _res_constr.datalen = _res->arr_len;
15776 if (_res_constr.datalen > 0)
15777 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
15779 _res_constr.data = NULL;
15780 uint64_t* _res_vals = _res->elems;
15781 for (size_t k = 0; k < _res_constr.datalen; k++) {
15782 uint64_t _res_conv_10 = _res_vals[k];
15783 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
15784 CHECK_ACCESS(_res_conv_10_ptr);
15785 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
15786 FREE(untag_ptr(_res_conv_10));
15787 _res_constr.data[k] = _res_conv_10_conv;
15790 CVec_APIErrorZ_free(_res_constr);
15793 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
15794 LDKThirtyTwoBytes o_ref;
15795 CHECK(o->arr_len == 32);
15796 memcpy(o_ref.data, o->elems, 32); FREE(o);
15797 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15798 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
15799 return tag_ptr(ret_conv, true);
15802 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
15803 void* e_ptr = untag_ptr(e);
15804 CHECK_ACCESS(e_ptr);
15805 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15806 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15807 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15808 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
15809 return tag_ptr(ret_conv, true);
15812 jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
15813 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
15814 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
15818 void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
15819 if (!ptr_is_owned(_res)) return;
15820 void* _res_ptr = untag_ptr(_res);
15821 CHECK_ACCESS(_res_ptr);
15822 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
15823 FREE(untag_ptr(_res));
15824 CResult__u832APIErrorZ_free(_res_conv);
15827 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
15828 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15829 *ret_conv = CResult__u832APIErrorZ_clone(arg);
15830 return tag_ptr(ret_conv, true);
15832 int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
15833 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
15834 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
15838 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
15839 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
15840 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
15841 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
15842 return tag_ptr(ret_conv, true);
15845 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
15846 LDKThirtyTwoBytes o_ref;
15847 CHECK(o->arr_len == 32);
15848 memcpy(o_ref.data, o->elems, 32); FREE(o);
15849 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15850 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
15851 return tag_ptr(ret_conv, true);
15854 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
15855 void* e_ptr = untag_ptr(e);
15856 CHECK_ACCESS(e_ptr);
15857 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15858 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15859 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15860 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
15861 return tag_ptr(ret_conv, true);
15864 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
15865 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
15866 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
15870 void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
15871 if (!ptr_is_owned(_res)) return;
15872 void* _res_ptr = untag_ptr(_res);
15873 CHECK_ACCESS(_res_ptr);
15874 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
15875 FREE(untag_ptr(_res));
15876 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
15879 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
15880 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15881 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
15882 return tag_ptr(ret_conv, true);
15884 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
15885 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
15886 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
15890 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
15891 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
15892 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
15893 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
15894 return tag_ptr(ret_conv, true);
15897 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
15898 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15899 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
15900 return tag_ptr(ret_conv, true);
15903 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
15904 void* e_ptr = untag_ptr(e);
15905 CHECK_ACCESS(e_ptr);
15906 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15907 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15908 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15909 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
15910 return tag_ptr(ret_conv, true);
15913 jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
15914 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
15915 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
15919 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
15920 if (!ptr_is_owned(_res)) return;
15921 void* _res_ptr = untag_ptr(_res);
15922 CHECK_ACCESS(_res_ptr);
15923 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
15924 FREE(untag_ptr(_res));
15925 CResult_NonePaymentSendFailureZ_free(_res_conv);
15928 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
15929 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15930 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
15931 return tag_ptr(ret_conv, true);
15933 int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
15934 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
15935 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
15939 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
15940 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
15941 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
15942 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
15943 return tag_ptr(ret_conv, true);
15946 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
15947 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
15948 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
15949 return tag_ptr(ret_conv, true);
15951 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint64_t arg) {
15952 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
15953 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
15957 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint64_t orig) {
15958 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
15959 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
15960 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
15961 return tag_ptr(ret_conv, true);
15964 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
15965 LDKThirtyTwoBytes a_ref;
15966 CHECK(a->arr_len == 32);
15967 memcpy(a_ref.data, a->elems, 32); FREE(a);
15968 LDKThirtyTwoBytes b_ref;
15969 CHECK(b->arr_len == 32);
15970 memcpy(b_ref.data, b->elems, 32); FREE(b);
15971 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
15972 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
15973 return tag_ptr(ret_conv, true);
15976 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint64_t _res) {
15977 if (!ptr_is_owned(_res)) return;
15978 void* _res_ptr = untag_ptr(_res);
15979 CHECK_ACCESS(_res_ptr);
15980 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
15981 FREE(untag_ptr(_res));
15982 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
15985 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint64_t o) {
15986 void* o_ptr = untag_ptr(o);
15987 CHECK_ACCESS(o_ptr);
15988 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
15989 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
15990 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15991 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
15992 return tag_ptr(ret_conv, true);
15995 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint64_t e) {
15996 void* e_ptr = untag_ptr(e);
15997 CHECK_ACCESS(e_ptr);
15998 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15999 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
16000 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16001 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
16002 return tag_ptr(ret_conv, true);
16005 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint64_t o) {
16006 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
16007 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
16011 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint64_t _res) {
16012 if (!ptr_is_owned(_res)) return;
16013 void* _res_ptr = untag_ptr(_res);
16014 CHECK_ACCESS(_res_ptr);
16015 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
16016 FREE(untag_ptr(_res));
16017 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
16020 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
16021 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16022 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
16023 return tag_ptr(ret_conv, true);
16025 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint64_t arg) {
16026 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
16027 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
16031 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint64_t orig) {
16032 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
16033 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
16034 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
16035 return tag_ptr(ret_conv, true);
16038 void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) {
16039 LDKCVec_ThirtyTwoBytesZ _res_constr;
16040 _res_constr.datalen = _res->arr_len;
16041 if (_res_constr.datalen > 0)
16042 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
16044 _res_constr.data = NULL;
16045 int8_tArray* _res_vals = (void*) _res->elems;
16046 for (size_t m = 0; m < _res_constr.datalen; m++) {
16047 int8_tArray _res_conv_12 = _res_vals[m];
16048 LDKThirtyTwoBytes _res_conv_12_ref;
16049 CHECK(_res_conv_12->arr_len == 32);
16050 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
16051 _res_constr.data[m] = _res_conv_12_ref;
16054 CVec_ThirtyTwoBytesZ_free(_res_constr);
16057 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
16058 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16059 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
16060 return tag_ptr(ret_conv, true);
16062 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint64_t arg) {
16063 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
16064 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
16068 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint64_t orig) {
16069 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
16070 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16071 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
16072 return tag_ptr(ret_conv, true);
16075 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
16076 LDKThirtyTwoBytes a_ref;
16077 CHECK(a->arr_len == 32);
16078 memcpy(a_ref.data, a->elems, 32); FREE(a);
16079 LDKThirtyTwoBytes b_ref;
16080 CHECK(b->arr_len == 32);
16081 memcpy(b_ref.data, b->elems, 32); FREE(b);
16082 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
16083 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
16084 return tag_ptr(ret_conv, true);
16087 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint64_t _res) {
16088 if (!ptr_is_owned(_res)) return;
16089 void* _res_ptr = untag_ptr(_res);
16090 CHECK_ACCESS(_res_ptr);
16091 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
16092 FREE(untag_ptr(_res));
16093 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
16096 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint64_t o) {
16097 void* o_ptr = untag_ptr(o);
16098 CHECK_ACCESS(o_ptr);
16099 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
16100 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
16101 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16102 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
16103 return tag_ptr(ret_conv, true);
16106 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
16107 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16108 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
16109 return tag_ptr(ret_conv, true);
16112 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint64_t o) {
16113 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
16114 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
16118 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint64_t _res) {
16119 if (!ptr_is_owned(_res)) return;
16120 void* _res_ptr = untag_ptr(_res);
16121 CHECK_ACCESS(_res_ptr);
16122 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
16123 FREE(untag_ptr(_res));
16124 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
16127 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
16128 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16129 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
16130 return tag_ptr(ret_conv, true);
16132 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint64_t arg) {
16133 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
16134 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
16138 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint64_t orig) {
16139 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
16140 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
16141 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
16142 return tag_ptr(ret_conv, true);
16145 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint64_t o) {
16146 void* o_ptr = untag_ptr(o);
16147 CHECK_ACCESS(o_ptr);
16148 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
16149 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
16150 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16151 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
16152 return tag_ptr(ret_conv, true);
16155 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint64_t e) {
16156 void* e_ptr = untag_ptr(e);
16157 CHECK_ACCESS(e_ptr);
16158 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16159 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16160 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16161 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
16162 return tag_ptr(ret_conv, true);
16165 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint64_t o) {
16166 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
16167 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
16171 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint64_t _res) {
16172 if (!ptr_is_owned(_res)) return;
16173 void* _res_ptr = untag_ptr(_res);
16174 CHECK_ACCESS(_res_ptr);
16175 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
16176 FREE(untag_ptr(_res));
16177 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
16180 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
16181 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16182 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
16183 return tag_ptr(ret_conv, true);
16185 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint64_t arg) {
16186 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
16187 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
16191 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint64_t orig) {
16192 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
16193 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
16194 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
16195 return tag_ptr(ret_conv, true);
16198 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
16199 LDKThirtyTwoBytes o_ref;
16200 CHECK(o->arr_len == 32);
16201 memcpy(o_ref.data, o->elems, 32); FREE(o);
16202 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16203 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
16204 return tag_ptr(ret_conv, true);
16207 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() {
16208 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16209 *ret_conv = CResult_PaymentSecretNoneZ_err();
16210 return tag_ptr(ret_conv, true);
16213 jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint64_t o) {
16214 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
16215 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
16219 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint64_t _res) {
16220 if (!ptr_is_owned(_res)) return;
16221 void* _res_ptr = untag_ptr(_res);
16222 CHECK_ACCESS(_res_ptr);
16223 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
16224 FREE(untag_ptr(_res));
16225 CResult_PaymentSecretNoneZ_free(_res_conv);
16228 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
16229 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16230 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
16231 return tag_ptr(ret_conv, true);
16233 int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint64_t arg) {
16234 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
16235 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
16239 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS_CResult_PaymentSecretNoneZ_clone(uint64_t orig) {
16240 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
16241 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
16242 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
16243 return tag_ptr(ret_conv, true);
16246 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
16247 LDKThirtyTwoBytes o_ref;
16248 CHECK(o->arr_len == 32);
16249 memcpy(o_ref.data, o->elems, 32); FREE(o);
16250 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16251 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
16252 return tag_ptr(ret_conv, true);
16255 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint64_t e) {
16256 void* e_ptr = untag_ptr(e);
16257 CHECK_ACCESS(e_ptr);
16258 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16259 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16260 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16261 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
16262 return tag_ptr(ret_conv, true);
16265 jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint64_t o) {
16266 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
16267 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
16271 void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint64_t _res) {
16272 if (!ptr_is_owned(_res)) return;
16273 void* _res_ptr = untag_ptr(_res);
16274 CHECK_ACCESS(_res_ptr);
16275 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
16276 FREE(untag_ptr(_res));
16277 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
16280 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
16281 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16282 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
16283 return tag_ptr(ret_conv, true);
16285 int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint64_t arg) {
16286 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
16287 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
16291 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint64_t orig) {
16292 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
16293 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
16294 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
16295 return tag_ptr(ret_conv, true);
16298 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
16299 LDKThirtyTwoBytes o_ref;
16300 CHECK(o->arr_len == 32);
16301 memcpy(o_ref.data, o->elems, 32); FREE(o);
16302 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16303 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
16304 return tag_ptr(ret_conv, true);
16307 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint64_t e) {
16308 void* e_ptr = untag_ptr(e);
16309 CHECK_ACCESS(e_ptr);
16310 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16311 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16312 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16313 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
16314 return tag_ptr(ret_conv, true);
16317 jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint64_t o) {
16318 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
16319 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
16323 void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint64_t _res) {
16324 if (!ptr_is_owned(_res)) return;
16325 void* _res_ptr = untag_ptr(_res);
16326 CHECK_ACCESS(_res_ptr);
16327 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
16328 FREE(untag_ptr(_res));
16329 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
16332 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
16333 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16334 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
16335 return tag_ptr(ret_conv, true);
16337 int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint64_t arg) {
16338 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
16339 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
16343 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint64_t orig) {
16344 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
16345 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
16346 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
16347 return tag_ptr(ret_conv, true);
16350 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) {
16351 LDKCounterpartyForwardingInfo o_conv;
16352 o_conv.inner = untag_ptr(o);
16353 o_conv.is_owned = ptr_is_owned(o);
16354 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16355 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
16356 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16357 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
16358 return tag_ptr(ret_conv, true);
16361 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
16362 LDKDecodeError e_conv;
16363 e_conv.inner = untag_ptr(e);
16364 e_conv.is_owned = ptr_is_owned(e);
16365 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16366 e_conv = DecodeError_clone(&e_conv);
16367 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16368 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
16369 return tag_ptr(ret_conv, true);
16372 jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) {
16373 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
16374 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
16378 void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) {
16379 if (!ptr_is_owned(_res)) return;
16380 void* _res_ptr = untag_ptr(_res);
16381 CHECK_ACCESS(_res_ptr);
16382 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
16383 FREE(untag_ptr(_res));
16384 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
16387 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
16388 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16389 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
16390 return tag_ptr(ret_conv, true);
16392 int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
16393 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
16394 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
16398 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) {
16399 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
16400 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
16401 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
16402 return tag_ptr(ret_conv, true);
16405 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) {
16406 LDKChannelCounterparty o_conv;
16407 o_conv.inner = untag_ptr(o);
16408 o_conv.is_owned = ptr_is_owned(o);
16409 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16410 o_conv = ChannelCounterparty_clone(&o_conv);
16411 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16412 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
16413 return tag_ptr(ret_conv, true);
16416 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
16417 LDKDecodeError e_conv;
16418 e_conv.inner = untag_ptr(e);
16419 e_conv.is_owned = ptr_is_owned(e);
16420 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16421 e_conv = DecodeError_clone(&e_conv);
16422 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16423 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
16424 return tag_ptr(ret_conv, true);
16427 jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) {
16428 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
16429 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
16433 void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) {
16434 if (!ptr_is_owned(_res)) return;
16435 void* _res_ptr = untag_ptr(_res);
16436 CHECK_ACCESS(_res_ptr);
16437 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
16438 FREE(untag_ptr(_res));
16439 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
16442 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
16443 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16444 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
16445 return tag_ptr(ret_conv, true);
16447 int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) {
16448 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
16449 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
16453 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) {
16454 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
16455 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
16456 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
16457 return tag_ptr(ret_conv, true);
16460 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) {
16461 LDKChannelDetails o_conv;
16462 o_conv.inner = untag_ptr(o);
16463 o_conv.is_owned = ptr_is_owned(o);
16464 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16465 o_conv = ChannelDetails_clone(&o_conv);
16466 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16467 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
16468 return tag_ptr(ret_conv, true);
16471 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
16472 LDKDecodeError e_conv;
16473 e_conv.inner = untag_ptr(e);
16474 e_conv.is_owned = ptr_is_owned(e);
16475 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16476 e_conv = DecodeError_clone(&e_conv);
16477 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16478 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
16479 return tag_ptr(ret_conv, true);
16482 jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) {
16483 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
16484 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
16488 void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) {
16489 if (!ptr_is_owned(_res)) return;
16490 void* _res_ptr = untag_ptr(_res);
16491 CHECK_ACCESS(_res_ptr);
16492 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
16493 FREE(untag_ptr(_res));
16494 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
16497 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
16498 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16499 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
16500 return tag_ptr(ret_conv, true);
16502 int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) {
16503 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
16504 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
16508 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) {
16509 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
16510 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
16511 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
16512 return tag_ptr(ret_conv, true);
16515 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) {
16516 LDKPhantomRouteHints o_conv;
16517 o_conv.inner = untag_ptr(o);
16518 o_conv.is_owned = ptr_is_owned(o);
16519 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16520 o_conv = PhantomRouteHints_clone(&o_conv);
16521 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16522 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
16523 return tag_ptr(ret_conv, true);
16526 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) {
16527 LDKDecodeError e_conv;
16528 e_conv.inner = untag_ptr(e);
16529 e_conv.is_owned = ptr_is_owned(e);
16530 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16531 e_conv = DecodeError_clone(&e_conv);
16532 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16533 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
16534 return tag_ptr(ret_conv, true);
16537 jboolean __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(uint64_t o) {
16538 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
16539 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
16543 void __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_free"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_free(uint64_t _res) {
16544 if (!ptr_is_owned(_res)) return;
16545 void* _res_ptr = untag_ptr(_res);
16546 CHECK_ACCESS(_res_ptr);
16547 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
16548 FREE(untag_ptr(_res));
16549 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
16552 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
16553 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16554 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
16555 return tag_ptr(ret_conv, true);
16557 int64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(uint64_t arg) {
16558 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
16559 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
16563 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone(uint64_t orig) {
16564 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
16565 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
16566 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
16567 return tag_ptr(ret_conv, true);
16570 void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) {
16571 LDKCVec_ChannelMonitorZ _res_constr;
16572 _res_constr.datalen = _res->arr_len;
16573 if (_res_constr.datalen > 0)
16574 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
16576 _res_constr.data = NULL;
16577 uint64_t* _res_vals = _res->elems;
16578 for (size_t q = 0; q < _res_constr.datalen; q++) {
16579 uint64_t _res_conv_16 = _res_vals[q];
16580 LDKChannelMonitor _res_conv_16_conv;
16581 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
16582 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
16583 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
16584 _res_constr.data[q] = _res_conv_16_conv;
16587 CVec_ChannelMonitorZ_free(_res_constr);
16590 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint64_t b) {
16591 LDKThirtyTwoBytes a_ref;
16592 CHECK(a->arr_len == 32);
16593 memcpy(a_ref.data, a->elems, 32); FREE(a);
16594 LDKChannelManager b_conv;
16595 b_conv.inner = untag_ptr(b);
16596 b_conv.is_owned = ptr_is_owned(b);
16597 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
16598 // WARNING: we need a move here but no clone is available for LDKChannelManager
16600 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
16601 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
16602 return tag_ptr(ret_conv, true);
16605 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint64_t _res) {
16606 if (!ptr_is_owned(_res)) return;
16607 void* _res_ptr = untag_ptr(_res);
16608 CHECK_ACCESS(_res_ptr);
16609 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
16610 FREE(untag_ptr(_res));
16611 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
16614 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint64_t o) {
16615 void* o_ptr = untag_ptr(o);
16616 CHECK_ACCESS(o_ptr);
16617 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
16618 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
16619 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
16620 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
16621 return tag_ptr(ret_conv, true);
16624 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
16625 LDKDecodeError e_conv;
16626 e_conv.inner = untag_ptr(e);
16627 e_conv.is_owned = ptr_is_owned(e);
16628 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16629 e_conv = DecodeError_clone(&e_conv);
16630 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
16631 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
16632 return tag_ptr(ret_conv, true);
16635 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint64_t o) {
16636 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
16637 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
16641 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint64_t _res) {
16642 if (!ptr_is_owned(_res)) return;
16643 void* _res_ptr = untag_ptr(_res);
16644 CHECK_ACCESS(_res_ptr);
16645 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
16646 FREE(untag_ptr(_res));
16647 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
16650 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint64_t o) {
16651 LDKChannelConfig o_conv;
16652 o_conv.inner = untag_ptr(o);
16653 o_conv.is_owned = ptr_is_owned(o);
16654 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16655 o_conv = ChannelConfig_clone(&o_conv);
16656 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16657 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
16658 return tag_ptr(ret_conv, true);
16661 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
16662 LDKDecodeError e_conv;
16663 e_conv.inner = untag_ptr(e);
16664 e_conv.is_owned = ptr_is_owned(e);
16665 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16666 e_conv = DecodeError_clone(&e_conv);
16667 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16668 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
16669 return tag_ptr(ret_conv, true);
16672 jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint64_t o) {
16673 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
16674 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
16678 void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint64_t _res) {
16679 if (!ptr_is_owned(_res)) return;
16680 void* _res_ptr = untag_ptr(_res);
16681 CHECK_ACCESS(_res_ptr);
16682 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
16683 FREE(untag_ptr(_res));
16684 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
16687 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
16688 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16689 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
16690 return tag_ptr(ret_conv, true);
16692 int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint64_t arg) {
16693 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
16694 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
16698 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint64_t orig) {
16699 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
16700 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
16701 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
16702 return tag_ptr(ret_conv, true);
16705 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
16706 LDKOutPoint o_conv;
16707 o_conv.inner = untag_ptr(o);
16708 o_conv.is_owned = ptr_is_owned(o);
16709 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16710 o_conv = OutPoint_clone(&o_conv);
16711 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16712 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
16713 return tag_ptr(ret_conv, true);
16716 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
16717 LDKDecodeError e_conv;
16718 e_conv.inner = untag_ptr(e);
16719 e_conv.is_owned = ptr_is_owned(e);
16720 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16721 e_conv = DecodeError_clone(&e_conv);
16722 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16723 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
16724 return tag_ptr(ret_conv, true);
16727 jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) {
16728 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
16729 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
16733 void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) {
16734 if (!ptr_is_owned(_res)) return;
16735 void* _res_ptr = untag_ptr(_res);
16736 CHECK_ACCESS(_res_ptr);
16737 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
16738 FREE(untag_ptr(_res));
16739 CResult_OutPointDecodeErrorZ_free(_res_conv);
16742 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
16743 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16744 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
16745 return tag_ptr(ret_conv, true);
16747 int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) {
16748 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
16749 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
16753 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) {
16754 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
16755 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
16756 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
16757 return tag_ptr(ret_conv, true);
16760 uint64_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint64_t o) {
16761 void* o_ptr = untag_ptr(o);
16762 CHECK_ACCESS(o_ptr);
16763 LDKType o_conv = *(LDKType*)(o_ptr);
16764 if (o_conv.free == LDKType_JCalls_free) {
16765 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
16766 LDKType_JCalls_cloned(&o_conv);
16768 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16769 *ret_copy = COption_TypeZ_some(o_conv);
16770 uint64_t ret_ref = tag_ptr(ret_copy, true);
16774 uint64_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() {
16775 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16776 *ret_copy = COption_TypeZ_none();
16777 uint64_t ret_ref = tag_ptr(ret_copy, true);
16781 void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint64_t _res) {
16782 if (!ptr_is_owned(_res)) return;
16783 void* _res_ptr = untag_ptr(_res);
16784 CHECK_ACCESS(_res_ptr);
16785 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
16786 FREE(untag_ptr(_res));
16787 COption_TypeZ_free(_res_conv);
16790 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
16791 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16792 *ret_copy = COption_TypeZ_clone(arg);
16793 uint64_t ret_ref = tag_ptr(ret_copy, true);
16796 int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint64_t arg) {
16797 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
16798 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
16802 uint64_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_TypeZ_clone(uint64_t orig) {
16803 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
16804 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
16805 *ret_copy = COption_TypeZ_clone(orig_conv);
16806 uint64_t ret_ref = tag_ptr(ret_copy, true);
16810 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint64_t o) {
16811 void* o_ptr = untag_ptr(o);
16812 CHECK_ACCESS(o_ptr);
16813 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
16814 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
16815 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16816 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
16817 return tag_ptr(ret_conv, true);
16820 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
16821 LDKDecodeError e_conv;
16822 e_conv.inner = untag_ptr(e);
16823 e_conv.is_owned = ptr_is_owned(e);
16824 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16825 e_conv = DecodeError_clone(&e_conv);
16826 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16827 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
16828 return tag_ptr(ret_conv, true);
16831 jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint64_t o) {
16832 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
16833 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
16837 void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint64_t _res) {
16838 if (!ptr_is_owned(_res)) return;
16839 void* _res_ptr = untag_ptr(_res);
16840 CHECK_ACCESS(_res_ptr);
16841 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
16842 FREE(untag_ptr(_res));
16843 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
16846 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
16847 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16848 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
16849 return tag_ptr(ret_conv, true);
16851 int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint64_t arg) {
16852 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
16853 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
16857 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint64_t orig) {
16858 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
16859 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
16860 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
16861 return tag_ptr(ret_conv, true);
16864 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_ok"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
16865 LDKThirtyTwoBytes o_ref;
16866 CHECK(o->arr_len == 32);
16867 memcpy(o_ref.data, o->elems, 32); FREE(o);
16868 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16869 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
16870 return tag_ptr(ret_conv, true);
16873 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_err"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint64_t e) {
16874 void* e_ptr = untag_ptr(e);
16875 CHECK_ACCESS(e_ptr);
16876 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
16877 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
16878 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16879 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
16880 return tag_ptr(ret_conv, true);
16883 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_is_ok"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint64_t o) {
16884 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
16885 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
16889 void __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_free"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint64_t _res) {
16890 if (!ptr_is_owned(_res)) return;
16891 void* _res_ptr = untag_ptr(_res);
16892 CHECK_ACCESS(_res_ptr);
16893 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
16894 FREE(untag_ptr(_res));
16895 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
16898 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
16899 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16900 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
16901 return tag_ptr(ret_conv, true);
16903 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone_ptr"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint64_t arg) {
16904 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
16905 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
16909 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint64_t orig) {
16910 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
16911 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
16912 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
16913 return tag_ptr(ret_conv, true);
16916 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_ok(uint64_t o) {
16917 LDKInFlightHtlcs o_conv;
16918 o_conv.inner = untag_ptr(o);
16919 o_conv.is_owned = ptr_is_owned(o);
16920 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16921 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
16923 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
16924 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
16925 return tag_ptr(ret_conv, true);
16928 uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_err(uint64_t e) {
16929 LDKDecodeError e_conv;
16930 e_conv.inner = untag_ptr(e);
16931 e_conv.is_owned = ptr_is_owned(e);
16932 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16933 e_conv = DecodeError_clone(&e_conv);
16934 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
16935 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
16936 return tag_ptr(ret_conv, true);
16939 jboolean __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok(uint64_t o) {
16940 LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
16941 jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
16945 void __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_free"))) TS_CResult_InFlightHtlcsDecodeErrorZ_free(uint64_t _res) {
16946 if (!ptr_is_owned(_res)) return;
16947 void* _res_ptr = untag_ptr(_res);
16948 CHECK_ACCESS(_res_ptr);
16949 LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
16950 FREE(untag_ptr(_res));
16951 CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
16954 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
16955 LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
16956 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
16957 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
16958 return tag_ptr(ret_conv, true);
16961 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
16962 void* e_ptr = untag_ptr(e);
16963 CHECK_ACCESS(e_ptr);
16964 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
16965 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
16966 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
16967 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
16968 return tag_ptr(ret_conv, true);
16971 jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
16972 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
16973 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
16977 void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
16978 if (!ptr_is_owned(_res)) return;
16979 void* _res_ptr = untag_ptr(_res);
16980 CHECK_ACCESS(_res_ptr);
16981 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
16982 FREE(untag_ptr(_res));
16983 CResult_SiPrefixParseErrorZ_free(_res_conv);
16986 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
16987 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
16988 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
16989 return tag_ptr(ret_conv, true);
16991 int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
16992 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
16993 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
16997 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
16998 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
16999 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
17000 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
17001 return tag_ptr(ret_conv, true);
17004 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
17006 o_conv.inner = untag_ptr(o);
17007 o_conv.is_owned = ptr_is_owned(o);
17008 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17009 o_conv = Invoice_clone(&o_conv);
17010 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17011 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
17012 return tag_ptr(ret_conv, true);
17015 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
17016 void* e_ptr = untag_ptr(e);
17017 CHECK_ACCESS(e_ptr);
17018 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
17019 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
17020 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17021 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
17022 return tag_ptr(ret_conv, true);
17025 jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
17026 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
17027 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
17031 void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
17032 if (!ptr_is_owned(_res)) return;
17033 void* _res_ptr = untag_ptr(_res);
17034 CHECK_ACCESS(_res_ptr);
17035 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
17036 FREE(untag_ptr(_res));
17037 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
17040 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
17041 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17042 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
17043 return tag_ptr(ret_conv, true);
17045 int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
17046 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
17047 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
17051 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
17052 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
17053 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
17054 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
17055 return tag_ptr(ret_conv, true);
17058 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
17059 LDKSignedRawInvoice o_conv;
17060 o_conv.inner = untag_ptr(o);
17061 o_conv.is_owned = ptr_is_owned(o);
17062 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17063 o_conv = SignedRawInvoice_clone(&o_conv);
17064 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17065 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
17066 return tag_ptr(ret_conv, true);
17069 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
17070 void* e_ptr = untag_ptr(e);
17071 CHECK_ACCESS(e_ptr);
17072 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
17073 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
17074 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17075 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
17076 return tag_ptr(ret_conv, true);
17079 jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
17080 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
17081 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
17085 void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
17086 if (!ptr_is_owned(_res)) return;
17087 void* _res_ptr = untag_ptr(_res);
17088 CHECK_ACCESS(_res_ptr);
17089 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
17090 FREE(untag_ptr(_res));
17091 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
17094 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
17095 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17096 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
17097 return tag_ptr(ret_conv, true);
17099 int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
17100 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
17101 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
17105 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
17106 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
17107 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
17108 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
17109 return tag_ptr(ret_conv, true);
17112 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
17113 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17114 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
17115 return tag_ptr(ret_conv, true);
17117 int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
17118 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
17119 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
17123 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
17124 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
17125 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17126 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
17127 return tag_ptr(ret_conv, true);
17130 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
17131 LDKRawInvoice a_conv;
17132 a_conv.inner = untag_ptr(a);
17133 a_conv.is_owned = ptr_is_owned(a);
17134 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17135 a_conv = RawInvoice_clone(&a_conv);
17136 LDKThirtyTwoBytes b_ref;
17137 CHECK(b->arr_len == 32);
17138 memcpy(b_ref.data, b->elems, 32); FREE(b);
17139 LDKInvoiceSignature c_conv;
17140 c_conv.inner = untag_ptr(c);
17141 c_conv.is_owned = ptr_is_owned(c);
17142 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
17143 c_conv = InvoiceSignature_clone(&c_conv);
17144 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
17145 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
17146 return tag_ptr(ret_conv, true);
17149 void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
17150 if (!ptr_is_owned(_res)) return;
17151 void* _res_ptr = untag_ptr(_res);
17152 CHECK_ACCESS(_res_ptr);
17153 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
17154 FREE(untag_ptr(_res));
17155 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
17158 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
17159 LDKPayeePubKey o_conv;
17160 o_conv.inner = untag_ptr(o);
17161 o_conv.is_owned = ptr_is_owned(o);
17162 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17163 o_conv = PayeePubKey_clone(&o_conv);
17164 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17165 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
17166 return tag_ptr(ret_conv, true);
17169 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
17170 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
17171 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17172 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
17173 return tag_ptr(ret_conv, true);
17176 jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
17177 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
17178 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
17182 void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
17183 if (!ptr_is_owned(_res)) return;
17184 void* _res_ptr = untag_ptr(_res);
17185 CHECK_ACCESS(_res_ptr);
17186 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
17187 FREE(untag_ptr(_res));
17188 CResult_PayeePubKeyErrorZ_free(_res_conv);
17191 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
17192 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17193 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
17194 return tag_ptr(ret_conv, true);
17196 int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
17197 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
17198 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
17202 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
17203 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
17204 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
17205 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
17206 return tag_ptr(ret_conv, true);
17209 void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
17210 LDKCVec_PrivateRouteZ _res_constr;
17211 _res_constr.datalen = _res->arr_len;
17212 if (_res_constr.datalen > 0)
17213 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
17215 _res_constr.data = NULL;
17216 uint64_t* _res_vals = _res->elems;
17217 for (size_t o = 0; o < _res_constr.datalen; o++) {
17218 uint64_t _res_conv_14 = _res_vals[o];
17219 LDKPrivateRoute _res_conv_14_conv;
17220 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
17221 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
17222 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
17223 _res_constr.data[o] = _res_conv_14_conv;
17226 CVec_PrivateRouteZ_free(_res_constr);
17229 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
17230 LDKPositiveTimestamp o_conv;
17231 o_conv.inner = untag_ptr(o);
17232 o_conv.is_owned = ptr_is_owned(o);
17233 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17234 o_conv = PositiveTimestamp_clone(&o_conv);
17235 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17236 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
17237 return tag_ptr(ret_conv, true);
17240 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
17241 LDKCreationError e_conv = LDKCreationError_from_js(e);
17242 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17243 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
17244 return tag_ptr(ret_conv, true);
17247 jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
17248 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
17249 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
17253 void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
17254 if (!ptr_is_owned(_res)) return;
17255 void* _res_ptr = untag_ptr(_res);
17256 CHECK_ACCESS(_res_ptr);
17257 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
17258 FREE(untag_ptr(_res));
17259 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
17262 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
17263 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17264 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
17265 return tag_ptr(ret_conv, true);
17267 int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
17268 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
17269 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
17273 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
17274 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
17275 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
17276 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
17277 return tag_ptr(ret_conv, true);
17280 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
17281 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17282 *ret_conv = CResult_NoneSemanticErrorZ_ok();
17283 return tag_ptr(ret_conv, true);
17286 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
17287 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
17288 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17289 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
17290 return tag_ptr(ret_conv, true);
17293 jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
17294 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
17295 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
17299 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
17300 if (!ptr_is_owned(_res)) return;
17301 void* _res_ptr = untag_ptr(_res);
17302 CHECK_ACCESS(_res_ptr);
17303 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
17304 FREE(untag_ptr(_res));
17305 CResult_NoneSemanticErrorZ_free(_res_conv);
17308 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
17309 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17310 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
17311 return tag_ptr(ret_conv, true);
17313 int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
17314 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
17315 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
17319 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
17320 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
17321 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
17322 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
17323 return tag_ptr(ret_conv, true);
17326 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
17328 o_conv.inner = untag_ptr(o);
17329 o_conv.is_owned = ptr_is_owned(o);
17330 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17331 o_conv = Invoice_clone(&o_conv);
17332 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17333 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
17334 return tag_ptr(ret_conv, true);
17337 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
17338 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
17339 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17340 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
17341 return tag_ptr(ret_conv, true);
17344 jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
17345 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
17346 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
17350 void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
17351 if (!ptr_is_owned(_res)) return;
17352 void* _res_ptr = untag_ptr(_res);
17353 CHECK_ACCESS(_res_ptr);
17354 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
17355 FREE(untag_ptr(_res));
17356 CResult_InvoiceSemanticErrorZ_free(_res_conv);
17359 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
17360 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17361 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
17362 return tag_ptr(ret_conv, true);
17364 int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
17365 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
17366 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
17370 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
17371 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
17372 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
17373 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
17374 return tag_ptr(ret_conv, true);
17377 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
17378 LDKDescription o_conv;
17379 o_conv.inner = untag_ptr(o);
17380 o_conv.is_owned = ptr_is_owned(o);
17381 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17382 o_conv = Description_clone(&o_conv);
17383 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17384 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
17385 return tag_ptr(ret_conv, true);
17388 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
17389 LDKCreationError e_conv = LDKCreationError_from_js(e);
17390 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17391 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
17392 return tag_ptr(ret_conv, true);
17395 jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
17396 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
17397 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
17401 void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
17402 if (!ptr_is_owned(_res)) return;
17403 void* _res_ptr = untag_ptr(_res);
17404 CHECK_ACCESS(_res_ptr);
17405 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
17406 FREE(untag_ptr(_res));
17407 CResult_DescriptionCreationErrorZ_free(_res_conv);
17410 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
17411 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17412 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
17413 return tag_ptr(ret_conv, true);
17415 int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
17416 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
17417 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
17421 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
17422 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
17423 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
17424 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
17425 return tag_ptr(ret_conv, true);
17428 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
17429 LDKPrivateRoute o_conv;
17430 o_conv.inner = untag_ptr(o);
17431 o_conv.is_owned = ptr_is_owned(o);
17432 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17433 o_conv = PrivateRoute_clone(&o_conv);
17434 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17435 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
17436 return tag_ptr(ret_conv, true);
17439 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
17440 LDKCreationError e_conv = LDKCreationError_from_js(e);
17441 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17442 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
17443 return tag_ptr(ret_conv, true);
17446 jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
17447 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
17448 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
17452 void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
17453 if (!ptr_is_owned(_res)) return;
17454 void* _res_ptr = untag_ptr(_res);
17455 CHECK_ACCESS(_res_ptr);
17456 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
17457 FREE(untag_ptr(_res));
17458 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
17461 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
17462 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17463 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
17464 return tag_ptr(ret_conv, true);
17466 int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
17467 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
17468 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
17472 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
17473 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
17474 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
17475 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
17476 return tag_ptr(ret_conv, true);
17479 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
17480 LDKStr o_conv = str_ref_to_owned_c(o);
17481 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17482 *ret_conv = CResult_StringErrorZ_ok(o_conv);
17483 return tag_ptr(ret_conv, true);
17486 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
17487 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
17488 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17489 *ret_conv = CResult_StringErrorZ_err(e_conv);
17490 return tag_ptr(ret_conv, true);
17493 jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
17494 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
17495 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
17499 void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
17500 if (!ptr_is_owned(_res)) return;
17501 void* _res_ptr = untag_ptr(_res);
17502 CHECK_ACCESS(_res_ptr);
17503 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
17504 FREE(untag_ptr(_res));
17505 CResult_StringErrorZ_free(_res_conv);
17508 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
17509 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17510 *ret_conv = CResult_StringErrorZ_clone(arg);
17511 return tag_ptr(ret_conv, true);
17513 int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
17514 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
17515 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
17519 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
17520 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
17521 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
17522 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
17523 return tag_ptr(ret_conv, true);
17526 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
17527 LDKChannelMonitorUpdate o_conv;
17528 o_conv.inner = untag_ptr(o);
17529 o_conv.is_owned = ptr_is_owned(o);
17530 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17531 o_conv = ChannelMonitorUpdate_clone(&o_conv);
17532 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17533 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
17534 return tag_ptr(ret_conv, true);
17537 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
17538 LDKDecodeError e_conv;
17539 e_conv.inner = untag_ptr(e);
17540 e_conv.is_owned = ptr_is_owned(e);
17541 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17542 e_conv = DecodeError_clone(&e_conv);
17543 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17544 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
17545 return tag_ptr(ret_conv, true);
17548 jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
17549 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
17550 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
17554 void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
17555 if (!ptr_is_owned(_res)) return;
17556 void* _res_ptr = untag_ptr(_res);
17557 CHECK_ACCESS(_res_ptr);
17558 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
17559 FREE(untag_ptr(_res));
17560 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
17563 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
17564 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17565 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
17566 return tag_ptr(ret_conv, true);
17568 int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
17569 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
17570 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
17574 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
17575 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
17576 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
17577 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
17578 return tag_ptr(ret_conv, true);
17581 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
17582 void* o_ptr = untag_ptr(o);
17583 CHECK_ACCESS(o_ptr);
17584 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
17585 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
17586 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17587 *ret_copy = COption_MonitorEventZ_some(o_conv);
17588 uint64_t ret_ref = tag_ptr(ret_copy, true);
17592 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
17593 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17594 *ret_copy = COption_MonitorEventZ_none();
17595 uint64_t ret_ref = tag_ptr(ret_copy, true);
17599 void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
17600 if (!ptr_is_owned(_res)) return;
17601 void* _res_ptr = untag_ptr(_res);
17602 CHECK_ACCESS(_res_ptr);
17603 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
17604 FREE(untag_ptr(_res));
17605 COption_MonitorEventZ_free(_res_conv);
17608 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
17609 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17610 *ret_copy = COption_MonitorEventZ_clone(arg);
17611 uint64_t ret_ref = tag_ptr(ret_copy, true);
17614 int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
17615 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
17616 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
17620 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
17621 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
17622 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
17623 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
17624 uint64_t ret_ref = tag_ptr(ret_copy, true);
17628 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
17629 void* o_ptr = untag_ptr(o);
17630 CHECK_ACCESS(o_ptr);
17631 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
17632 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
17633 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17634 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
17635 return tag_ptr(ret_conv, true);
17638 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
17639 LDKDecodeError e_conv;
17640 e_conv.inner = untag_ptr(e);
17641 e_conv.is_owned = ptr_is_owned(e);
17642 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17643 e_conv = DecodeError_clone(&e_conv);
17644 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17645 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
17646 return tag_ptr(ret_conv, true);
17649 jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
17650 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
17651 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
17655 void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
17656 if (!ptr_is_owned(_res)) return;
17657 void* _res_ptr = untag_ptr(_res);
17658 CHECK_ACCESS(_res_ptr);
17659 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
17660 FREE(untag_ptr(_res));
17661 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
17664 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
17665 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17666 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
17667 return tag_ptr(ret_conv, true);
17669 int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
17670 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
17671 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
17675 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
17676 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
17677 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
17678 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
17679 return tag_ptr(ret_conv, true);
17682 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
17683 LDKHTLCUpdate o_conv;
17684 o_conv.inner = untag_ptr(o);
17685 o_conv.is_owned = ptr_is_owned(o);
17686 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17687 o_conv = HTLCUpdate_clone(&o_conv);
17688 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17689 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
17690 return tag_ptr(ret_conv, true);
17693 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
17694 LDKDecodeError e_conv;
17695 e_conv.inner = untag_ptr(e);
17696 e_conv.is_owned = ptr_is_owned(e);
17697 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17698 e_conv = DecodeError_clone(&e_conv);
17699 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17700 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
17701 return tag_ptr(ret_conv, true);
17704 jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint64_t o) {
17705 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
17706 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
17710 void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint64_t _res) {
17711 if (!ptr_is_owned(_res)) return;
17712 void* _res_ptr = untag_ptr(_res);
17713 CHECK_ACCESS(_res_ptr);
17714 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
17715 FREE(untag_ptr(_res));
17716 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
17719 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
17720 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17721 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
17722 return tag_ptr(ret_conv, true);
17724 int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
17725 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
17726 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
17730 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint64_t orig) {
17731 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
17732 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
17733 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
17734 return tag_ptr(ret_conv, true);
17737 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
17738 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17739 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
17740 return tag_ptr(ret_conv, true);
17742 int64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone_ptr"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint64_t arg) {
17743 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
17744 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
17748 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone"))) TS_C2Tuple_OutPointScriptZ_clone(uint64_t orig) {
17749 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
17750 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17751 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
17752 return tag_ptr(ret_conv, true);
17755 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint64_t a, int8_tArray b) {
17756 LDKOutPoint a_conv;
17757 a_conv.inner = untag_ptr(a);
17758 a_conv.is_owned = ptr_is_owned(a);
17759 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17760 a_conv = OutPoint_clone(&a_conv);
17762 b_ref.datalen = b->arr_len;
17763 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
17764 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
17765 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
17766 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
17767 return tag_ptr(ret_conv, true);
17770 void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint64_t _res) {
17771 if (!ptr_is_owned(_res)) return;
17772 void* _res_ptr = untag_ptr(_res);
17773 CHECK_ACCESS(_res_ptr);
17774 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
17775 FREE(untag_ptr(_res));
17776 C2Tuple_OutPointScriptZ_free(_res_conv);
17779 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
17780 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17781 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
17782 return tag_ptr(ret_conv, true);
17784 int64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone_ptr"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint64_t arg) {
17785 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
17786 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
17790 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone"))) TS_C2Tuple_u32ScriptZ_clone(uint64_t orig) {
17791 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
17792 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17793 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
17794 return tag_ptr(ret_conv, true);
17797 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
17799 b_ref.datalen = b->arr_len;
17800 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
17801 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
17802 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
17803 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
17804 return tag_ptr(ret_conv, true);
17807 void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint64_t _res) {
17808 if (!ptr_is_owned(_res)) return;
17809 void* _res_ptr = untag_ptr(_res);
17810 CHECK_ACCESS(_res_ptr);
17811 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
17812 FREE(untag_ptr(_res));
17813 C2Tuple_u32ScriptZ_free(_res_conv);
17816 void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint64_tArray _res) {
17817 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
17818 _res_constr.datalen = _res->arr_len;
17819 if (_res_constr.datalen > 0)
17820 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
17822 _res_constr.data = NULL;
17823 uint64_t* _res_vals = _res->elems;
17824 for (size_t v = 0; v < _res_constr.datalen; v++) {
17825 uint64_t _res_conv_21 = _res_vals[v];
17826 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
17827 CHECK_ACCESS(_res_conv_21_ptr);
17828 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
17829 FREE(untag_ptr(_res_conv_21));
17830 _res_constr.data[v] = _res_conv_21_conv;
17833 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
17836 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
17837 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17838 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
17839 return tag_ptr(ret_conv, true);
17841 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint64_t arg) {
17842 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
17843 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
17847 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint64_t orig) {
17848 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
17849 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17850 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
17851 return tag_ptr(ret_conv, true);
17854 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint64_tArray b) {
17855 LDKThirtyTwoBytes a_ref;
17856 CHECK(a->arr_len == 32);
17857 memcpy(a_ref.data, a->elems, 32); FREE(a);
17858 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
17859 b_constr.datalen = b->arr_len;
17860 if (b_constr.datalen > 0)
17861 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
17863 b_constr.data = NULL;
17864 uint64_t* b_vals = b->elems;
17865 for (size_t v = 0; v < b_constr.datalen; v++) {
17866 uint64_t b_conv_21 = b_vals[v];
17867 void* b_conv_21_ptr = untag_ptr(b_conv_21);
17868 CHECK_ACCESS(b_conv_21_ptr);
17869 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
17870 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
17871 b_constr.data[v] = b_conv_21_conv;
17874 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
17875 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
17876 return tag_ptr(ret_conv, true);
17879 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint64_t _res) {
17880 if (!ptr_is_owned(_res)) return;
17881 void* _res_ptr = untag_ptr(_res);
17882 CHECK_ACCESS(_res_ptr);
17883 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
17884 FREE(untag_ptr(_res));
17885 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
17888 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint64_tArray _res) {
17889 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
17890 _res_constr.datalen = _res->arr_len;
17891 if (_res_constr.datalen > 0)
17892 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
17894 _res_constr.data = NULL;
17895 uint64_t* _res_vals = _res->elems;
17896 for (size_t o = 0; o < _res_constr.datalen; o++) {
17897 uint64_t _res_conv_40 = _res_vals[o];
17898 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
17899 CHECK_ACCESS(_res_conv_40_ptr);
17900 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
17901 FREE(untag_ptr(_res_conv_40));
17902 _res_constr.data[o] = _res_conv_40_conv;
17905 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
17908 void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(uint64_tArray _res) {
17909 LDKCVec_EventZ _res_constr;
17910 _res_constr.datalen = _res->arr_len;
17911 if (_res_constr.datalen > 0)
17912 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
17914 _res_constr.data = NULL;
17915 uint64_t* _res_vals = _res->elems;
17916 for (size_t h = 0; h < _res_constr.datalen; h++) {
17917 uint64_t _res_conv_7 = _res_vals[h];
17918 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
17919 CHECK_ACCESS(_res_conv_7_ptr);
17920 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
17921 FREE(untag_ptr(_res_conv_7));
17922 _res_constr.data[h] = _res_conv_7_conv;
17925 CVec_EventZ_free(_res_constr);
17928 void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) {
17929 LDKCVec_TransactionZ _res_constr;
17930 _res_constr.datalen = _res->arr_len;
17931 if (_res_constr.datalen > 0)
17932 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
17934 _res_constr.data = NULL;
17935 int8_tArray* _res_vals = (void*) _res->elems;
17936 for (size_t m = 0; m < _res_constr.datalen; m++) {
17937 int8_tArray _res_conv_12 = _res_vals[m];
17938 LDKTransaction _res_conv_12_ref;
17939 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
17940 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
17941 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
17942 _res_conv_12_ref.data_is_owned = true;
17943 _res_constr.data[m] = _res_conv_12_ref;
17946 CVec_TransactionZ_free(_res_constr);
17949 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
17950 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
17951 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
17952 return tag_ptr(ret_conv, true);
17954 int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint64_t arg) {
17955 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
17956 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
17960 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_u32TxOutZ_clone(uint64_t orig) {
17961 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
17962 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
17963 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
17964 return tag_ptr(ret_conv, true);
17967 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint64_t b) {
17968 void* b_ptr = untag_ptr(b);
17969 CHECK_ACCESS(b_ptr);
17970 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
17971 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
17972 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
17973 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
17974 return tag_ptr(ret_conv, true);
17977 void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint64_t _res) {
17978 if (!ptr_is_owned(_res)) return;
17979 void* _res_ptr = untag_ptr(_res);
17980 CHECK_ACCESS(_res_ptr);
17981 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
17982 FREE(untag_ptr(_res));
17983 C2Tuple_u32TxOutZ_free(_res_conv);
17986 void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uint64_tArray _res) {
17987 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
17988 _res_constr.datalen = _res->arr_len;
17989 if (_res_constr.datalen > 0)
17990 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
17992 _res_constr.data = NULL;
17993 uint64_t* _res_vals = _res->elems;
17994 for (size_t u = 0; u < _res_constr.datalen; u++) {
17995 uint64_t _res_conv_20 = _res_vals[u];
17996 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
17997 CHECK_ACCESS(_res_conv_20_ptr);
17998 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
17999 FREE(untag_ptr(_res_conv_20));
18000 _res_constr.data[u] = _res_conv_20_conv;
18003 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
18006 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
18007 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18008 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
18009 return tag_ptr(ret_conv, true);
18011 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint64_t arg) {
18012 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
18013 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
18017 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint64_t orig) {
18018 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
18019 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18020 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
18021 return tag_ptr(ret_conv, true);
18024 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint64_tArray b) {
18025 LDKThirtyTwoBytes a_ref;
18026 CHECK(a->arr_len == 32);
18027 memcpy(a_ref.data, a->elems, 32); FREE(a);
18028 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
18029 b_constr.datalen = b->arr_len;
18030 if (b_constr.datalen > 0)
18031 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
18033 b_constr.data = NULL;
18034 uint64_t* b_vals = b->elems;
18035 for (size_t u = 0; u < b_constr.datalen; u++) {
18036 uint64_t b_conv_20 = b_vals[u];
18037 void* b_conv_20_ptr = untag_ptr(b_conv_20);
18038 CHECK_ACCESS(b_conv_20_ptr);
18039 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
18040 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
18041 b_constr.data[u] = b_conv_20_conv;
18044 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
18045 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
18046 return tag_ptr(ret_conv, true);
18049 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint64_t _res) {
18050 if (!ptr_is_owned(_res)) return;
18051 void* _res_ptr = untag_ptr(_res);
18052 CHECK_ACCESS(_res_ptr);
18053 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
18054 FREE(untag_ptr(_res));
18055 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
18058 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint64_tArray _res) {
18059 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
18060 _res_constr.datalen = _res->arr_len;
18061 if (_res_constr.datalen > 0)
18062 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
18064 _res_constr.data = NULL;
18065 uint64_t* _res_vals = _res->elems;
18066 for (size_t n = 0; n < _res_constr.datalen; n++) {
18067 uint64_t _res_conv_39 = _res_vals[n];
18068 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
18069 CHECK_ACCESS(_res_conv_39_ptr);
18070 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
18071 FREE(untag_ptr(_res_conv_39));
18072 _res_constr.data[n] = _res_conv_39_conv;
18075 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
18078 void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_free(uint64_tArray _res) {
18079 LDKCVec_BalanceZ _res_constr;
18080 _res_constr.datalen = _res->arr_len;
18081 if (_res_constr.datalen > 0)
18082 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
18084 _res_constr.data = NULL;
18085 uint64_t* _res_vals = _res->elems;
18086 for (size_t j = 0; j < _res_constr.datalen; j++) {
18087 uint64_t _res_conv_9 = _res_vals[j];
18088 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
18089 CHECK_ACCESS(_res_conv_9_ptr);
18090 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
18091 FREE(untag_ptr(_res_conv_9));
18092 _res_constr.data[j] = _res_conv_9_conv;
18095 CVec_BalanceZ_free(_res_constr);
18098 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
18099 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18100 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
18101 return tag_ptr(ret_conv, true);
18103 int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint64_t arg) {
18104 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
18105 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
18109 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint64_t orig) {
18110 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
18111 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18112 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
18113 return tag_ptr(ret_conv, true);
18116 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint64_t b) {
18117 LDKThirtyTwoBytes a_ref;
18118 CHECK(a->arr_len == 32);
18119 memcpy(a_ref.data, a->elems, 32); FREE(a);
18120 LDKChannelMonitor b_conv;
18121 b_conv.inner = untag_ptr(b);
18122 b_conv.is_owned = ptr_is_owned(b);
18123 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
18124 b_conv = ChannelMonitor_clone(&b_conv);
18125 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18126 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
18127 return tag_ptr(ret_conv, true);
18130 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint64_t _res) {
18131 if (!ptr_is_owned(_res)) return;
18132 void* _res_ptr = untag_ptr(_res);
18133 CHECK_ACCESS(_res_ptr);
18134 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
18135 FREE(untag_ptr(_res));
18136 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
18139 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint64_t o) {
18140 void* o_ptr = untag_ptr(o);
18141 CHECK_ACCESS(o_ptr);
18142 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
18143 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
18144 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18145 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
18146 return tag_ptr(ret_conv, true);
18149 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
18150 LDKDecodeError e_conv;
18151 e_conv.inner = untag_ptr(e);
18152 e_conv.is_owned = ptr_is_owned(e);
18153 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18154 e_conv = DecodeError_clone(&e_conv);
18155 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18156 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
18157 return tag_ptr(ret_conv, true);
18160 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint64_t o) {
18161 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
18162 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
18166 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint64_t _res) {
18167 if (!ptr_is_owned(_res)) return;
18168 void* _res_ptr = untag_ptr(_res);
18169 CHECK_ACCESS(_res_ptr);
18170 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
18171 FREE(untag_ptr(_res));
18172 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
18175 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
18176 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18177 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
18178 return tag_ptr(ret_conv, true);
18180 int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint64_t arg) {
18181 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
18182 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
18186 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint64_t orig) {
18187 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
18188 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
18189 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
18190 return tag_ptr(ret_conv, true);
18193 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
18194 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18195 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
18196 return tag_ptr(ret_conv, true);
18198 int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint64_t arg) {
18199 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
18200 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
18204 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
18205 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
18206 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18207 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
18208 return tag_ptr(ret_conv, true);
18211 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
18212 LDKPublicKey a_ref;
18213 CHECK(a->arr_len == 33);
18214 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
18215 void* b_ptr = untag_ptr(b);
18216 CHECK_ACCESS(b_ptr);
18217 LDKType b_conv = *(LDKType*)(b_ptr);
18218 if (b_conv.free == LDKType_JCalls_free) {
18219 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
18220 LDKType_JCalls_cloned(&b_conv);
18222 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
18223 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
18224 return tag_ptr(ret_conv, true);
18227 void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
18228 if (!ptr_is_owned(_res)) return;
18229 void* _res_ptr = untag_ptr(_res);
18230 CHECK_ACCESS(_res_ptr);
18231 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
18232 FREE(untag_ptr(_res));
18233 C2Tuple_PublicKeyTypeZ_free(_res_conv);
18236 void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
18237 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
18238 _res_constr.datalen = _res->arr_len;
18239 if (_res_constr.datalen > 0)
18240 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
18242 _res_constr.data = NULL;
18243 uint64_t* _res_vals = _res->elems;
18244 for (size_t z = 0; z < _res_constr.datalen; z++) {
18245 uint64_t _res_conv_25 = _res_vals[z];
18246 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
18247 CHECK_ACCESS(_res_conv_25_ptr);
18248 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
18249 FREE(untag_ptr(_res_conv_25));
18250 _res_constr.data[z] = _res_conv_25_conv;
18253 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
18256 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
18257 void* o_ptr = untag_ptr(o);
18258 CHECK_ACCESS(o_ptr);
18259 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
18260 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
18261 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18262 *ret_copy = COption_NetAddressZ_some(o_conv);
18263 uint64_t ret_ref = tag_ptr(ret_copy, true);
18267 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
18268 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18269 *ret_copy = COption_NetAddressZ_none();
18270 uint64_t ret_ref = tag_ptr(ret_copy, true);
18274 void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
18275 if (!ptr_is_owned(_res)) return;
18276 void* _res_ptr = untag_ptr(_res);
18277 CHECK_ACCESS(_res_ptr);
18278 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
18279 FREE(untag_ptr(_res));
18280 COption_NetAddressZ_free(_res_conv);
18283 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
18284 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18285 *ret_copy = COption_NetAddressZ_clone(arg);
18286 uint64_t ret_ref = tag_ptr(ret_copy, true);
18289 int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
18290 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
18291 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
18295 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
18296 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
18297 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
18298 *ret_copy = COption_NetAddressZ_clone(orig_conv);
18299 uint64_t ret_ref = tag_ptr(ret_copy, true);
18303 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
18305 o_ref.datalen = o->arr_len;
18306 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
18307 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
18308 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18309 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
18310 return tag_ptr(ret_conv, true);
18313 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
18314 LDKPeerHandleError e_conv;
18315 e_conv.inner = untag_ptr(e);
18316 e_conv.is_owned = ptr_is_owned(e);
18317 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18318 e_conv = PeerHandleError_clone(&e_conv);
18319 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18320 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
18321 return tag_ptr(ret_conv, true);
18324 jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
18325 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
18326 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
18330 void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
18331 if (!ptr_is_owned(_res)) return;
18332 void* _res_ptr = untag_ptr(_res);
18333 CHECK_ACCESS(_res_ptr);
18334 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
18335 FREE(untag_ptr(_res));
18336 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
18339 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
18340 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18341 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
18342 return tag_ptr(ret_conv, true);
18344 int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
18345 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
18346 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
18350 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
18351 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
18352 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
18353 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
18354 return tag_ptr(ret_conv, true);
18357 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
18358 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18359 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
18360 return tag_ptr(ret_conv, true);
18363 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
18364 LDKPeerHandleError e_conv;
18365 e_conv.inner = untag_ptr(e);
18366 e_conv.is_owned = ptr_is_owned(e);
18367 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18368 e_conv = PeerHandleError_clone(&e_conv);
18369 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18370 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
18371 return tag_ptr(ret_conv, true);
18374 jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
18375 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
18376 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
18380 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
18381 if (!ptr_is_owned(_res)) return;
18382 void* _res_ptr = untag_ptr(_res);
18383 CHECK_ACCESS(_res_ptr);
18384 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
18385 FREE(untag_ptr(_res));
18386 CResult_NonePeerHandleErrorZ_free(_res_conv);
18389 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
18390 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18391 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
18392 return tag_ptr(ret_conv, true);
18394 int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
18395 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
18396 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
18400 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
18401 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
18402 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
18403 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
18404 return tag_ptr(ret_conv, true);
18407 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
18408 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18409 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
18410 return tag_ptr(ret_conv, true);
18413 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
18414 LDKPeerHandleError e_conv;
18415 e_conv.inner = untag_ptr(e);
18416 e_conv.is_owned = ptr_is_owned(e);
18417 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18418 e_conv = PeerHandleError_clone(&e_conv);
18419 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18420 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
18421 return tag_ptr(ret_conv, true);
18424 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
18425 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
18426 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
18430 void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
18431 if (!ptr_is_owned(_res)) return;
18432 void* _res_ptr = untag_ptr(_res);
18433 CHECK_ACCESS(_res_ptr);
18434 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
18435 FREE(untag_ptr(_res));
18436 CResult_boolPeerHandleErrorZ_free(_res_conv);
18439 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
18440 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18441 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
18442 return tag_ptr(ret_conv, true);
18444 int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
18445 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
18446 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
18450 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
18451 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
18452 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
18453 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
18454 return tag_ptr(ret_conv, true);
18457 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_ok"))) TS_CResult_NoneSendErrorZ_ok() {
18458 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
18459 *ret_conv = CResult_NoneSendErrorZ_ok();
18460 return tag_ptr(ret_conv, true);
18463 uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_err"))) TS_CResult_NoneSendErrorZ_err(uint64_t e) {
18464 void* e_ptr = untag_ptr(e);
18465 CHECK_ACCESS(e_ptr);
18466 LDKSendError e_conv = *(LDKSendError*)(e_ptr);
18467 e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
18468 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
18469 *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
18470 return tag_ptr(ret_conv, true);
18473 jboolean __attribute__((export_name("TS_CResult_NoneSendErrorZ_is_ok"))) TS_CResult_NoneSendErrorZ_is_ok(uint64_t o) {
18474 LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
18475 jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
18479 void __attribute__((export_name("TS_CResult_NoneSendErrorZ_free"))) TS_CResult_NoneSendErrorZ_free(uint64_t _res) {
18480 if (!ptr_is_owned(_res)) return;
18481 void* _res_ptr = untag_ptr(_res);
18482 CHECK_ACCESS(_res_ptr);
18483 LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
18484 FREE(untag_ptr(_res));
18485 CResult_NoneSendErrorZ_free(_res_conv);
18488 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() {
18489 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18490 *ret_conv = CResult_NoneErrorZ_ok();
18491 return tag_ptr(ret_conv, true);
18494 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) {
18495 LDKIOError e_conv = LDKIOError_from_js(e);
18496 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18497 *ret_conv = CResult_NoneErrorZ_err(e_conv);
18498 return tag_ptr(ret_conv, true);
18501 jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) {
18502 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
18503 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
18507 void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) {
18508 if (!ptr_is_owned(_res)) return;
18509 void* _res_ptr = untag_ptr(_res);
18510 CHECK_ACCESS(_res_ptr);
18511 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
18512 FREE(untag_ptr(_res));
18513 CResult_NoneErrorZ_free(_res_conv);
18516 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
18517 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18518 *ret_conv = CResult_NoneErrorZ_clone(arg);
18519 return tag_ptr(ret_conv, true);
18521 int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) {
18522 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
18523 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
18527 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) {
18528 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
18529 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
18530 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
18531 return tag_ptr(ret_conv, true);
18534 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint64_t o) {
18535 void* o_ptr = untag_ptr(o);
18536 CHECK_ACCESS(o_ptr);
18537 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
18538 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
18539 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18540 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
18541 return tag_ptr(ret_conv, true);
18544 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
18545 LDKDecodeError e_conv;
18546 e_conv.inner = untag_ptr(e);
18547 e_conv.is_owned = ptr_is_owned(e);
18548 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18549 e_conv = DecodeError_clone(&e_conv);
18550 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18551 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
18552 return tag_ptr(ret_conv, true);
18555 jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) {
18556 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
18557 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
18561 void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) {
18562 if (!ptr_is_owned(_res)) return;
18563 void* _res_ptr = untag_ptr(_res);
18564 CHECK_ACCESS(_res_ptr);
18565 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
18566 FREE(untag_ptr(_res));
18567 CResult_NetAddressDecodeErrorZ_free(_res_conv);
18570 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
18571 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18572 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
18573 return tag_ptr(ret_conv, true);
18575 int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) {
18576 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
18577 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
18581 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) {
18582 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
18583 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
18584 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
18585 return tag_ptr(ret_conv, true);
18588 void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) {
18589 LDKCVec_UpdateAddHTLCZ _res_constr;
18590 _res_constr.datalen = _res->arr_len;
18591 if (_res_constr.datalen > 0)
18592 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
18594 _res_constr.data = NULL;
18595 uint64_t* _res_vals = _res->elems;
18596 for (size_t p = 0; p < _res_constr.datalen; p++) {
18597 uint64_t _res_conv_15 = _res_vals[p];
18598 LDKUpdateAddHTLC _res_conv_15_conv;
18599 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
18600 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
18601 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
18602 _res_constr.data[p] = _res_conv_15_conv;
18605 CVec_UpdateAddHTLCZ_free(_res_constr);
18608 void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) {
18609 LDKCVec_UpdateFulfillHTLCZ _res_constr;
18610 _res_constr.datalen = _res->arr_len;
18611 if (_res_constr.datalen > 0)
18612 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
18614 _res_constr.data = NULL;
18615 uint64_t* _res_vals = _res->elems;
18616 for (size_t t = 0; t < _res_constr.datalen; t++) {
18617 uint64_t _res_conv_19 = _res_vals[t];
18618 LDKUpdateFulfillHTLC _res_conv_19_conv;
18619 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
18620 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
18621 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
18622 _res_constr.data[t] = _res_conv_19_conv;
18625 CVec_UpdateFulfillHTLCZ_free(_res_constr);
18628 void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) {
18629 LDKCVec_UpdateFailHTLCZ _res_constr;
18630 _res_constr.datalen = _res->arr_len;
18631 if (_res_constr.datalen > 0)
18632 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
18634 _res_constr.data = NULL;
18635 uint64_t* _res_vals = _res->elems;
18636 for (size_t q = 0; q < _res_constr.datalen; q++) {
18637 uint64_t _res_conv_16 = _res_vals[q];
18638 LDKUpdateFailHTLC _res_conv_16_conv;
18639 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
18640 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
18641 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
18642 _res_constr.data[q] = _res_conv_16_conv;
18645 CVec_UpdateFailHTLCZ_free(_res_constr);
18648 void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) {
18649 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
18650 _res_constr.datalen = _res->arr_len;
18651 if (_res_constr.datalen > 0)
18652 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
18654 _res_constr.data = NULL;
18655 uint64_t* _res_vals = _res->elems;
18656 for (size_t z = 0; z < _res_constr.datalen; z++) {
18657 uint64_t _res_conv_25 = _res_vals[z];
18658 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
18659 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
18660 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
18661 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
18662 _res_constr.data[z] = _res_conv_25_conv;
18665 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
18668 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) {
18669 LDKAcceptChannel o_conv;
18670 o_conv.inner = untag_ptr(o);
18671 o_conv.is_owned = ptr_is_owned(o);
18672 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18673 o_conv = AcceptChannel_clone(&o_conv);
18674 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18675 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
18676 return tag_ptr(ret_conv, true);
18679 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
18680 LDKDecodeError e_conv;
18681 e_conv.inner = untag_ptr(e);
18682 e_conv.is_owned = ptr_is_owned(e);
18683 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18684 e_conv = DecodeError_clone(&e_conv);
18685 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18686 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
18687 return tag_ptr(ret_conv, true);
18690 jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) {
18691 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
18692 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
18696 void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) {
18697 if (!ptr_is_owned(_res)) return;
18698 void* _res_ptr = untag_ptr(_res);
18699 CHECK_ACCESS(_res_ptr);
18700 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
18701 FREE(untag_ptr(_res));
18702 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
18705 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
18706 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18707 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
18708 return tag_ptr(ret_conv, true);
18710 int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
18711 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
18712 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
18716 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) {
18717 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
18718 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
18719 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
18720 return tag_ptr(ret_conv, true);
18723 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) {
18724 LDKAnnouncementSignatures o_conv;
18725 o_conv.inner = untag_ptr(o);
18726 o_conv.is_owned = ptr_is_owned(o);
18727 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18728 o_conv = AnnouncementSignatures_clone(&o_conv);
18729 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18730 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
18731 return tag_ptr(ret_conv, true);
18734 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
18735 LDKDecodeError e_conv;
18736 e_conv.inner = untag_ptr(e);
18737 e_conv.is_owned = ptr_is_owned(e);
18738 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18739 e_conv = DecodeError_clone(&e_conv);
18740 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18741 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
18742 return tag_ptr(ret_conv, true);
18745 jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) {
18746 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
18747 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
18751 void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) {
18752 if (!ptr_is_owned(_res)) return;
18753 void* _res_ptr = untag_ptr(_res);
18754 CHECK_ACCESS(_res_ptr);
18755 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
18756 FREE(untag_ptr(_res));
18757 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
18760 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
18761 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18762 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
18763 return tag_ptr(ret_conv, true);
18765 int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
18766 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
18767 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
18771 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) {
18772 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
18773 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
18774 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
18775 return tag_ptr(ret_conv, true);
18778 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) {
18779 LDKChannelReestablish o_conv;
18780 o_conv.inner = untag_ptr(o);
18781 o_conv.is_owned = ptr_is_owned(o);
18782 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18783 o_conv = ChannelReestablish_clone(&o_conv);
18784 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18785 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
18786 return tag_ptr(ret_conv, true);
18789 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
18790 LDKDecodeError e_conv;
18791 e_conv.inner = untag_ptr(e);
18792 e_conv.is_owned = ptr_is_owned(e);
18793 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18794 e_conv = DecodeError_clone(&e_conv);
18795 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18796 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
18797 return tag_ptr(ret_conv, true);
18800 jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) {
18801 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
18802 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
18806 void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) {
18807 if (!ptr_is_owned(_res)) return;
18808 void* _res_ptr = untag_ptr(_res);
18809 CHECK_ACCESS(_res_ptr);
18810 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
18811 FREE(untag_ptr(_res));
18812 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
18815 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
18816 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18817 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
18818 return tag_ptr(ret_conv, true);
18820 int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) {
18821 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
18822 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
18826 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) {
18827 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
18828 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
18829 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
18830 return tag_ptr(ret_conv, true);
18833 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) {
18834 LDKClosingSigned o_conv;
18835 o_conv.inner = untag_ptr(o);
18836 o_conv.is_owned = ptr_is_owned(o);
18837 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18838 o_conv = ClosingSigned_clone(&o_conv);
18839 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
18840 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
18841 return tag_ptr(ret_conv, true);
18844 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
18845 LDKDecodeError e_conv;
18846 e_conv.inner = untag_ptr(e);
18847 e_conv.is_owned = ptr_is_owned(e);
18848 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18849 e_conv = DecodeError_clone(&e_conv);
18850 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
18851 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
18852 return tag_ptr(ret_conv, true);
18855 jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) {
18856 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
18857 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
18861 void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) {
18862 if (!ptr_is_owned(_res)) return;
18863 void* _res_ptr = untag_ptr(_res);
18864 CHECK_ACCESS(_res_ptr);
18865 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
18866 FREE(untag_ptr(_res));
18867 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
18870 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
18871 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
18872 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
18873 return tag_ptr(ret_conv, true);
18875 int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
18876 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
18877 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
18881 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) {
18882 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
18883 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
18884 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
18885 return tag_ptr(ret_conv, true);
18888 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) {
18889 LDKClosingSignedFeeRange o_conv;
18890 o_conv.inner = untag_ptr(o);
18891 o_conv.is_owned = ptr_is_owned(o);
18892 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18893 o_conv = ClosingSignedFeeRange_clone(&o_conv);
18894 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
18895 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
18896 return tag_ptr(ret_conv, true);
18899 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
18900 LDKDecodeError e_conv;
18901 e_conv.inner = untag_ptr(e);
18902 e_conv.is_owned = ptr_is_owned(e);
18903 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18904 e_conv = DecodeError_clone(&e_conv);
18905 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
18906 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
18907 return tag_ptr(ret_conv, true);
18910 jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) {
18911 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
18912 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
18916 void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) {
18917 if (!ptr_is_owned(_res)) return;
18918 void* _res_ptr = untag_ptr(_res);
18919 CHECK_ACCESS(_res_ptr);
18920 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
18921 FREE(untag_ptr(_res));
18922 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
18925 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
18926 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
18927 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
18928 return tag_ptr(ret_conv, true);
18930 int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
18931 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
18932 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
18936 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) {
18937 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
18938 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
18939 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
18940 return tag_ptr(ret_conv, true);
18943 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) {
18944 LDKCommitmentSigned o_conv;
18945 o_conv.inner = untag_ptr(o);
18946 o_conv.is_owned = ptr_is_owned(o);
18947 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18948 o_conv = CommitmentSigned_clone(&o_conv);
18949 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
18950 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
18951 return tag_ptr(ret_conv, true);
18954 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
18955 LDKDecodeError e_conv;
18956 e_conv.inner = untag_ptr(e);
18957 e_conv.is_owned = ptr_is_owned(e);
18958 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18959 e_conv = DecodeError_clone(&e_conv);
18960 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
18961 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
18962 return tag_ptr(ret_conv, true);
18965 jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) {
18966 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
18967 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
18971 void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) {
18972 if (!ptr_is_owned(_res)) return;
18973 void* _res_ptr = untag_ptr(_res);
18974 CHECK_ACCESS(_res_ptr);
18975 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
18976 FREE(untag_ptr(_res));
18977 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
18980 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
18981 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
18982 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
18983 return tag_ptr(ret_conv, true);
18985 int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
18986 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
18987 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
18991 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) {
18992 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
18993 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
18994 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
18995 return tag_ptr(ret_conv, true);
18998 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) {
18999 LDKFundingCreated o_conv;
19000 o_conv.inner = untag_ptr(o);
19001 o_conv.is_owned = ptr_is_owned(o);
19002 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19003 o_conv = FundingCreated_clone(&o_conv);
19004 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19005 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
19006 return tag_ptr(ret_conv, true);
19009 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
19010 LDKDecodeError e_conv;
19011 e_conv.inner = untag_ptr(e);
19012 e_conv.is_owned = ptr_is_owned(e);
19013 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19014 e_conv = DecodeError_clone(&e_conv);
19015 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19016 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
19017 return tag_ptr(ret_conv, true);
19020 jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) {
19021 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
19022 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
19026 void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) {
19027 if (!ptr_is_owned(_res)) return;
19028 void* _res_ptr = untag_ptr(_res);
19029 CHECK_ACCESS(_res_ptr);
19030 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
19031 FREE(untag_ptr(_res));
19032 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
19035 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
19036 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19037 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
19038 return tag_ptr(ret_conv, true);
19040 int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) {
19041 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
19042 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
19046 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) {
19047 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
19048 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
19049 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
19050 return tag_ptr(ret_conv, true);
19053 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) {
19054 LDKFundingSigned o_conv;
19055 o_conv.inner = untag_ptr(o);
19056 o_conv.is_owned = ptr_is_owned(o);
19057 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19058 o_conv = FundingSigned_clone(&o_conv);
19059 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19060 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
19061 return tag_ptr(ret_conv, true);
19064 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
19065 LDKDecodeError e_conv;
19066 e_conv.inner = untag_ptr(e);
19067 e_conv.is_owned = ptr_is_owned(e);
19068 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19069 e_conv = DecodeError_clone(&e_conv);
19070 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19071 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
19072 return tag_ptr(ret_conv, true);
19075 jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) {
19076 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
19077 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
19081 void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) {
19082 if (!ptr_is_owned(_res)) return;
19083 void* _res_ptr = untag_ptr(_res);
19084 CHECK_ACCESS(_res_ptr);
19085 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
19086 FREE(untag_ptr(_res));
19087 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
19090 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
19091 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19092 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
19093 return tag_ptr(ret_conv, true);
19095 int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
19096 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
19097 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
19101 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) {
19102 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
19103 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
19104 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
19105 return tag_ptr(ret_conv, true);
19108 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) {
19109 LDKChannelReady o_conv;
19110 o_conv.inner = untag_ptr(o);
19111 o_conv.is_owned = ptr_is_owned(o);
19112 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19113 o_conv = ChannelReady_clone(&o_conv);
19114 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19115 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
19116 return tag_ptr(ret_conv, true);
19119 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
19120 LDKDecodeError e_conv;
19121 e_conv.inner = untag_ptr(e);
19122 e_conv.is_owned = ptr_is_owned(e);
19123 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19124 e_conv = DecodeError_clone(&e_conv);
19125 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19126 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
19127 return tag_ptr(ret_conv, true);
19130 jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) {
19131 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
19132 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
19136 void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) {
19137 if (!ptr_is_owned(_res)) return;
19138 void* _res_ptr = untag_ptr(_res);
19139 CHECK_ACCESS(_res_ptr);
19140 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
19141 FREE(untag_ptr(_res));
19142 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
19145 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
19146 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19147 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
19148 return tag_ptr(ret_conv, true);
19150 int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) {
19151 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
19152 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
19156 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) {
19157 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
19158 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
19159 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
19160 return tag_ptr(ret_conv, true);
19163 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) {
19165 o_conv.inner = untag_ptr(o);
19166 o_conv.is_owned = ptr_is_owned(o);
19167 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19168 o_conv = Init_clone(&o_conv);
19169 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19170 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
19171 return tag_ptr(ret_conv, true);
19174 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
19175 LDKDecodeError e_conv;
19176 e_conv.inner = untag_ptr(e);
19177 e_conv.is_owned = ptr_is_owned(e);
19178 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19179 e_conv = DecodeError_clone(&e_conv);
19180 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19181 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
19182 return tag_ptr(ret_conv, true);
19185 jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) {
19186 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
19187 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
19191 void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) {
19192 if (!ptr_is_owned(_res)) return;
19193 void* _res_ptr = untag_ptr(_res);
19194 CHECK_ACCESS(_res_ptr);
19195 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
19196 FREE(untag_ptr(_res));
19197 CResult_InitDecodeErrorZ_free(_res_conv);
19200 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
19201 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19202 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
19203 return tag_ptr(ret_conv, true);
19205 int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) {
19206 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
19207 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
19211 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) {
19212 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
19213 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
19214 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
19215 return tag_ptr(ret_conv, true);
19218 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) {
19219 LDKOpenChannel o_conv;
19220 o_conv.inner = untag_ptr(o);
19221 o_conv.is_owned = ptr_is_owned(o);
19222 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19223 o_conv = OpenChannel_clone(&o_conv);
19224 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19225 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
19226 return tag_ptr(ret_conv, true);
19229 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
19230 LDKDecodeError e_conv;
19231 e_conv.inner = untag_ptr(e);
19232 e_conv.is_owned = ptr_is_owned(e);
19233 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19234 e_conv = DecodeError_clone(&e_conv);
19235 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19236 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
19237 return tag_ptr(ret_conv, true);
19240 jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) {
19241 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
19242 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
19246 void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) {
19247 if (!ptr_is_owned(_res)) return;
19248 void* _res_ptr = untag_ptr(_res);
19249 CHECK_ACCESS(_res_ptr);
19250 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
19251 FREE(untag_ptr(_res));
19252 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
19255 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
19256 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19257 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
19258 return tag_ptr(ret_conv, true);
19260 int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
19261 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
19262 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
19266 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) {
19267 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
19268 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
19269 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
19270 return tag_ptr(ret_conv, true);
19273 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) {
19274 LDKRevokeAndACK o_conv;
19275 o_conv.inner = untag_ptr(o);
19276 o_conv.is_owned = ptr_is_owned(o);
19277 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19278 o_conv = RevokeAndACK_clone(&o_conv);
19279 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19280 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
19281 return tag_ptr(ret_conv, true);
19284 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
19285 LDKDecodeError e_conv;
19286 e_conv.inner = untag_ptr(e);
19287 e_conv.is_owned = ptr_is_owned(e);
19288 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19289 e_conv = DecodeError_clone(&e_conv);
19290 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19291 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
19292 return tag_ptr(ret_conv, true);
19295 jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) {
19296 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
19297 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
19301 void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) {
19302 if (!ptr_is_owned(_res)) return;
19303 void* _res_ptr = untag_ptr(_res);
19304 CHECK_ACCESS(_res_ptr);
19305 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
19306 FREE(untag_ptr(_res));
19307 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
19310 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
19311 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19312 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
19313 return tag_ptr(ret_conv, true);
19315 int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) {
19316 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
19317 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
19321 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) {
19322 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
19323 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
19324 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
19325 return tag_ptr(ret_conv, true);
19328 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) {
19329 LDKShutdown o_conv;
19330 o_conv.inner = untag_ptr(o);
19331 o_conv.is_owned = ptr_is_owned(o);
19332 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19333 o_conv = Shutdown_clone(&o_conv);
19334 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19335 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
19336 return tag_ptr(ret_conv, true);
19339 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
19340 LDKDecodeError e_conv;
19341 e_conv.inner = untag_ptr(e);
19342 e_conv.is_owned = ptr_is_owned(e);
19343 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19344 e_conv = DecodeError_clone(&e_conv);
19345 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19346 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
19347 return tag_ptr(ret_conv, true);
19350 jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) {
19351 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
19352 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
19356 void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) {
19357 if (!ptr_is_owned(_res)) return;
19358 void* _res_ptr = untag_ptr(_res);
19359 CHECK_ACCESS(_res_ptr);
19360 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
19361 FREE(untag_ptr(_res));
19362 CResult_ShutdownDecodeErrorZ_free(_res_conv);
19365 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
19366 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19367 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
19368 return tag_ptr(ret_conv, true);
19370 int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) {
19371 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
19372 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
19376 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) {
19377 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
19378 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
19379 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
19380 return tag_ptr(ret_conv, true);
19383 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) {
19384 LDKUpdateFailHTLC o_conv;
19385 o_conv.inner = untag_ptr(o);
19386 o_conv.is_owned = ptr_is_owned(o);
19387 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19388 o_conv = UpdateFailHTLC_clone(&o_conv);
19389 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19390 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
19391 return tag_ptr(ret_conv, true);
19394 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
19395 LDKDecodeError e_conv;
19396 e_conv.inner = untag_ptr(e);
19397 e_conv.is_owned = ptr_is_owned(e);
19398 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19399 e_conv = DecodeError_clone(&e_conv);
19400 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19401 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
19402 return tag_ptr(ret_conv, true);
19405 jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint64_t o) {
19406 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
19407 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
19411 void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint64_t _res) {
19412 if (!ptr_is_owned(_res)) return;
19413 void* _res_ptr = untag_ptr(_res);
19414 CHECK_ACCESS(_res_ptr);
19415 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
19416 FREE(untag_ptr(_res));
19417 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
19420 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
19421 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19422 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
19423 return tag_ptr(ret_conv, true);
19425 int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19426 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
19427 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
19431 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint64_t orig) {
19432 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
19433 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
19434 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
19435 return tag_ptr(ret_conv, true);
19438 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint64_t o) {
19439 LDKUpdateFailMalformedHTLC o_conv;
19440 o_conv.inner = untag_ptr(o);
19441 o_conv.is_owned = ptr_is_owned(o);
19442 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19443 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
19444 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19445 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
19446 return tag_ptr(ret_conv, true);
19449 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
19450 LDKDecodeError e_conv;
19451 e_conv.inner = untag_ptr(e);
19452 e_conv.is_owned = ptr_is_owned(e);
19453 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19454 e_conv = DecodeError_clone(&e_conv);
19455 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19456 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
19457 return tag_ptr(ret_conv, true);
19460 jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint64_t o) {
19461 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
19462 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
19466 void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint64_t _res) {
19467 if (!ptr_is_owned(_res)) return;
19468 void* _res_ptr = untag_ptr(_res);
19469 CHECK_ACCESS(_res_ptr);
19470 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
19471 FREE(untag_ptr(_res));
19472 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
19475 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
19476 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19477 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
19478 return tag_ptr(ret_conv, true);
19480 int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19481 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
19482 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
19486 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint64_t orig) {
19487 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
19488 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
19489 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
19490 return tag_ptr(ret_conv, true);
19493 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint64_t o) {
19494 LDKUpdateFee o_conv;
19495 o_conv.inner = untag_ptr(o);
19496 o_conv.is_owned = ptr_is_owned(o);
19497 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19498 o_conv = UpdateFee_clone(&o_conv);
19499 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19500 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
19501 return tag_ptr(ret_conv, true);
19504 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
19505 LDKDecodeError e_conv;
19506 e_conv.inner = untag_ptr(e);
19507 e_conv.is_owned = ptr_is_owned(e);
19508 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19509 e_conv = DecodeError_clone(&e_conv);
19510 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19511 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
19512 return tag_ptr(ret_conv, true);
19515 jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint64_t o) {
19516 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
19517 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
19521 void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint64_t _res) {
19522 if (!ptr_is_owned(_res)) return;
19523 void* _res_ptr = untag_ptr(_res);
19524 CHECK_ACCESS(_res_ptr);
19525 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
19526 FREE(untag_ptr(_res));
19527 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
19530 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
19531 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19532 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
19533 return tag_ptr(ret_conv, true);
19535 int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint64_t arg) {
19536 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
19537 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
19541 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint64_t orig) {
19542 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
19543 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
19544 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
19545 return tag_ptr(ret_conv, true);
19548 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint64_t o) {
19549 LDKUpdateFulfillHTLC o_conv;
19550 o_conv.inner = untag_ptr(o);
19551 o_conv.is_owned = ptr_is_owned(o);
19552 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19553 o_conv = UpdateFulfillHTLC_clone(&o_conv);
19554 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19555 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
19556 return tag_ptr(ret_conv, true);
19559 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
19560 LDKDecodeError e_conv;
19561 e_conv.inner = untag_ptr(e);
19562 e_conv.is_owned = ptr_is_owned(e);
19563 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19564 e_conv = DecodeError_clone(&e_conv);
19565 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19566 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
19567 return tag_ptr(ret_conv, true);
19570 jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint64_t o) {
19571 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
19572 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
19576 void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint64_t _res) {
19577 if (!ptr_is_owned(_res)) return;
19578 void* _res_ptr = untag_ptr(_res);
19579 CHECK_ACCESS(_res_ptr);
19580 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
19581 FREE(untag_ptr(_res));
19582 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
19585 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
19586 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19587 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
19588 return tag_ptr(ret_conv, true);
19590 int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19591 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
19592 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
19596 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint64_t orig) {
19597 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
19598 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
19599 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
19600 return tag_ptr(ret_conv, true);
19603 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint64_t o) {
19604 LDKUpdateAddHTLC o_conv;
19605 o_conv.inner = untag_ptr(o);
19606 o_conv.is_owned = ptr_is_owned(o);
19607 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19608 o_conv = UpdateAddHTLC_clone(&o_conv);
19609 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19610 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
19611 return tag_ptr(ret_conv, true);
19614 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
19615 LDKDecodeError e_conv;
19616 e_conv.inner = untag_ptr(e);
19617 e_conv.is_owned = ptr_is_owned(e);
19618 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19619 e_conv = DecodeError_clone(&e_conv);
19620 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19621 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
19622 return tag_ptr(ret_conv, true);
19625 jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint64_t o) {
19626 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
19627 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
19631 void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint64_t _res) {
19632 if (!ptr_is_owned(_res)) return;
19633 void* _res_ptr = untag_ptr(_res);
19634 CHECK_ACCESS(_res_ptr);
19635 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
19636 FREE(untag_ptr(_res));
19637 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
19640 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
19641 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19642 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
19643 return tag_ptr(ret_conv, true);
19645 int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
19646 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
19647 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
19651 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint64_t orig) {
19652 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
19653 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
19654 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
19655 return tag_ptr(ret_conv, true);
19658 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_ok"))) TS_CResult_OnionMessageDecodeErrorZ_ok(uint64_t o) {
19659 LDKOnionMessage o_conv;
19660 o_conv.inner = untag_ptr(o);
19661 o_conv.is_owned = ptr_is_owned(o);
19662 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19663 o_conv = OnionMessage_clone(&o_conv);
19664 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19665 *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
19666 return tag_ptr(ret_conv, true);
19669 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_err"))) TS_CResult_OnionMessageDecodeErrorZ_err(uint64_t e) {
19670 LDKDecodeError e_conv;
19671 e_conv.inner = untag_ptr(e);
19672 e_conv.is_owned = ptr_is_owned(e);
19673 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19674 e_conv = DecodeError_clone(&e_conv);
19675 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19676 *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
19677 return tag_ptr(ret_conv, true);
19680 jboolean __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_is_ok"))) TS_CResult_OnionMessageDecodeErrorZ_is_ok(uint64_t o) {
19681 LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
19682 jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
19686 void __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_free"))) TS_CResult_OnionMessageDecodeErrorZ_free(uint64_t _res) {
19687 if (!ptr_is_owned(_res)) return;
19688 void* _res_ptr = untag_ptr(_res);
19689 CHECK_ACCESS(_res_ptr);
19690 LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
19691 FREE(untag_ptr(_res));
19692 CResult_OnionMessageDecodeErrorZ_free(_res_conv);
19695 static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
19696 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19697 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
19698 return tag_ptr(ret_conv, true);
19700 int64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone_ptr"))) TS_CResult_OnionMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
19701 LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
19702 int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
19706 uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone"))) TS_CResult_OnionMessageDecodeErrorZ_clone(uint64_t orig) {
19707 LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
19708 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
19709 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
19710 return tag_ptr(ret_conv, true);
19713 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
19715 o_conv.inner = untag_ptr(o);
19716 o_conv.is_owned = ptr_is_owned(o);
19717 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19718 o_conv = Ping_clone(&o_conv);
19719 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19720 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
19721 return tag_ptr(ret_conv, true);
19724 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
19725 LDKDecodeError e_conv;
19726 e_conv.inner = untag_ptr(e);
19727 e_conv.is_owned = ptr_is_owned(e);
19728 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19729 e_conv = DecodeError_clone(&e_conv);
19730 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19731 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
19732 return tag_ptr(ret_conv, true);
19735 jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint64_t o) {
19736 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
19737 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
19741 void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint64_t _res) {
19742 if (!ptr_is_owned(_res)) return;
19743 void* _res_ptr = untag_ptr(_res);
19744 CHECK_ACCESS(_res_ptr);
19745 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
19746 FREE(untag_ptr(_res));
19747 CResult_PingDecodeErrorZ_free(_res_conv);
19750 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
19751 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19752 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
19753 return tag_ptr(ret_conv, true);
19755 int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint64_t arg) {
19756 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
19757 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
19761 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_CResult_PingDecodeErrorZ_clone(uint64_t orig) {
19762 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
19763 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
19764 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
19765 return tag_ptr(ret_conv, true);
19768 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint64_t o) {
19770 o_conv.inner = untag_ptr(o);
19771 o_conv.is_owned = ptr_is_owned(o);
19772 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19773 o_conv = Pong_clone(&o_conv);
19774 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19775 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
19776 return tag_ptr(ret_conv, true);
19779 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
19780 LDKDecodeError e_conv;
19781 e_conv.inner = untag_ptr(e);
19782 e_conv.is_owned = ptr_is_owned(e);
19783 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19784 e_conv = DecodeError_clone(&e_conv);
19785 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19786 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
19787 return tag_ptr(ret_conv, true);
19790 jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint64_t o) {
19791 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
19792 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
19796 void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint64_t _res) {
19797 if (!ptr_is_owned(_res)) return;
19798 void* _res_ptr = untag_ptr(_res);
19799 CHECK_ACCESS(_res_ptr);
19800 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
19801 FREE(untag_ptr(_res));
19802 CResult_PongDecodeErrorZ_free(_res_conv);
19805 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
19806 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19807 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
19808 return tag_ptr(ret_conv, true);
19810 int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint64_t arg) {
19811 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
19812 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
19816 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_CResult_PongDecodeErrorZ_clone(uint64_t orig) {
19817 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
19818 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
19819 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
19820 return tag_ptr(ret_conv, true);
19823 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
19824 LDKUnsignedChannelAnnouncement o_conv;
19825 o_conv.inner = untag_ptr(o);
19826 o_conv.is_owned = ptr_is_owned(o);
19827 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19828 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
19829 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
19830 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
19831 return tag_ptr(ret_conv, true);
19834 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
19835 LDKDecodeError e_conv;
19836 e_conv.inner = untag_ptr(e);
19837 e_conv.is_owned = ptr_is_owned(e);
19838 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19839 e_conv = DecodeError_clone(&e_conv);
19840 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
19841 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
19842 return tag_ptr(ret_conv, true);
19845 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19846 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
19847 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
19851 void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
19852 if (!ptr_is_owned(_res)) return;
19853 void* _res_ptr = untag_ptr(_res);
19854 CHECK_ACCESS(_res_ptr);
19855 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
19856 FREE(untag_ptr(_res));
19857 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
19860 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19861 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
19862 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
19863 return tag_ptr(ret_conv, true);
19865 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19866 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
19867 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19871 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19872 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
19873 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
19874 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
19875 return tag_ptr(ret_conv, true);
19878 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
19879 LDKChannelAnnouncement o_conv;
19880 o_conv.inner = untag_ptr(o);
19881 o_conv.is_owned = ptr_is_owned(o);
19882 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19883 o_conv = ChannelAnnouncement_clone(&o_conv);
19884 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
19885 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
19886 return tag_ptr(ret_conv, true);
19889 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
19890 LDKDecodeError e_conv;
19891 e_conv.inner = untag_ptr(e);
19892 e_conv.is_owned = ptr_is_owned(e);
19893 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19894 e_conv = DecodeError_clone(&e_conv);
19895 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
19896 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
19897 return tag_ptr(ret_conv, true);
19900 jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19901 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
19902 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
19906 void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
19907 if (!ptr_is_owned(_res)) return;
19908 void* _res_ptr = untag_ptr(_res);
19909 CHECK_ACCESS(_res_ptr);
19910 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
19911 FREE(untag_ptr(_res));
19912 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
19915 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19916 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
19917 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
19918 return tag_ptr(ret_conv, true);
19920 int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19921 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
19922 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19926 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19927 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
19928 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
19929 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
19930 return tag_ptr(ret_conv, true);
19933 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint64_t o) {
19934 LDKUnsignedChannelUpdate o_conv;
19935 o_conv.inner = untag_ptr(o);
19936 o_conv.is_owned = ptr_is_owned(o);
19937 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19938 o_conv = UnsignedChannelUpdate_clone(&o_conv);
19939 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
19940 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
19941 return tag_ptr(ret_conv, true);
19944 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
19945 LDKDecodeError e_conv;
19946 e_conv.inner = untag_ptr(e);
19947 e_conv.is_owned = ptr_is_owned(e);
19948 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19949 e_conv = DecodeError_clone(&e_conv);
19950 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
19951 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
19952 return tag_ptr(ret_conv, true);
19955 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
19956 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
19957 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
19961 void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint64_t _res) {
19962 if (!ptr_is_owned(_res)) return;
19963 void* _res_ptr = untag_ptr(_res);
19964 CHECK_ACCESS(_res_ptr);
19965 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
19966 FREE(untag_ptr(_res));
19967 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
19970 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
19971 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
19972 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
19973 return tag_ptr(ret_conv, true);
19975 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
19976 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
19977 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
19981 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
19982 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
19983 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
19984 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
19985 return tag_ptr(ret_conv, true);
19988 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint64_t o) {
19989 LDKChannelUpdate o_conv;
19990 o_conv.inner = untag_ptr(o);
19991 o_conv.is_owned = ptr_is_owned(o);
19992 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19993 o_conv = ChannelUpdate_clone(&o_conv);
19994 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
19995 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
19996 return tag_ptr(ret_conv, true);
19999 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
20000 LDKDecodeError e_conv;
20001 e_conv.inner = untag_ptr(e);
20002 e_conv.is_owned = ptr_is_owned(e);
20003 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20004 e_conv = DecodeError_clone(&e_conv);
20005 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20006 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
20007 return tag_ptr(ret_conv, true);
20010 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
20011 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
20012 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
20016 void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint64_t _res) {
20017 if (!ptr_is_owned(_res)) return;
20018 void* _res_ptr = untag_ptr(_res);
20019 CHECK_ACCESS(_res_ptr);
20020 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
20021 FREE(untag_ptr(_res));
20022 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
20025 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
20026 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20027 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
20028 return tag_ptr(ret_conv, true);
20030 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
20031 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
20032 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
20036 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
20037 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
20038 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
20039 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
20040 return tag_ptr(ret_conv, true);
20043 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint64_t o) {
20044 LDKErrorMessage o_conv;
20045 o_conv.inner = untag_ptr(o);
20046 o_conv.is_owned = ptr_is_owned(o);
20047 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20048 o_conv = ErrorMessage_clone(&o_conv);
20049 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20050 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
20051 return tag_ptr(ret_conv, true);
20054 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
20055 LDKDecodeError e_conv;
20056 e_conv.inner = untag_ptr(e);
20057 e_conv.is_owned = ptr_is_owned(e);
20058 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20059 e_conv = DecodeError_clone(&e_conv);
20060 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20061 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
20062 return tag_ptr(ret_conv, true);
20065 jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint64_t o) {
20066 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
20067 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
20071 void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint64_t _res) {
20072 if (!ptr_is_owned(_res)) return;
20073 void* _res_ptr = untag_ptr(_res);
20074 CHECK_ACCESS(_res_ptr);
20075 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
20076 FREE(untag_ptr(_res));
20077 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
20080 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
20081 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20082 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
20083 return tag_ptr(ret_conv, true);
20085 int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
20086 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
20087 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
20091 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint64_t orig) {
20092 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
20093 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
20094 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
20095 return tag_ptr(ret_conv, true);
20098 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok"))) TS_CResult_WarningMessageDecodeErrorZ_ok(uint64_t o) {
20099 LDKWarningMessage o_conv;
20100 o_conv.inner = untag_ptr(o);
20101 o_conv.is_owned = ptr_is_owned(o);
20102 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20103 o_conv = WarningMessage_clone(&o_conv);
20104 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20105 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
20106 return tag_ptr(ret_conv, true);
20109 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
20110 LDKDecodeError e_conv;
20111 e_conv.inner = untag_ptr(e);
20112 e_conv.is_owned = ptr_is_owned(e);
20113 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20114 e_conv = DecodeError_clone(&e_conv);
20115 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20116 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
20117 return tag_ptr(ret_conv, true);
20120 jboolean __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_is_ok"))) TS_CResult_WarningMessageDecodeErrorZ_is_ok(uint64_t o) {
20121 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
20122 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
20126 void __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_free"))) TS_CResult_WarningMessageDecodeErrorZ_free(uint64_t _res) {
20127 if (!ptr_is_owned(_res)) return;
20128 void* _res_ptr = untag_ptr(_res);
20129 CHECK_ACCESS(_res_ptr);
20130 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
20131 FREE(untag_ptr(_res));
20132 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
20135 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
20136 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20137 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
20138 return tag_ptr(ret_conv, true);
20140 int64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone_ptr"))) TS_CResult_WarningMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
20141 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
20142 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
20146 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone"))) TS_CResult_WarningMessageDecodeErrorZ_clone(uint64_t orig) {
20147 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
20148 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
20149 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
20150 return tag_ptr(ret_conv, true);
20153 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
20154 LDKUnsignedNodeAnnouncement o_conv;
20155 o_conv.inner = untag_ptr(o);
20156 o_conv.is_owned = ptr_is_owned(o);
20157 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20158 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
20159 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20160 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
20161 return tag_ptr(ret_conv, true);
20164 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
20165 LDKDecodeError e_conv;
20166 e_conv.inner = untag_ptr(e);
20167 e_conv.is_owned = ptr_is_owned(e);
20168 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20169 e_conv = DecodeError_clone(&e_conv);
20170 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20171 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
20172 return tag_ptr(ret_conv, true);
20175 jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20176 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
20177 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
20181 void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
20182 if (!ptr_is_owned(_res)) return;
20183 void* _res_ptr = untag_ptr(_res);
20184 CHECK_ACCESS(_res_ptr);
20185 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
20186 FREE(untag_ptr(_res));
20187 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
20190 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20191 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20192 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
20193 return tag_ptr(ret_conv, true);
20195 int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20196 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
20197 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20201 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20202 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
20203 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
20204 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
20205 return tag_ptr(ret_conv, true);
20208 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
20209 LDKNodeAnnouncement o_conv;
20210 o_conv.inner = untag_ptr(o);
20211 o_conv.is_owned = ptr_is_owned(o);
20212 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20213 o_conv = NodeAnnouncement_clone(&o_conv);
20214 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20215 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
20216 return tag_ptr(ret_conv, true);
20219 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
20220 LDKDecodeError e_conv;
20221 e_conv.inner = untag_ptr(e);
20222 e_conv.is_owned = ptr_is_owned(e);
20223 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20224 e_conv = DecodeError_clone(&e_conv);
20225 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20226 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
20227 return tag_ptr(ret_conv, true);
20230 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
20231 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
20232 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
20236 void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
20237 if (!ptr_is_owned(_res)) return;
20238 void* _res_ptr = untag_ptr(_res);
20239 CHECK_ACCESS(_res_ptr);
20240 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
20241 FREE(untag_ptr(_res));
20242 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
20245 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
20246 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20247 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
20248 return tag_ptr(ret_conv, true);
20250 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
20251 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
20252 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
20256 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
20257 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
20258 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
20259 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
20260 return tag_ptr(ret_conv, true);
20263 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint64_t o) {
20264 LDKQueryShortChannelIds o_conv;
20265 o_conv.inner = untag_ptr(o);
20266 o_conv.is_owned = ptr_is_owned(o);
20267 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20268 o_conv = QueryShortChannelIds_clone(&o_conv);
20269 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20270 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
20271 return tag_ptr(ret_conv, true);
20274 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
20275 LDKDecodeError e_conv;
20276 e_conv.inner = untag_ptr(e);
20277 e_conv.is_owned = ptr_is_owned(e);
20278 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20279 e_conv = DecodeError_clone(&e_conv);
20280 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20281 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
20282 return tag_ptr(ret_conv, true);
20285 jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint64_t o) {
20286 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
20287 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
20291 void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint64_t _res) {
20292 if (!ptr_is_owned(_res)) return;
20293 void* _res_ptr = untag_ptr(_res);
20294 CHECK_ACCESS(_res_ptr);
20295 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
20296 FREE(untag_ptr(_res));
20297 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
20300 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
20301 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20302 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
20303 return tag_ptr(ret_conv, true);
20305 int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint64_t arg) {
20306 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
20307 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
20311 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint64_t orig) {
20312 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
20313 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
20314 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
20315 return tag_ptr(ret_conv, true);
20318 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint64_t o) {
20319 LDKReplyShortChannelIdsEnd o_conv;
20320 o_conv.inner = untag_ptr(o);
20321 o_conv.is_owned = ptr_is_owned(o);
20322 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20323 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
20324 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20325 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
20326 return tag_ptr(ret_conv, true);
20329 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
20330 LDKDecodeError e_conv;
20331 e_conv.inner = untag_ptr(e);
20332 e_conv.is_owned = ptr_is_owned(e);
20333 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20334 e_conv = DecodeError_clone(&e_conv);
20335 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20336 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
20337 return tag_ptr(ret_conv, true);
20340 jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint64_t o) {
20341 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
20342 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
20346 void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint64_t _res) {
20347 if (!ptr_is_owned(_res)) return;
20348 void* _res_ptr = untag_ptr(_res);
20349 CHECK_ACCESS(_res_ptr);
20350 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
20351 FREE(untag_ptr(_res));
20352 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
20355 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
20356 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20357 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
20358 return tag_ptr(ret_conv, true);
20360 int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint64_t arg) {
20361 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
20362 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
20366 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint64_t orig) {
20367 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
20368 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
20369 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
20370 return tag_ptr(ret_conv, true);
20373 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint64_t o) {
20374 LDKQueryChannelRange o_conv;
20375 o_conv.inner = untag_ptr(o);
20376 o_conv.is_owned = ptr_is_owned(o);
20377 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20378 o_conv = QueryChannelRange_clone(&o_conv);
20379 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20380 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
20381 return tag_ptr(ret_conv, true);
20384 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
20385 LDKDecodeError e_conv;
20386 e_conv.inner = untag_ptr(e);
20387 e_conv.is_owned = ptr_is_owned(e);
20388 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20389 e_conv = DecodeError_clone(&e_conv);
20390 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20391 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
20392 return tag_ptr(ret_conv, true);
20395 jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
20396 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
20397 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
20401 void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint64_t _res) {
20402 if (!ptr_is_owned(_res)) return;
20403 void* _res_ptr = untag_ptr(_res);
20404 CHECK_ACCESS(_res_ptr);
20405 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
20406 FREE(untag_ptr(_res));
20407 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
20410 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
20411 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20412 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
20413 return tag_ptr(ret_conv, true);
20415 int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
20416 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
20417 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
20421 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint64_t orig) {
20422 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
20423 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
20424 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
20425 return tag_ptr(ret_conv, true);
20428 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint64_t o) {
20429 LDKReplyChannelRange o_conv;
20430 o_conv.inner = untag_ptr(o);
20431 o_conv.is_owned = ptr_is_owned(o);
20432 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20433 o_conv = ReplyChannelRange_clone(&o_conv);
20434 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20435 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
20436 return tag_ptr(ret_conv, true);
20439 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
20440 LDKDecodeError e_conv;
20441 e_conv.inner = untag_ptr(e);
20442 e_conv.is_owned = ptr_is_owned(e);
20443 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20444 e_conv = DecodeError_clone(&e_conv);
20445 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20446 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
20447 return tag_ptr(ret_conv, true);
20450 jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
20451 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
20452 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
20456 void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint64_t _res) {
20457 if (!ptr_is_owned(_res)) return;
20458 void* _res_ptr = untag_ptr(_res);
20459 CHECK_ACCESS(_res_ptr);
20460 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
20461 FREE(untag_ptr(_res));
20462 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
20465 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
20466 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20467 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
20468 return tag_ptr(ret_conv, true);
20470 int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
20471 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
20472 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
20476 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint64_t orig) {
20477 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
20478 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
20479 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
20480 return tag_ptr(ret_conv, true);
20483 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint64_t o) {
20484 LDKGossipTimestampFilter o_conv;
20485 o_conv.inner = untag_ptr(o);
20486 o_conv.is_owned = ptr_is_owned(o);
20487 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20488 o_conv = GossipTimestampFilter_clone(&o_conv);
20489 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20490 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
20491 return tag_ptr(ret_conv, true);
20494 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
20495 LDKDecodeError e_conv;
20496 e_conv.inner = untag_ptr(e);
20497 e_conv.is_owned = ptr_is_owned(e);
20498 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20499 e_conv = DecodeError_clone(&e_conv);
20500 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20501 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
20502 return tag_ptr(ret_conv, true);
20505 jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint64_t o) {
20506 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
20507 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
20511 void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint64_t _res) {
20512 if (!ptr_is_owned(_res)) return;
20513 void* _res_ptr = untag_ptr(_res);
20514 CHECK_ACCESS(_res_ptr);
20515 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
20516 FREE(untag_ptr(_res));
20517 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
20520 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
20521 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20522 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
20523 return tag_ptr(ret_conv, true);
20525 int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint64_t arg) {
20526 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
20527 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
20531 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint64_t orig) {
20532 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
20533 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
20534 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
20535 return tag_ptr(ret_conv, true);
20538 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
20540 o_conv.inner = untag_ptr(o);
20541 o_conv.is_owned = ptr_is_owned(o);
20542 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20543 o_conv = Invoice_clone(&o_conv);
20544 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20545 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
20546 return tag_ptr(ret_conv, true);
20549 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) {
20550 void* e_ptr = untag_ptr(e);
20551 CHECK_ACCESS(e_ptr);
20552 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
20553 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
20554 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20555 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
20556 return tag_ptr(ret_conv, true);
20559 jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) {
20560 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
20561 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
20565 void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) {
20566 if (!ptr_is_owned(_res)) return;
20567 void* _res_ptr = untag_ptr(_res);
20568 CHECK_ACCESS(_res_ptr);
20569 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
20570 FREE(untag_ptr(_res));
20571 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
20574 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
20575 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20576 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
20577 return tag_ptr(ret_conv, true);
20579 int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) {
20580 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
20581 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
20585 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) {
20586 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
20587 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
20588 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
20589 return tag_ptr(ret_conv, true);
20592 uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) {
20593 void* o_ptr = untag_ptr(o);
20594 CHECK_ACCESS(o_ptr);
20595 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
20596 if (o_conv.free == LDKFilter_JCalls_free) {
20597 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
20598 LDKFilter_JCalls_cloned(&o_conv);
20600 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
20601 *ret_copy = COption_FilterZ_some(o_conv);
20602 uint64_t ret_ref = tag_ptr(ret_copy, true);
20606 uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() {
20607 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
20608 *ret_copy = COption_FilterZ_none();
20609 uint64_t ret_ref = tag_ptr(ret_copy, true);
20613 void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) {
20614 if (!ptr_is_owned(_res)) return;
20615 void* _res_ptr = untag_ptr(_res);
20616 CHECK_ACCESS(_res_ptr);
20617 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
20618 FREE(untag_ptr(_res));
20619 COption_FilterZ_free(_res_conv);
20622 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) {
20623 LDKLockedChannelMonitor o_conv;
20624 o_conv.inner = untag_ptr(o);
20625 o_conv.is_owned = ptr_is_owned(o);
20626 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20627 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
20629 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
20630 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
20631 return tag_ptr(ret_conv, true);
20634 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() {
20635 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
20636 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
20637 return tag_ptr(ret_conv, true);
20640 jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) {
20641 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
20642 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
20646 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) {
20647 if (!ptr_is_owned(_res)) return;
20648 void* _res_ptr = untag_ptr(_res);
20649 CHECK_ACCESS(_res_ptr);
20650 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
20651 FREE(untag_ptr(_res));
20652 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
20655 void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) {
20656 LDKCVec_OutPointZ _res_constr;
20657 _res_constr.datalen = _res->arr_len;
20658 if (_res_constr.datalen > 0)
20659 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
20661 _res_constr.data = NULL;
20662 uint64_t* _res_vals = _res->elems;
20663 for (size_t k = 0; k < _res_constr.datalen; k++) {
20664 uint64_t _res_conv_10 = _res_vals[k];
20665 LDKOutPoint _res_conv_10_conv;
20666 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
20667 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
20668 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
20669 _res_constr.data[k] = _res_conv_10_conv;
20672 CVec_OutPointZ_free(_res_constr);
20675 void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
20676 if (!ptr_is_owned(this_ptr)) return;
20677 void* this_ptr_ptr = untag_ptr(this_ptr);
20678 CHECK_ACCESS(this_ptr_ptr);
20679 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
20680 FREE(untag_ptr(this_ptr));
20681 PaymentPurpose_free(this_ptr_conv);
20684 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
20685 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20686 *ret_copy = PaymentPurpose_clone(arg);
20687 uint64_t ret_ref = tag_ptr(ret_copy, true);
20690 int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) {
20691 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
20692 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
20696 uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) {
20697 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
20698 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20699 *ret_copy = PaymentPurpose_clone(orig_conv);
20700 uint64_t ret_ref = tag_ptr(ret_copy, true);
20704 uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
20705 LDKThirtyTwoBytes payment_preimage_ref;
20706 CHECK(payment_preimage->arr_len == 32);
20707 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
20708 LDKThirtyTwoBytes payment_secret_ref;
20709 CHECK(payment_secret->arr_len == 32);
20710 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
20711 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20712 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
20713 uint64_t ret_ref = tag_ptr(ret_copy, true);
20717 uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
20718 LDKThirtyTwoBytes a_ref;
20719 CHECK(a->arr_len == 32);
20720 memcpy(a_ref.data, a->elems, 32); FREE(a);
20721 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
20722 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
20723 uint64_t ret_ref = tag_ptr(ret_copy, true);
20727 int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
20728 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
20729 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
20730 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20731 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20732 CVec_u8Z_free(ret_var);
20736 uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
20737 LDKu8slice ser_ref;
20738 ser_ref.datalen = ser->arr_len;
20739 ser_ref.data = ser->elems;
20740 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
20741 *ret_conv = PaymentPurpose_read(ser_ref);
20743 return tag_ptr(ret_conv, true);
20746 void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
20747 if (!ptr_is_owned(this_ptr)) return;
20748 void* this_ptr_ptr = untag_ptr(this_ptr);
20749 CHECK_ACCESS(this_ptr_ptr);
20750 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
20751 FREE(untag_ptr(this_ptr));
20752 ClosureReason_free(this_ptr_conv);
20755 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
20756 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20757 *ret_copy = ClosureReason_clone(arg);
20758 uint64_t ret_ref = tag_ptr(ret_copy, true);
20761 int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) {
20762 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
20763 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
20767 uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) {
20768 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
20769 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20770 *ret_copy = ClosureReason_clone(orig_conv);
20771 uint64_t ret_ref = tag_ptr(ret_copy, true);
20775 uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) {
20776 LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg);
20777 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20778 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
20779 uint64_t ret_ref = tag_ptr(ret_copy, true);
20783 uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() {
20784 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20785 *ret_copy = ClosureReason_holder_force_closed();
20786 uint64_t ret_ref = tag_ptr(ret_copy, true);
20790 uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() {
20791 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20792 *ret_copy = ClosureReason_cooperative_closure();
20793 uint64_t ret_ref = tag_ptr(ret_copy, true);
20797 uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() {
20798 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20799 *ret_copy = ClosureReason_commitment_tx_confirmed();
20800 uint64_t ret_ref = tag_ptr(ret_copy, true);
20804 uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() {
20805 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20806 *ret_copy = ClosureReason_funding_timed_out();
20807 uint64_t ret_ref = tag_ptr(ret_copy, true);
20811 uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) {
20812 LDKStr err_conv = str_ref_to_owned_c(err);
20813 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20814 *ret_copy = ClosureReason_processing_error(err_conv);
20815 uint64_t ret_ref = tag_ptr(ret_copy, true);
20819 uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() {
20820 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20821 *ret_copy = ClosureReason_disconnected_peer();
20822 uint64_t ret_ref = tag_ptr(ret_copy, true);
20826 uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() {
20827 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
20828 *ret_copy = ClosureReason_outdated_channel_manager();
20829 uint64_t ret_ref = tag_ptr(ret_copy, true);
20833 int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
20834 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
20835 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
20836 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20837 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20838 CVec_u8Z_free(ret_var);
20842 uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
20843 LDKu8slice ser_ref;
20844 ser_ref.datalen = ser->arr_len;
20845 ser_ref.data = ser->elems;
20846 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
20847 *ret_conv = ClosureReason_read(ser_ref);
20849 return tag_ptr(ret_conv, true);
20852 void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_free(uint64_t this_ptr) {
20853 if (!ptr_is_owned(this_ptr)) return;
20854 void* this_ptr_ptr = untag_ptr(this_ptr);
20855 CHECK_ACCESS(this_ptr_ptr);
20856 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
20857 FREE(untag_ptr(this_ptr));
20858 HTLCDestination_free(this_ptr_conv);
20861 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
20862 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
20863 *ret_copy = HTLCDestination_clone(arg);
20864 uint64_t ret_ref = tag_ptr(ret_copy, true);
20867 int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) {
20868 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
20869 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
20873 uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) {
20874 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
20875 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
20876 *ret_copy = HTLCDestination_clone(orig_conv);
20877 uint64_t ret_ref = tag_ptr(ret_copy, true);
20881 uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) {
20882 LDKPublicKey node_id_ref;
20883 CHECK(node_id->arr_len == 33);
20884 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20885 LDKThirtyTwoBytes channel_id_ref;
20886 CHECK(channel_id->arr_len == 32);
20887 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
20888 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
20889 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
20890 uint64_t ret_ref = tag_ptr(ret_copy, true);
20894 uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) {
20895 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
20896 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
20897 uint64_t ret_ref = tag_ptr(ret_copy, true);
20901 uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
20902 LDKThirtyTwoBytes payment_hash_ref;
20903 CHECK(payment_hash->arr_len == 32);
20904 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20905 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
20906 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
20907 uint64_t ret_ref = tag_ptr(ret_copy, true);
20911 int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
20912 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
20913 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
20914 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20915 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20916 CVec_u8Z_free(ret_var);
20920 uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) {
20921 LDKu8slice ser_ref;
20922 ser_ref.datalen = ser->arr_len;
20923 ser_ref.data = ser->elems;
20924 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
20925 *ret_conv = HTLCDestination_read(ser_ref);
20927 return tag_ptr(ret_conv, true);
20930 void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint64_t this_ptr) {
20931 if (!ptr_is_owned(this_ptr)) return;
20932 void* this_ptr_ptr = untag_ptr(this_ptr);
20933 CHECK_ACCESS(this_ptr_ptr);
20934 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
20935 FREE(untag_ptr(this_ptr));
20936 Event_free(this_ptr_conv);
20939 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
20940 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20941 *ret_copy = Event_clone(arg);
20942 uint64_t ret_ref = tag_ptr(ret_copy, true);
20945 int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) {
20946 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
20947 int64_t ret_conv = Event_clone_ptr(arg_conv);
20951 uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) {
20952 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
20953 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20954 *ret_copy = Event_clone(orig_conv);
20955 uint64_t ret_ref = tag_ptr(ret_copy, true);
20959 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) {
20960 LDKThirtyTwoBytes temporary_channel_id_ref;
20961 CHECK(temporary_channel_id->arr_len == 32);
20962 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
20963 LDKPublicKey counterparty_node_id_ref;
20964 CHECK(counterparty_node_id->arr_len == 33);
20965 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
20966 LDKCVec_u8Z output_script_ref;
20967 output_script_ref.datalen = output_script->arr_len;
20968 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
20969 memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
20970 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20971 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
20972 uint64_t ret_ref = tag_ptr(ret_copy, true);
20976 uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
20977 LDKThirtyTwoBytes payment_hash_ref;
20978 CHECK(payment_hash->arr_len == 32);
20979 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20980 void* purpose_ptr = untag_ptr(purpose);
20981 CHECK_ACCESS(purpose_ptr);
20982 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
20983 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
20984 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20985 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
20986 uint64_t ret_ref = tag_ptr(ret_copy, true);
20990 uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
20991 LDKThirtyTwoBytes payment_hash_ref;
20992 CHECK(payment_hash->arr_len == 32);
20993 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20994 void* purpose_ptr = untag_ptr(purpose);
20995 CHECK_ACCESS(purpose_ptr);
20996 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
20997 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
20998 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20999 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
21000 uint64_t ret_ref = tag_ptr(ret_copy, true);
21004 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) {
21005 LDKThirtyTwoBytes payment_id_ref;
21006 CHECK(payment_id->arr_len == 32);
21007 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21008 LDKThirtyTwoBytes payment_preimage_ref;
21009 CHECK(payment_preimage->arr_len == 32);
21010 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
21011 LDKThirtyTwoBytes payment_hash_ref;
21012 CHECK(payment_hash->arr_len == 32);
21013 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21014 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
21015 CHECK_ACCESS(fee_paid_msat_ptr);
21016 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
21017 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
21018 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21019 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
21020 uint64_t ret_ref = tag_ptr(ret_copy, true);
21024 uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
21025 LDKThirtyTwoBytes payment_id_ref;
21026 CHECK(payment_id->arr_len == 32);
21027 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21028 LDKThirtyTwoBytes payment_hash_ref;
21029 CHECK(payment_hash->arr_len == 32);
21030 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21031 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21032 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
21033 uint64_t ret_ref = tag_ptr(ret_copy, true);
21037 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) {
21038 LDKThirtyTwoBytes payment_id_ref;
21039 CHECK(payment_id->arr_len == 32);
21040 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21041 LDKThirtyTwoBytes payment_hash_ref;
21042 CHECK(payment_hash->arr_len == 32);
21043 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21044 LDKCVec_RouteHopZ path_constr;
21045 path_constr.datalen = path->arr_len;
21046 if (path_constr.datalen > 0)
21047 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21049 path_constr.data = NULL;
21050 uint64_t* path_vals = path->elems;
21051 for (size_t k = 0; k < path_constr.datalen; k++) {
21052 uint64_t path_conv_10 = path_vals[k];
21053 LDKRouteHop path_conv_10_conv;
21054 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21055 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21056 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21057 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21058 path_constr.data[k] = path_conv_10_conv;
21061 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21062 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
21063 uint64_t ret_ref = tag_ptr(ret_copy, true);
21067 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) {
21068 LDKThirtyTwoBytes payment_id_ref;
21069 CHECK(payment_id->arr_len == 32);
21070 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21071 LDKThirtyTwoBytes payment_hash_ref;
21072 CHECK(payment_hash->arr_len == 32);
21073 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21074 void* network_update_ptr = untag_ptr(network_update);
21075 CHECK_ACCESS(network_update_ptr);
21076 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
21077 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
21078 LDKCVec_RouteHopZ path_constr;
21079 path_constr.datalen = path->arr_len;
21080 if (path_constr.datalen > 0)
21081 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21083 path_constr.data = NULL;
21084 uint64_t* path_vals = path->elems;
21085 for (size_t k = 0; k < path_constr.datalen; k++) {
21086 uint64_t path_conv_10 = path_vals[k];
21087 LDKRouteHop path_conv_10_conv;
21088 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21089 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21090 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21091 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21092 path_constr.data[k] = path_conv_10_conv;
21095 void* short_channel_id_ptr = untag_ptr(short_channel_id);
21096 CHECK_ACCESS(short_channel_id_ptr);
21097 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
21098 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
21099 LDKRouteParameters retry_conv;
21100 retry_conv.inner = untag_ptr(retry);
21101 retry_conv.is_owned = ptr_is_owned(retry);
21102 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
21103 retry_conv = RouteParameters_clone(&retry_conv);
21104 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21105 *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);
21106 uint64_t ret_ref = tag_ptr(ret_copy, true);
21110 uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
21111 LDKThirtyTwoBytes payment_id_ref;
21112 CHECK(payment_id->arr_len == 32);
21113 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21114 LDKThirtyTwoBytes payment_hash_ref;
21115 CHECK(payment_hash->arr_len == 32);
21116 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21117 LDKCVec_RouteHopZ path_constr;
21118 path_constr.datalen = path->arr_len;
21119 if (path_constr.datalen > 0)
21120 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21122 path_constr.data = NULL;
21123 uint64_t* path_vals = path->elems;
21124 for (size_t k = 0; k < path_constr.datalen; k++) {
21125 uint64_t path_conv_10 = path_vals[k];
21126 LDKRouteHop path_conv_10_conv;
21127 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21128 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21129 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21130 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21131 path_constr.data[k] = path_conv_10_conv;
21134 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21135 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
21136 uint64_t ret_ref = tag_ptr(ret_copy, true);
21140 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) {
21141 LDKThirtyTwoBytes payment_id_ref;
21142 CHECK(payment_id->arr_len == 32);
21143 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
21144 LDKThirtyTwoBytes payment_hash_ref;
21145 CHECK(payment_hash->arr_len == 32);
21146 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
21147 LDKCVec_RouteHopZ path_constr;
21148 path_constr.datalen = path->arr_len;
21149 if (path_constr.datalen > 0)
21150 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
21152 path_constr.data = NULL;
21153 uint64_t* path_vals = path->elems;
21154 for (size_t k = 0; k < path_constr.datalen; k++) {
21155 uint64_t path_conv_10 = path_vals[k];
21156 LDKRouteHop path_conv_10_conv;
21157 path_conv_10_conv.inner = untag_ptr(path_conv_10);
21158 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
21159 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
21160 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
21161 path_constr.data[k] = path_conv_10_conv;
21164 void* short_channel_id_ptr = untag_ptr(short_channel_id);
21165 CHECK_ACCESS(short_channel_id_ptr);
21166 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
21167 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
21168 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21169 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
21170 uint64_t ret_ref = tag_ptr(ret_copy, true);
21174 uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
21175 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21176 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
21177 uint64_t ret_ref = tag_ptr(ret_copy, true);
21181 uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
21182 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
21183 outputs_constr.datalen = outputs->arr_len;
21184 if (outputs_constr.datalen > 0)
21185 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
21187 outputs_constr.data = NULL;
21188 uint64_t* outputs_vals = outputs->elems;
21189 for (size_t b = 0; b < outputs_constr.datalen; b++) {
21190 uint64_t outputs_conv_27 = outputs_vals[b];
21191 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
21192 CHECK_ACCESS(outputs_conv_27_ptr);
21193 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
21194 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
21195 outputs_constr.data[b] = outputs_conv_27_conv;
21198 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21199 *ret_copy = Event_spendable_outputs(outputs_constr);
21200 uint64_t ret_ref = tag_ptr(ret_copy, true);
21204 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) {
21205 LDKThirtyTwoBytes prev_channel_id_ref;
21206 CHECK(prev_channel_id->arr_len == 32);
21207 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
21208 LDKThirtyTwoBytes next_channel_id_ref;
21209 CHECK(next_channel_id->arr_len == 32);
21210 memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id);
21211 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
21212 CHECK_ACCESS(fee_earned_msat_ptr);
21213 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
21214 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
21215 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21216 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
21217 uint64_t ret_ref = tag_ptr(ret_copy, true);
21221 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) {
21222 LDKThirtyTwoBytes channel_id_ref;
21223 CHECK(channel_id->arr_len == 32);
21224 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
21225 void* reason_ptr = untag_ptr(reason);
21226 CHECK_ACCESS(reason_ptr);
21227 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
21228 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
21229 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21230 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
21231 uint64_t ret_ref = tag_ptr(ret_copy, true);
21235 uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) {
21236 LDKThirtyTwoBytes channel_id_ref;
21237 CHECK(channel_id->arr_len == 32);
21238 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
21239 LDKTransaction transaction_ref;
21240 transaction_ref.datalen = transaction->arr_len;
21241 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
21242 memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction);
21243 transaction_ref.data_is_owned = true;
21244 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21245 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
21246 uint64_t ret_ref = tag_ptr(ret_copy, true);
21250 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) {
21251 LDKThirtyTwoBytes temporary_channel_id_ref;
21252 CHECK(temporary_channel_id->arr_len == 32);
21253 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
21254 LDKPublicKey counterparty_node_id_ref;
21255 CHECK(counterparty_node_id->arr_len == 33);
21256 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
21257 LDKChannelTypeFeatures channel_type_conv;
21258 channel_type_conv.inner = untag_ptr(channel_type);
21259 channel_type_conv.is_owned = ptr_is_owned(channel_type);
21260 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
21261 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
21262 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21263 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
21264 uint64_t ret_ref = tag_ptr(ret_copy, true);
21268 uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) {
21269 LDKThirtyTwoBytes prev_channel_id_ref;
21270 CHECK(prev_channel_id->arr_len == 32);
21271 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
21272 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
21273 CHECK_ACCESS(failed_next_destination_ptr);
21274 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
21275 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
21276 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
21277 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
21278 uint64_t ret_ref = tag_ptr(ret_copy, true);
21282 int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
21283 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
21284 LDKCVec_u8Z ret_var = Event_write(obj_conv);
21285 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21286 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21287 CVec_u8Z_free(ret_var);
21291 uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
21292 LDKu8slice ser_ref;
21293 ser_ref.datalen = ser->arr_len;
21294 ser_ref.data = ser->elems;
21295 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
21296 *ret_conv = Event_read(ser_ref);
21298 return tag_ptr(ret_conv, true);
21301 void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint64_t this_ptr) {
21302 if (!ptr_is_owned(this_ptr)) return;
21303 void* this_ptr_ptr = untag_ptr(this_ptr);
21304 CHECK_ACCESS(this_ptr_ptr);
21305 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
21306 FREE(untag_ptr(this_ptr));
21307 MessageSendEvent_free(this_ptr_conv);
21310 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
21311 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21312 *ret_copy = MessageSendEvent_clone(arg);
21313 uint64_t ret_ref = tag_ptr(ret_copy, true);
21316 int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) {
21317 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
21318 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
21322 uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) {
21323 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
21324 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21325 *ret_copy = MessageSendEvent_clone(orig_conv);
21326 uint64_t ret_ref = tag_ptr(ret_copy, true);
21330 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) {
21331 LDKPublicKey node_id_ref;
21332 CHECK(node_id->arr_len == 33);
21333 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21334 LDKAcceptChannel msg_conv;
21335 msg_conv.inner = untag_ptr(msg);
21336 msg_conv.is_owned = ptr_is_owned(msg);
21337 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21338 msg_conv = AcceptChannel_clone(&msg_conv);
21339 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21340 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
21341 uint64_t ret_ref = tag_ptr(ret_copy, true);
21345 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) {
21346 LDKPublicKey node_id_ref;
21347 CHECK(node_id->arr_len == 33);
21348 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21349 LDKOpenChannel msg_conv;
21350 msg_conv.inner = untag_ptr(msg);
21351 msg_conv.is_owned = ptr_is_owned(msg);
21352 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21353 msg_conv = OpenChannel_clone(&msg_conv);
21354 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21355 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
21356 uint64_t ret_ref = tag_ptr(ret_copy, true);
21360 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) {
21361 LDKPublicKey node_id_ref;
21362 CHECK(node_id->arr_len == 33);
21363 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21364 LDKFundingCreated msg_conv;
21365 msg_conv.inner = untag_ptr(msg);
21366 msg_conv.is_owned = ptr_is_owned(msg);
21367 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21368 msg_conv = FundingCreated_clone(&msg_conv);
21369 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21370 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
21371 uint64_t ret_ref = tag_ptr(ret_copy, true);
21375 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) {
21376 LDKPublicKey node_id_ref;
21377 CHECK(node_id->arr_len == 33);
21378 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21379 LDKFundingSigned msg_conv;
21380 msg_conv.inner = untag_ptr(msg);
21381 msg_conv.is_owned = ptr_is_owned(msg);
21382 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21383 msg_conv = FundingSigned_clone(&msg_conv);
21384 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21385 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
21386 uint64_t ret_ref = tag_ptr(ret_copy, true);
21390 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) {
21391 LDKPublicKey node_id_ref;
21392 CHECK(node_id->arr_len == 33);
21393 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21394 LDKChannelReady msg_conv;
21395 msg_conv.inner = untag_ptr(msg);
21396 msg_conv.is_owned = ptr_is_owned(msg);
21397 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21398 msg_conv = ChannelReady_clone(&msg_conv);
21399 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21400 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
21401 uint64_t ret_ref = tag_ptr(ret_copy, true);
21405 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) {
21406 LDKPublicKey node_id_ref;
21407 CHECK(node_id->arr_len == 33);
21408 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21409 LDKAnnouncementSignatures msg_conv;
21410 msg_conv.inner = untag_ptr(msg);
21411 msg_conv.is_owned = ptr_is_owned(msg);
21412 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21413 msg_conv = AnnouncementSignatures_clone(&msg_conv);
21414 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21415 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
21416 uint64_t ret_ref = tag_ptr(ret_copy, true);
21420 uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) {
21421 LDKPublicKey node_id_ref;
21422 CHECK(node_id->arr_len == 33);
21423 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21424 LDKCommitmentUpdate updates_conv;
21425 updates_conv.inner = untag_ptr(updates);
21426 updates_conv.is_owned = ptr_is_owned(updates);
21427 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
21428 updates_conv = CommitmentUpdate_clone(&updates_conv);
21429 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21430 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
21431 uint64_t ret_ref = tag_ptr(ret_copy, true);
21435 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) {
21436 LDKPublicKey node_id_ref;
21437 CHECK(node_id->arr_len == 33);
21438 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21439 LDKRevokeAndACK msg_conv;
21440 msg_conv.inner = untag_ptr(msg);
21441 msg_conv.is_owned = ptr_is_owned(msg);
21442 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21443 msg_conv = RevokeAndACK_clone(&msg_conv);
21444 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21445 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
21446 uint64_t ret_ref = tag_ptr(ret_copy, true);
21450 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) {
21451 LDKPublicKey node_id_ref;
21452 CHECK(node_id->arr_len == 33);
21453 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21454 LDKClosingSigned msg_conv;
21455 msg_conv.inner = untag_ptr(msg);
21456 msg_conv.is_owned = ptr_is_owned(msg);
21457 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21458 msg_conv = ClosingSigned_clone(&msg_conv);
21459 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21460 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
21461 uint64_t ret_ref = tag_ptr(ret_copy, true);
21465 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) {
21466 LDKPublicKey node_id_ref;
21467 CHECK(node_id->arr_len == 33);
21468 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21469 LDKShutdown msg_conv;
21470 msg_conv.inner = untag_ptr(msg);
21471 msg_conv.is_owned = ptr_is_owned(msg);
21472 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21473 msg_conv = Shutdown_clone(&msg_conv);
21474 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21475 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
21476 uint64_t ret_ref = tag_ptr(ret_copy, true);
21480 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) {
21481 LDKPublicKey node_id_ref;
21482 CHECK(node_id->arr_len == 33);
21483 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21484 LDKChannelReestablish msg_conv;
21485 msg_conv.inner = untag_ptr(msg);
21486 msg_conv.is_owned = ptr_is_owned(msg);
21487 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21488 msg_conv = ChannelReestablish_clone(&msg_conv);
21489 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21490 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
21491 uint64_t ret_ref = tag_ptr(ret_copy, true);
21495 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) {
21496 LDKPublicKey node_id_ref;
21497 CHECK(node_id->arr_len == 33);
21498 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21499 LDKChannelAnnouncement msg_conv;
21500 msg_conv.inner = untag_ptr(msg);
21501 msg_conv.is_owned = ptr_is_owned(msg);
21502 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21503 msg_conv = ChannelAnnouncement_clone(&msg_conv);
21504 LDKChannelUpdate update_msg_conv;
21505 update_msg_conv.inner = untag_ptr(update_msg);
21506 update_msg_conv.is_owned = ptr_is_owned(update_msg);
21507 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
21508 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
21509 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21510 *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
21511 uint64_t ret_ref = tag_ptr(ret_copy, true);
21515 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
21516 LDKChannelAnnouncement 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 = ChannelAnnouncement_clone(&msg_conv);
21521 LDKChannelUpdate update_msg_conv;
21522 update_msg_conv.inner = untag_ptr(update_msg);
21523 update_msg_conv.is_owned = ptr_is_owned(update_msg);
21524 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
21525 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
21526 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21527 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
21528 uint64_t ret_ref = tag_ptr(ret_copy, true);
21532 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) {
21533 LDKChannelUpdate msg_conv;
21534 msg_conv.inner = untag_ptr(msg);
21535 msg_conv.is_owned = ptr_is_owned(msg);
21536 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21537 msg_conv = ChannelUpdate_clone(&msg_conv);
21538 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21539 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
21540 uint64_t ret_ref = tag_ptr(ret_copy, true);
21544 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
21545 LDKPublicKey node_id_ref;
21546 CHECK(node_id->arr_len == 33);
21547 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21548 LDKChannelUpdate msg_conv;
21549 msg_conv.inner = untag_ptr(msg);
21550 msg_conv.is_owned = ptr_is_owned(msg);
21551 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21552 msg_conv = ChannelUpdate_clone(&msg_conv);
21553 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21554 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
21555 uint64_t ret_ref = tag_ptr(ret_copy, true);
21559 uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) {
21560 LDKPublicKey node_id_ref;
21561 CHECK(node_id->arr_len == 33);
21562 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21563 void* action_ptr = untag_ptr(action);
21564 CHECK_ACCESS(action_ptr);
21565 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
21566 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
21567 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21568 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
21569 uint64_t ret_ref = tag_ptr(ret_copy, true);
21573 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) {
21574 LDKPublicKey node_id_ref;
21575 CHECK(node_id->arr_len == 33);
21576 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21577 LDKQueryChannelRange msg_conv;
21578 msg_conv.inner = untag_ptr(msg);
21579 msg_conv.is_owned = ptr_is_owned(msg);
21580 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21581 msg_conv = QueryChannelRange_clone(&msg_conv);
21582 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21583 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
21584 uint64_t ret_ref = tag_ptr(ret_copy, true);
21588 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) {
21589 LDKPublicKey node_id_ref;
21590 CHECK(node_id->arr_len == 33);
21591 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21592 LDKQueryShortChannelIds msg_conv;
21593 msg_conv.inner = untag_ptr(msg);
21594 msg_conv.is_owned = ptr_is_owned(msg);
21595 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21596 msg_conv = QueryShortChannelIds_clone(&msg_conv);
21597 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21598 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
21599 uint64_t ret_ref = tag_ptr(ret_copy, true);
21603 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) {
21604 LDKPublicKey node_id_ref;
21605 CHECK(node_id->arr_len == 33);
21606 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21607 LDKReplyChannelRange msg_conv;
21608 msg_conv.inner = untag_ptr(msg);
21609 msg_conv.is_owned = ptr_is_owned(msg);
21610 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21611 msg_conv = ReplyChannelRange_clone(&msg_conv);
21612 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21613 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
21614 uint64_t ret_ref = tag_ptr(ret_copy, true);
21618 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) {
21619 LDKPublicKey node_id_ref;
21620 CHECK(node_id->arr_len == 33);
21621 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
21622 LDKGossipTimestampFilter msg_conv;
21623 msg_conv.inner = untag_ptr(msg);
21624 msg_conv.is_owned = ptr_is_owned(msg);
21625 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
21626 msg_conv = GossipTimestampFilter_clone(&msg_conv);
21627 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
21628 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
21629 uint64_t ret_ref = tag_ptr(ret_copy, true);
21633 void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint64_t this_ptr) {
21634 if (!ptr_is_owned(this_ptr)) return;
21635 void* this_ptr_ptr = untag_ptr(this_ptr);
21636 CHECK_ACCESS(this_ptr_ptr);
21637 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
21638 FREE(untag_ptr(this_ptr));
21639 MessageSendEventsProvider_free(this_ptr_conv);
21642 void __attribute__((export_name("TS_OnionMessageProvider_free"))) TS_OnionMessageProvider_free(uint64_t this_ptr) {
21643 if (!ptr_is_owned(this_ptr)) return;
21644 void* this_ptr_ptr = untag_ptr(this_ptr);
21645 CHECK_ACCESS(this_ptr_ptr);
21646 LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
21647 FREE(untag_ptr(this_ptr));
21648 OnionMessageProvider_free(this_ptr_conv);
21651 void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
21652 if (!ptr_is_owned(this_ptr)) return;
21653 void* this_ptr_ptr = untag_ptr(this_ptr);
21654 CHECK_ACCESS(this_ptr_ptr);
21655 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
21656 FREE(untag_ptr(this_ptr));
21657 EventsProvider_free(this_ptr_conv);
21660 void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint64_t this_ptr) {
21661 if (!ptr_is_owned(this_ptr)) return;
21662 void* this_ptr_ptr = untag_ptr(this_ptr);
21663 CHECK_ACCESS(this_ptr_ptr);
21664 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
21665 FREE(untag_ptr(this_ptr));
21666 EventHandler_free(this_ptr_conv);
21669 void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) {
21670 if (!ptr_is_owned(this_ptr)) return;
21671 void* this_ptr_ptr = untag_ptr(this_ptr);
21672 CHECK_ACCESS(this_ptr_ptr);
21673 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
21674 FREE(untag_ptr(this_ptr));
21675 APIError_free(this_ptr_conv);
21678 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
21679 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21680 *ret_copy = APIError_clone(arg);
21681 uint64_t ret_ref = tag_ptr(ret_copy, true);
21684 int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) {
21685 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
21686 int64_t ret_conv = APIError_clone_ptr(arg_conv);
21690 uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) {
21691 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
21692 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21693 *ret_copy = APIError_clone(orig_conv);
21694 uint64_t ret_ref = tag_ptr(ret_copy, true);
21698 uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) {
21699 LDKStr err_conv = str_ref_to_owned_c(err);
21700 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21701 *ret_copy = APIError_apimisuse_error(err_conv);
21702 uint64_t ret_ref = tag_ptr(ret_copy, true);
21706 uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
21707 LDKStr err_conv = str_ref_to_owned_c(err);
21708 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21709 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
21710 uint64_t ret_ref = tag_ptr(ret_copy, true);
21714 uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
21715 LDKStr err_conv = str_ref_to_owned_c(err);
21716 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21717 *ret_copy = APIError_route_error(err_conv);
21718 uint64_t ret_ref = tag_ptr(ret_copy, true);
21722 uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) {
21723 LDKStr err_conv = str_ref_to_owned_c(err);
21724 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21725 *ret_copy = APIError_channel_unavailable(err_conv);
21726 uint64_t ret_ref = tag_ptr(ret_copy, true);
21730 uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() {
21731 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21732 *ret_copy = APIError_monitor_update_failed();
21733 uint64_t ret_ref = tag_ptr(ret_copy, true);
21737 uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) {
21738 LDKShutdownScript script_conv;
21739 script_conv.inner = untag_ptr(script);
21740 script_conv.is_owned = ptr_is_owned(script);
21741 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
21742 script_conv = ShutdownScript_clone(&script_conv);
21743 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
21744 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
21745 uint64_t ret_ref = tag_ptr(ret_copy, true);
21749 void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
21750 LDKBigSize this_obj_conv;
21751 this_obj_conv.inner = untag_ptr(this_obj);
21752 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21754 BigSize_free(this_obj_conv);
21757 int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) {
21758 LDKBigSize this_ptr_conv;
21759 this_ptr_conv.inner = untag_ptr(this_ptr);
21760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21762 this_ptr_conv.is_owned = false;
21763 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
21767 void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) {
21768 LDKBigSize this_ptr_conv;
21769 this_ptr_conv.inner = untag_ptr(this_ptr);
21770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21772 this_ptr_conv.is_owned = false;
21773 BigSize_set_a(&this_ptr_conv, val);
21776 uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) {
21777 LDKBigSize ret_var = BigSize_new(a_arg);
21778 uint64_t ret_ref = 0;
21779 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21780 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21784 void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) {
21785 LDKHostname this_obj_conv;
21786 this_obj_conv.inner = untag_ptr(this_obj);
21787 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21789 Hostname_free(this_obj_conv);
21792 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
21793 LDKHostname ret_var = Hostname_clone(arg);
21794 uint64_t ret_ref = 0;
21795 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21796 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21799 int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) {
21800 LDKHostname arg_conv;
21801 arg_conv.inner = untag_ptr(arg);
21802 arg_conv.is_owned = ptr_is_owned(arg);
21803 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21804 arg_conv.is_owned = false;
21805 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
21809 uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) {
21810 LDKHostname orig_conv;
21811 orig_conv.inner = untag_ptr(orig);
21812 orig_conv.is_owned = ptr_is_owned(orig);
21813 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21814 orig_conv.is_owned = false;
21815 LDKHostname ret_var = Hostname_clone(&orig_conv);
21816 uint64_t ret_ref = 0;
21817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21822 int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
21823 LDKHostname this_arg_conv;
21824 this_arg_conv.inner = untag_ptr(this_arg);
21825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21827 this_arg_conv.is_owned = false;
21828 int8_t ret_conv = Hostname_len(&this_arg_conv);
21832 uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
21833 LDKu8slice msg_ref;
21834 msg_ref.datalen = msg->arr_len;
21835 msg_ref.data = msg->elems;
21836 unsigned char sk_arr[32];
21837 CHECK(sk->arr_len == 32);
21838 memcpy(sk_arr, sk->elems, 32); FREE(sk);
21839 unsigned char (*sk_ref)[32] = &sk_arr;
21840 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
21841 *ret_conv = sign(msg_ref, sk_ref);
21843 return tag_ptr(ret_conv, true);
21846 uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
21847 LDKu8slice msg_ref;
21848 msg_ref.datalen = msg->arr_len;
21849 msg_ref.data = msg->elems;
21850 LDKStr sig_conv = str_ref_to_owned_c(sig);
21851 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
21852 *ret_conv = recover_pk(msg_ref, sig_conv);
21854 return tag_ptr(ret_conv, true);
21857 jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
21858 LDKu8slice msg_ref;
21859 msg_ref.datalen = msg->arr_len;
21860 msg_ref.data = msg->elems;
21861 LDKStr sig_conv = str_ref_to_owned_c(sig);
21862 LDKPublicKey pk_ref;
21863 CHECK(pk->arr_len == 33);
21864 memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
21865 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
21870 int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
21871 LDKu8slice hrp_bytes_ref;
21872 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
21873 hrp_bytes_ref.data = hrp_bytes->elems;
21874 LDKCVec_u5Z data_without_signature_constr;
21875 data_without_signature_constr.datalen = data_without_signature->arr_len;
21876 if (data_without_signature_constr.datalen > 0)
21877 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
21879 data_without_signature_constr.data = NULL;
21880 int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
21881 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
21882 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
21884 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
21886 FREE(data_without_signature);
21887 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
21888 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21889 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21890 CVec_u8Z_free(ret_var);
21895 void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64_t this_ptr) {
21896 if (!ptr_is_owned(this_ptr)) return;
21897 void* this_ptr_ptr = untag_ptr(this_ptr);
21898 CHECK_ACCESS(this_ptr_ptr);
21899 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
21900 FREE(untag_ptr(this_ptr));
21901 Persister_free(this_ptr_conv);
21904 void __attribute__((export_name("TS_FutureCallback_free"))) TS_FutureCallback_free(uint64_t this_ptr) {
21905 if (!ptr_is_owned(this_ptr)) return;
21906 void* this_ptr_ptr = untag_ptr(this_ptr);
21907 CHECK_ACCESS(this_ptr_ptr);
21908 LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
21909 FREE(untag_ptr(this_ptr));
21910 FutureCallback_free(this_ptr_conv);
21913 void __attribute__((export_name("TS_Future_free"))) TS_Future_free(uint64_t this_obj) {
21914 LDKFuture this_obj_conv;
21915 this_obj_conv.inner = untag_ptr(this_obj);
21916 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21918 Future_free(this_obj_conv);
21921 void __attribute__((export_name("TS_Future_register_callback_fn"))) TS_Future_register_callback_fn(uint64_t this_arg, uint64_t callback) {
21922 LDKFuture this_arg_conv;
21923 this_arg_conv.inner = untag_ptr(this_arg);
21924 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21926 this_arg_conv.is_owned = false;
21927 void* callback_ptr = untag_ptr(callback);
21928 CHECK_ACCESS(callback_ptr);
21929 LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
21930 if (callback_conv.free == LDKFutureCallback_JCalls_free) {
21931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
21932 LDKFutureCallback_JCalls_cloned(&callback_conv);
21934 Future_register_callback_fn(&this_arg_conv, callback_conv);
21937 uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
21938 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
21939 uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
21943 uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() {
21944 uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
21948 uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() {
21949 uint32_t ret_conv = LDKLevel_to_js(Level_trace());
21953 uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() {
21954 uint32_t ret_conv = LDKLevel_to_js(Level_debug());
21958 uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() {
21959 uint32_t ret_conv = LDKLevel_to_js(Level_info());
21963 uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() {
21964 uint32_t ret_conv = LDKLevel_to_js(Level_warn());
21968 uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() {
21969 uint32_t ret_conv = LDKLevel_to_js(Level_error());
21973 jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) {
21974 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
21975 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
21976 jboolean ret_conv = Level_eq(a_conv, b_conv);
21980 int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) {
21981 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
21982 int64_t ret_conv = Level_hash(o_conv);
21986 uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() {
21987 uint32_t ret_conv = LDKLevel_to_js(Level_max());
21991 void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) {
21992 LDKRecord this_obj_conv;
21993 this_obj_conv.inner = untag_ptr(this_obj);
21994 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21996 Record_free(this_obj_conv);
21999 uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) {
22000 LDKRecord this_ptr_conv;
22001 this_ptr_conv.inner = untag_ptr(this_ptr);
22002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22004 this_ptr_conv.is_owned = false;
22005 uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv));
22009 void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) {
22010 LDKRecord this_ptr_conv;
22011 this_ptr_conv.inner = untag_ptr(this_ptr);
22012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22014 this_ptr_conv.is_owned = false;
22015 LDKLevel val_conv = LDKLevel_from_js(val);
22016 Record_set_level(&this_ptr_conv, val_conv);
22019 jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) {
22020 LDKRecord this_ptr_conv;
22021 this_ptr_conv.inner = untag_ptr(this_ptr);
22022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22024 this_ptr_conv.is_owned = false;
22025 LDKStr ret_str = Record_get_args(&this_ptr_conv);
22026 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22031 void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) {
22032 LDKRecord this_ptr_conv;
22033 this_ptr_conv.inner = untag_ptr(this_ptr);
22034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22036 this_ptr_conv.is_owned = false;
22037 LDKStr val_conv = str_ref_to_owned_c(val);
22038 Record_set_args(&this_ptr_conv, val_conv);
22041 jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) {
22042 LDKRecord this_ptr_conv;
22043 this_ptr_conv.inner = untag_ptr(this_ptr);
22044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22046 this_ptr_conv.is_owned = false;
22047 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
22048 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22053 void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) {
22054 LDKRecord this_ptr_conv;
22055 this_ptr_conv.inner = untag_ptr(this_ptr);
22056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22058 this_ptr_conv.is_owned = false;
22059 LDKStr val_conv = str_ref_to_owned_c(val);
22060 Record_set_module_path(&this_ptr_conv, val_conv);
22063 jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) {
22064 LDKRecord this_ptr_conv;
22065 this_ptr_conv.inner = untag_ptr(this_ptr);
22066 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22068 this_ptr_conv.is_owned = false;
22069 LDKStr ret_str = Record_get_file(&this_ptr_conv);
22070 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
22075 void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) {
22076 LDKRecord this_ptr_conv;
22077 this_ptr_conv.inner = untag_ptr(this_ptr);
22078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22080 this_ptr_conv.is_owned = false;
22081 LDKStr val_conv = str_ref_to_owned_c(val);
22082 Record_set_file(&this_ptr_conv, val_conv);
22085 int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) {
22086 LDKRecord this_ptr_conv;
22087 this_ptr_conv.inner = untag_ptr(this_ptr);
22088 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22090 this_ptr_conv.is_owned = false;
22091 int32_t ret_conv = Record_get_line(&this_ptr_conv);
22095 void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) {
22096 LDKRecord this_ptr_conv;
22097 this_ptr_conv.inner = untag_ptr(this_ptr);
22098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22100 this_ptr_conv.is_owned = false;
22101 Record_set_line(&this_ptr_conv, val);
22104 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
22105 LDKRecord ret_var = Record_clone(arg);
22106 uint64_t ret_ref = 0;
22107 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22108 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22111 int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) {
22112 LDKRecord arg_conv;
22113 arg_conv.inner = untag_ptr(arg);
22114 arg_conv.is_owned = ptr_is_owned(arg);
22115 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22116 arg_conv.is_owned = false;
22117 int64_t ret_conv = Record_clone_ptr(&arg_conv);
22121 uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) {
22122 LDKRecord orig_conv;
22123 orig_conv.inner = untag_ptr(orig);
22124 orig_conv.is_owned = ptr_is_owned(orig);
22125 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22126 orig_conv.is_owned = false;
22127 LDKRecord ret_var = Record_clone(&orig_conv);
22128 uint64_t ret_ref = 0;
22129 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22130 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22134 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint64_t this_ptr) {
22135 if (!ptr_is_owned(this_ptr)) return;
22136 void* this_ptr_ptr = untag_ptr(this_ptr);
22137 CHECK_ACCESS(this_ptr_ptr);
22138 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
22139 FREE(untag_ptr(this_ptr));
22140 Logger_free(this_ptr_conv);
22143 void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) {
22144 LDKChannelHandshakeConfig this_obj_conv;
22145 this_obj_conv.inner = untag_ptr(this_obj);
22146 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22148 ChannelHandshakeConfig_free(this_obj_conv);
22151 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) {
22152 LDKChannelHandshakeConfig this_ptr_conv;
22153 this_ptr_conv.inner = untag_ptr(this_ptr);
22154 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22156 this_ptr_conv.is_owned = false;
22157 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
22161 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) {
22162 LDKChannelHandshakeConfig this_ptr_conv;
22163 this_ptr_conv.inner = untag_ptr(this_ptr);
22164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22166 this_ptr_conv.is_owned = false;
22167 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
22170 int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(uint64_t this_ptr) {
22171 LDKChannelHandshakeConfig this_ptr_conv;
22172 this_ptr_conv.inner = untag_ptr(this_ptr);
22173 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22175 this_ptr_conv.is_owned = false;
22176 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
22180 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) {
22181 LDKChannelHandshakeConfig this_ptr_conv;
22182 this_ptr_conv.inner = untag_ptr(this_ptr);
22183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22185 this_ptr_conv.is_owned = false;
22186 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
22189 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint64_t this_ptr) {
22190 LDKChannelHandshakeConfig this_ptr_conv;
22191 this_ptr_conv.inner = untag_ptr(this_ptr);
22192 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22194 this_ptr_conv.is_owned = false;
22195 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
22199 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) {
22200 LDKChannelHandshakeConfig this_ptr_conv;
22201 this_ptr_conv.inner = untag_ptr(this_ptr);
22202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22204 this_ptr_conv.is_owned = false;
22205 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
22208 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) {
22209 LDKChannelHandshakeConfig this_ptr_conv;
22210 this_ptr_conv.inner = untag_ptr(this_ptr);
22211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22213 this_ptr_conv.is_owned = false;
22214 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
22218 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) {
22219 LDKChannelHandshakeConfig this_ptr_conv;
22220 this_ptr_conv.inner = untag_ptr(this_ptr);
22221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22223 this_ptr_conv.is_owned = false;
22224 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
22227 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(uint64_t this_ptr) {
22228 LDKChannelHandshakeConfig this_ptr_conv;
22229 this_ptr_conv.inner = untag_ptr(this_ptr);
22230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22232 this_ptr_conv.is_owned = false;
22233 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
22237 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean val) {
22238 LDKChannelHandshakeConfig this_ptr_conv;
22239 this_ptr_conv.inner = untag_ptr(this_ptr);
22240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22242 this_ptr_conv.is_owned = false;
22243 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
22246 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(uint64_t this_ptr) {
22247 LDKChannelHandshakeConfig this_ptr_conv;
22248 this_ptr_conv.inner = untag_ptr(this_ptr);
22249 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22251 this_ptr_conv.is_owned = false;
22252 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
22256 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean val) {
22257 LDKChannelHandshakeConfig this_ptr_conv;
22258 this_ptr_conv.inner = untag_ptr(this_ptr);
22259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22261 this_ptr_conv.is_owned = false;
22262 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
22265 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(uint64_t this_ptr) {
22266 LDKChannelHandshakeConfig this_ptr_conv;
22267 this_ptr_conv.inner = untag_ptr(this_ptr);
22268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22270 this_ptr_conv.is_owned = false;
22271 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
22275 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean val) {
22276 LDKChannelHandshakeConfig this_ptr_conv;
22277 this_ptr_conv.inner = untag_ptr(this_ptr);
22278 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22280 this_ptr_conv.is_owned = false;
22281 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
22284 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) {
22285 LDKChannelHandshakeConfig this_ptr_conv;
22286 this_ptr_conv.inner = untag_ptr(this_ptr);
22287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22289 this_ptr_conv.is_owned = false;
22290 int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
22294 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) {
22295 LDKChannelHandshakeConfig this_ptr_conv;
22296 this_ptr_conv.inner = untag_ptr(this_ptr);
22297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22299 this_ptr_conv.is_owned = false;
22300 ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
22303 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) {
22304 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);
22305 uint64_t ret_ref = 0;
22306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22311 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
22312 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
22313 uint64_t ret_ref = 0;
22314 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22315 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22318 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) {
22319 LDKChannelHandshakeConfig arg_conv;
22320 arg_conv.inner = untag_ptr(arg);
22321 arg_conv.is_owned = ptr_is_owned(arg);
22322 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22323 arg_conv.is_owned = false;
22324 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
22328 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) {
22329 LDKChannelHandshakeConfig orig_conv;
22330 orig_conv.inner = untag_ptr(orig);
22331 orig_conv.is_owned = ptr_is_owned(orig);
22332 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22333 orig_conv.is_owned = false;
22334 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
22335 uint64_t ret_ref = 0;
22336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22341 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() {
22342 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
22343 uint64_t ret_ref = 0;
22344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22349 void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) {
22350 LDKChannelHandshakeLimits this_obj_conv;
22351 this_obj_conv.inner = untag_ptr(this_obj);
22352 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22354 ChannelHandshakeLimits_free(this_obj_conv);
22357 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) {
22358 LDKChannelHandshakeLimits this_ptr_conv;
22359 this_ptr_conv.inner = untag_ptr(this_ptr);
22360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22362 this_ptr_conv.is_owned = false;
22363 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
22367 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) {
22368 LDKChannelHandshakeLimits this_ptr_conv;
22369 this_ptr_conv.inner = untag_ptr(this_ptr);
22370 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22372 this_ptr_conv.is_owned = false;
22373 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
22376 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) {
22377 LDKChannelHandshakeLimits this_ptr_conv;
22378 this_ptr_conv.inner = untag_ptr(this_ptr);
22379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22381 this_ptr_conv.is_owned = false;
22382 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
22386 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) {
22387 LDKChannelHandshakeLimits this_ptr_conv;
22388 this_ptr_conv.inner = untag_ptr(this_ptr);
22389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22391 this_ptr_conv.is_owned = false;
22392 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
22395 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) {
22396 LDKChannelHandshakeLimits this_ptr_conv;
22397 this_ptr_conv.inner = untag_ptr(this_ptr);
22398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22400 this_ptr_conv.is_owned = false;
22401 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
22405 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) {
22406 LDKChannelHandshakeLimits this_ptr_conv;
22407 this_ptr_conv.inner = untag_ptr(this_ptr);
22408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22410 this_ptr_conv.is_owned = false;
22411 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
22414 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) {
22415 LDKChannelHandshakeLimits this_ptr_conv;
22416 this_ptr_conv.inner = untag_ptr(this_ptr);
22417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22419 this_ptr_conv.is_owned = false;
22420 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
22424 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) {
22425 LDKChannelHandshakeLimits this_ptr_conv;
22426 this_ptr_conv.inner = untag_ptr(this_ptr);
22427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22429 this_ptr_conv.is_owned = false;
22430 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
22433 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) {
22434 LDKChannelHandshakeLimits this_ptr_conv;
22435 this_ptr_conv.inner = untag_ptr(this_ptr);
22436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22438 this_ptr_conv.is_owned = false;
22439 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
22443 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) {
22444 LDKChannelHandshakeLimits this_ptr_conv;
22445 this_ptr_conv.inner = untag_ptr(this_ptr);
22446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22448 this_ptr_conv.is_owned = false;
22449 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
22452 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) {
22453 LDKChannelHandshakeLimits this_ptr_conv;
22454 this_ptr_conv.inner = untag_ptr(this_ptr);
22455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22457 this_ptr_conv.is_owned = false;
22458 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
22462 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) {
22463 LDKChannelHandshakeLimits this_ptr_conv;
22464 this_ptr_conv.inner = untag_ptr(this_ptr);
22465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22467 this_ptr_conv.is_owned = false;
22468 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
22471 int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) {
22472 LDKChannelHandshakeLimits this_ptr_conv;
22473 this_ptr_conv.inner = untag_ptr(this_ptr);
22474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22476 this_ptr_conv.is_owned = false;
22477 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
22481 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) {
22482 LDKChannelHandshakeLimits this_ptr_conv;
22483 this_ptr_conv.inner = untag_ptr(this_ptr);
22484 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22486 this_ptr_conv.is_owned = false;
22487 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
22490 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) {
22491 LDKChannelHandshakeLimits this_ptr_conv;
22492 this_ptr_conv.inner = untag_ptr(this_ptr);
22493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22495 this_ptr_conv.is_owned = false;
22496 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
22500 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) {
22501 LDKChannelHandshakeLimits this_ptr_conv;
22502 this_ptr_conv.inner = untag_ptr(this_ptr);
22503 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22505 this_ptr_conv.is_owned = false;
22506 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
22509 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) {
22510 LDKChannelHandshakeLimits this_ptr_conv;
22511 this_ptr_conv.inner = untag_ptr(this_ptr);
22512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22514 this_ptr_conv.is_owned = false;
22515 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
22519 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) {
22520 LDKChannelHandshakeLimits this_ptr_conv;
22521 this_ptr_conv.inner = untag_ptr(this_ptr);
22522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22524 this_ptr_conv.is_owned = false;
22525 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
22528 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) {
22529 LDKChannelHandshakeLimits this_ptr_conv;
22530 this_ptr_conv.inner = untag_ptr(this_ptr);
22531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22533 this_ptr_conv.is_owned = false;
22534 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
22538 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) {
22539 LDKChannelHandshakeLimits this_ptr_conv;
22540 this_ptr_conv.inner = untag_ptr(this_ptr);
22541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22543 this_ptr_conv.is_owned = false;
22544 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
22547 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) {
22548 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);
22549 uint64_t ret_ref = 0;
22550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22555 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
22556 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
22557 uint64_t ret_ref = 0;
22558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22562 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) {
22563 LDKChannelHandshakeLimits arg_conv;
22564 arg_conv.inner = untag_ptr(arg);
22565 arg_conv.is_owned = ptr_is_owned(arg);
22566 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22567 arg_conv.is_owned = false;
22568 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
22572 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) {
22573 LDKChannelHandshakeLimits orig_conv;
22574 orig_conv.inner = untag_ptr(orig);
22575 orig_conv.is_owned = ptr_is_owned(orig);
22576 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22577 orig_conv.is_owned = false;
22578 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
22579 uint64_t ret_ref = 0;
22580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22585 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() {
22586 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
22587 uint64_t ret_ref = 0;
22588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22593 void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) {
22594 LDKChannelConfig this_obj_conv;
22595 this_obj_conv.inner = untag_ptr(this_obj);
22596 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22598 ChannelConfig_free(this_obj_conv);
22601 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) {
22602 LDKChannelConfig this_ptr_conv;
22603 this_ptr_conv.inner = untag_ptr(this_ptr);
22604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22606 this_ptr_conv.is_owned = false;
22607 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
22611 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) {
22612 LDKChannelConfig this_ptr_conv;
22613 this_ptr_conv.inner = untag_ptr(this_ptr);
22614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22616 this_ptr_conv.is_owned = false;
22617 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
22620 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) {
22621 LDKChannelConfig this_ptr_conv;
22622 this_ptr_conv.inner = untag_ptr(this_ptr);
22623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22625 this_ptr_conv.is_owned = false;
22626 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
22630 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) {
22631 LDKChannelConfig this_ptr_conv;
22632 this_ptr_conv.inner = untag_ptr(this_ptr);
22633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22635 this_ptr_conv.is_owned = false;
22636 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
22639 int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) {
22640 LDKChannelConfig this_ptr_conv;
22641 this_ptr_conv.inner = untag_ptr(this_ptr);
22642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22644 this_ptr_conv.is_owned = false;
22645 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
22649 void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
22650 LDKChannelConfig this_ptr_conv;
22651 this_ptr_conv.inner = untag_ptr(this_ptr);
22652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22654 this_ptr_conv.is_owned = false;
22655 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
22658 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) {
22659 LDKChannelConfig this_ptr_conv;
22660 this_ptr_conv.inner = untag_ptr(this_ptr);
22661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22663 this_ptr_conv.is_owned = false;
22664 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
22668 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) {
22669 LDKChannelConfig this_ptr_conv;
22670 this_ptr_conv.inner = untag_ptr(this_ptr);
22671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22673 this_ptr_conv.is_owned = false;
22674 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
22677 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) {
22678 LDKChannelConfig this_ptr_conv;
22679 this_ptr_conv.inner = untag_ptr(this_ptr);
22680 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22682 this_ptr_conv.is_owned = false;
22683 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
22687 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) {
22688 LDKChannelConfig this_ptr_conv;
22689 this_ptr_conv.inner = untag_ptr(this_ptr);
22690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22692 this_ptr_conv.is_owned = false;
22693 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
22696 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) {
22697 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);
22698 uint64_t ret_ref = 0;
22699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22704 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
22705 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
22706 uint64_t ret_ref = 0;
22707 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22708 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22711 int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) {
22712 LDKChannelConfig arg_conv;
22713 arg_conv.inner = untag_ptr(arg);
22714 arg_conv.is_owned = ptr_is_owned(arg);
22715 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22716 arg_conv.is_owned = false;
22717 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
22721 uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) {
22722 LDKChannelConfig orig_conv;
22723 orig_conv.inner = untag_ptr(orig);
22724 orig_conv.is_owned = ptr_is_owned(orig);
22725 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22726 orig_conv.is_owned = false;
22727 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
22728 uint64_t ret_ref = 0;
22729 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22730 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22734 uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
22735 LDKChannelConfig ret_var = ChannelConfig_default();
22736 uint64_t ret_ref = 0;
22737 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22738 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22742 int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) {
22743 LDKChannelConfig obj_conv;
22744 obj_conv.inner = untag_ptr(obj);
22745 obj_conv.is_owned = ptr_is_owned(obj);
22746 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22747 obj_conv.is_owned = false;
22748 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
22749 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22750 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22751 CVec_u8Z_free(ret_var);
22755 uint64_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
22756 LDKu8slice ser_ref;
22757 ser_ref.datalen = ser->arr_len;
22758 ser_ref.data = ser->elems;
22759 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22760 *ret_conv = ChannelConfig_read(ser_ref);
22762 return tag_ptr(ret_conv, true);
22765 void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) {
22766 LDKUserConfig this_obj_conv;
22767 this_obj_conv.inner = untag_ptr(this_obj);
22768 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22770 UserConfig_free(this_obj_conv);
22773 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) {
22774 LDKUserConfig this_ptr_conv;
22775 this_ptr_conv.inner = untag_ptr(this_ptr);
22776 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22778 this_ptr_conv.is_owned = false;
22779 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
22780 uint64_t ret_ref = 0;
22781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22786 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) {
22787 LDKUserConfig this_ptr_conv;
22788 this_ptr_conv.inner = untag_ptr(this_ptr);
22789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22791 this_ptr_conv.is_owned = false;
22792 LDKChannelHandshakeConfig val_conv;
22793 val_conv.inner = untag_ptr(val);
22794 val_conv.is_owned = ptr_is_owned(val);
22795 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
22796 val_conv = ChannelHandshakeConfig_clone(&val_conv);
22797 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
22800 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) {
22801 LDKUserConfig this_ptr_conv;
22802 this_ptr_conv.inner = untag_ptr(this_ptr);
22803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22805 this_ptr_conv.is_owned = false;
22806 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
22807 uint64_t ret_ref = 0;
22808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22813 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) {
22814 LDKUserConfig this_ptr_conv;
22815 this_ptr_conv.inner = untag_ptr(this_ptr);
22816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22818 this_ptr_conv.is_owned = false;
22819 LDKChannelHandshakeLimits val_conv;
22820 val_conv.inner = untag_ptr(val);
22821 val_conv.is_owned = ptr_is_owned(val);
22822 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
22823 val_conv = ChannelHandshakeLimits_clone(&val_conv);
22824 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
22827 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) {
22828 LDKUserConfig this_ptr_conv;
22829 this_ptr_conv.inner = untag_ptr(this_ptr);
22830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22832 this_ptr_conv.is_owned = false;
22833 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
22834 uint64_t ret_ref = 0;
22835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22840 void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) {
22841 LDKUserConfig this_ptr_conv;
22842 this_ptr_conv.inner = untag_ptr(this_ptr);
22843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22845 this_ptr_conv.is_owned = false;
22846 LDKChannelConfig val_conv;
22847 val_conv.inner = untag_ptr(val);
22848 val_conv.is_owned = ptr_is_owned(val);
22849 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
22850 val_conv = ChannelConfig_clone(&val_conv);
22851 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
22854 jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) {
22855 LDKUserConfig this_ptr_conv;
22856 this_ptr_conv.inner = untag_ptr(this_ptr);
22857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22859 this_ptr_conv.is_owned = false;
22860 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
22864 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) {
22865 LDKUserConfig this_ptr_conv;
22866 this_ptr_conv.inner = untag_ptr(this_ptr);
22867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22869 this_ptr_conv.is_owned = false;
22870 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
22873 jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) {
22874 LDKUserConfig this_ptr_conv;
22875 this_ptr_conv.inner = untag_ptr(this_ptr);
22876 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22878 this_ptr_conv.is_owned = false;
22879 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
22883 void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
22884 LDKUserConfig this_ptr_conv;
22885 this_ptr_conv.inner = untag_ptr(this_ptr);
22886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22888 this_ptr_conv.is_owned = false;
22889 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
22892 jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) {
22893 LDKUserConfig this_ptr_conv;
22894 this_ptr_conv.inner = untag_ptr(this_ptr);
22895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22897 this_ptr_conv.is_owned = false;
22898 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
22902 void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
22903 LDKUserConfig this_ptr_conv;
22904 this_ptr_conv.inner = untag_ptr(this_ptr);
22905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22907 this_ptr_conv.is_owned = false;
22908 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
22911 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) {
22912 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
22913 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
22914 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
22915 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
22916 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
22917 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
22918 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
22919 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
22920 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
22921 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
22922 LDKChannelConfig channel_config_arg_conv;
22923 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
22924 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
22925 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
22926 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
22927 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);
22928 uint64_t ret_ref = 0;
22929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22934 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
22935 LDKUserConfig ret_var = UserConfig_clone(arg);
22936 uint64_t ret_ref = 0;
22937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22941 int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) {
22942 LDKUserConfig arg_conv;
22943 arg_conv.inner = untag_ptr(arg);
22944 arg_conv.is_owned = ptr_is_owned(arg);
22945 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22946 arg_conv.is_owned = false;
22947 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
22951 uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) {
22952 LDKUserConfig orig_conv;
22953 orig_conv.inner = untag_ptr(orig);
22954 orig_conv.is_owned = ptr_is_owned(orig);
22955 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22956 orig_conv.is_owned = false;
22957 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
22958 uint64_t ret_ref = 0;
22959 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22960 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22964 uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() {
22965 LDKUserConfig ret_var = UserConfig_default();
22966 uint64_t ret_ref = 0;
22967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22972 void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) {
22973 LDKBestBlock this_obj_conv;
22974 this_obj_conv.inner = untag_ptr(this_obj);
22975 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22977 BestBlock_free(this_obj_conv);
22980 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
22981 LDKBestBlock ret_var = BestBlock_clone(arg);
22982 uint64_t ret_ref = 0;
22983 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22984 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22987 int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) {
22988 LDKBestBlock arg_conv;
22989 arg_conv.inner = untag_ptr(arg);
22990 arg_conv.is_owned = ptr_is_owned(arg);
22991 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22992 arg_conv.is_owned = false;
22993 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
22997 uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) {
22998 LDKBestBlock orig_conv;
22999 orig_conv.inner = untag_ptr(orig);
23000 orig_conv.is_owned = ptr_is_owned(orig);
23001 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23002 orig_conv.is_owned = false;
23003 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
23004 uint64_t ret_ref = 0;
23005 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23006 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23010 uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
23011 LDKNetwork network_conv = LDKNetwork_from_js(network);
23012 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
23013 uint64_t ret_ref = 0;
23014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23019 uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
23020 LDKThirtyTwoBytes block_hash_ref;
23021 CHECK(block_hash->arr_len == 32);
23022 memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash);
23023 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
23024 uint64_t ret_ref = 0;
23025 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23026 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23030 int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) {
23031 LDKBestBlock this_arg_conv;
23032 this_arg_conv.inner = untag_ptr(this_arg);
23033 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23035 this_arg_conv.is_owned = false;
23036 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23037 memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32);
23041 int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) {
23042 LDKBestBlock this_arg_conv;
23043 this_arg_conv.inner = untag_ptr(this_arg);
23044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23046 this_arg_conv.is_owned = false;
23047 int32_t ret_conv = BestBlock_height(&this_arg_conv);
23051 uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
23052 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
23053 uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
23057 uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
23058 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
23062 uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
23063 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
23067 void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint64_t this_ptr) {
23068 if (!ptr_is_owned(this_ptr)) return;
23069 void* this_ptr_ptr = untag_ptr(this_ptr);
23070 CHECK_ACCESS(this_ptr_ptr);
23071 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
23072 FREE(untag_ptr(this_ptr));
23073 Access_free(this_ptr_conv);
23076 void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) {
23077 if (!ptr_is_owned(this_ptr)) return;
23078 void* this_ptr_ptr = untag_ptr(this_ptr);
23079 CHECK_ACCESS(this_ptr_ptr);
23080 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
23081 FREE(untag_ptr(this_ptr));
23082 Listen_free(this_ptr_conv);
23085 void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t this_ptr) {
23086 if (!ptr_is_owned(this_ptr)) return;
23087 void* this_ptr_ptr = untag_ptr(this_ptr);
23088 CHECK_ACCESS(this_ptr_ptr);
23089 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
23090 FREE(untag_ptr(this_ptr));
23091 Confirm_free(this_ptr_conv);
23094 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) {
23095 LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
23096 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv));
23100 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
23101 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
23105 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
23106 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
23110 void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint64_t this_ptr) {
23111 if (!ptr_is_owned(this_ptr)) return;
23112 void* this_ptr_ptr = untag_ptr(this_ptr);
23113 CHECK_ACCESS(this_ptr_ptr);
23114 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
23115 FREE(untag_ptr(this_ptr));
23116 Watch_free(this_ptr_conv);
23119 void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint64_t this_ptr) {
23120 if (!ptr_is_owned(this_ptr)) return;
23121 void* this_ptr_ptr = untag_ptr(this_ptr);
23122 CHECK_ACCESS(this_ptr_ptr);
23123 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
23124 FREE(untag_ptr(this_ptr));
23125 Filter_free(this_ptr_conv);
23128 void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) {
23129 LDKWatchedOutput this_obj_conv;
23130 this_obj_conv.inner = untag_ptr(this_obj);
23131 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23133 WatchedOutput_free(this_obj_conv);
23136 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) {
23137 LDKWatchedOutput this_ptr_conv;
23138 this_ptr_conv.inner = untag_ptr(this_ptr);
23139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23141 this_ptr_conv.is_owned = false;
23142 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23143 memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32);
23147 void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, int8_tArray val) {
23148 LDKWatchedOutput this_ptr_conv;
23149 this_ptr_conv.inner = untag_ptr(this_ptr);
23150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23152 this_ptr_conv.is_owned = false;
23153 LDKThirtyTwoBytes val_ref;
23154 CHECK(val->arr_len == 32);
23155 memcpy(val_ref.data, val->elems, 32); FREE(val);
23156 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
23159 uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) {
23160 LDKWatchedOutput this_ptr_conv;
23161 this_ptr_conv.inner = untag_ptr(this_ptr);
23162 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23164 this_ptr_conv.is_owned = false;
23165 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
23166 uint64_t ret_ref = 0;
23167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23172 void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) {
23173 LDKWatchedOutput this_ptr_conv;
23174 this_ptr_conv.inner = untag_ptr(this_ptr);
23175 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23177 this_ptr_conv.is_owned = false;
23178 LDKOutPoint val_conv;
23179 val_conv.inner = untag_ptr(val);
23180 val_conv.is_owned = ptr_is_owned(val);
23181 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23182 val_conv = OutPoint_clone(&val_conv);
23183 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
23186 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) {
23187 LDKWatchedOutput this_ptr_conv;
23188 this_ptr_conv.inner = untag_ptr(this_ptr);
23189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23191 this_ptr_conv.is_owned = false;
23192 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
23193 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23194 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23198 void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) {
23199 LDKWatchedOutput this_ptr_conv;
23200 this_ptr_conv.inner = untag_ptr(this_ptr);
23201 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23203 this_ptr_conv.is_owned = false;
23204 LDKCVec_u8Z val_ref;
23205 val_ref.datalen = val->arr_len;
23206 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
23207 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
23208 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
23211 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) {
23212 LDKThirtyTwoBytes block_hash_arg_ref;
23213 CHECK(block_hash_arg->arr_len == 32);
23214 memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg);
23215 LDKOutPoint outpoint_arg_conv;
23216 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23217 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23218 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23219 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23220 LDKCVec_u8Z script_pubkey_arg_ref;
23221 script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len;
23222 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
23223 memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg);
23224 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
23225 uint64_t ret_ref = 0;
23226 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23227 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23231 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
23232 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
23233 uint64_t ret_ref = 0;
23234 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23235 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23238 int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) {
23239 LDKWatchedOutput arg_conv;
23240 arg_conv.inner = untag_ptr(arg);
23241 arg_conv.is_owned = ptr_is_owned(arg);
23242 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23243 arg_conv.is_owned = false;
23244 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
23248 uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) {
23249 LDKWatchedOutput orig_conv;
23250 orig_conv.inner = untag_ptr(orig);
23251 orig_conv.is_owned = ptr_is_owned(orig);
23252 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23253 orig_conv.is_owned = false;
23254 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
23255 uint64_t ret_ref = 0;
23256 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23257 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23261 int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
23262 LDKWatchedOutput o_conv;
23263 o_conv.inner = untag_ptr(o);
23264 o_conv.is_owned = ptr_is_owned(o);
23265 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23266 o_conv.is_owned = false;
23267 int64_t ret_conv = WatchedOutput_hash(&o_conv);
23271 void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint64_t this_ptr) {
23272 if (!ptr_is_owned(this_ptr)) return;
23273 void* this_ptr_ptr = untag_ptr(this_ptr);
23274 CHECK_ACCESS(this_ptr_ptr);
23275 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
23276 FREE(untag_ptr(this_ptr));
23277 BroadcasterInterface_free(this_ptr_conv);
23280 uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) {
23281 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
23282 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv));
23286 uint32_t __attribute__((export_name("TS_ConfirmationTarget_background"))) TS_ConfirmationTarget_background() {
23287 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
23291 uint32_t __attribute__((export_name("TS_ConfirmationTarget_normal"))) TS_ConfirmationTarget_normal() {
23292 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
23296 uint32_t __attribute__((export_name("TS_ConfirmationTarget_high_priority"))) TS_ConfirmationTarget_high_priority() {
23297 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
23301 jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
23302 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
23303 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
23304 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
23308 void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) {
23309 if (!ptr_is_owned(this_ptr)) return;
23310 void* this_ptr_ptr = untag_ptr(this_ptr);
23311 CHECK_ACCESS(this_ptr_ptr);
23312 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
23313 FREE(untag_ptr(this_ptr));
23314 FeeEstimator_free(this_ptr_conv);
23317 void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) {
23318 LDKMonitorUpdateId this_obj_conv;
23319 this_obj_conv.inner = untag_ptr(this_obj);
23320 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23322 MonitorUpdateId_free(this_obj_conv);
23325 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
23326 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
23327 uint64_t ret_ref = 0;
23328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23332 int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) {
23333 LDKMonitorUpdateId arg_conv;
23334 arg_conv.inner = untag_ptr(arg);
23335 arg_conv.is_owned = ptr_is_owned(arg);
23336 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23337 arg_conv.is_owned = false;
23338 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
23342 uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) {
23343 LDKMonitorUpdateId orig_conv;
23344 orig_conv.inner = untag_ptr(orig);
23345 orig_conv.is_owned = ptr_is_owned(orig);
23346 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23347 orig_conv.is_owned = false;
23348 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
23349 uint64_t ret_ref = 0;
23350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23355 int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) {
23356 LDKMonitorUpdateId o_conv;
23357 o_conv.inner = untag_ptr(o);
23358 o_conv.is_owned = ptr_is_owned(o);
23359 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23360 o_conv.is_owned = false;
23361 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
23365 jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) {
23366 LDKMonitorUpdateId a_conv;
23367 a_conv.inner = untag_ptr(a);
23368 a_conv.is_owned = ptr_is_owned(a);
23369 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23370 a_conv.is_owned = false;
23371 LDKMonitorUpdateId b_conv;
23372 b_conv.inner = untag_ptr(b);
23373 b_conv.is_owned = ptr_is_owned(b);
23374 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23375 b_conv.is_owned = false;
23376 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
23380 void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint64_t this_ptr) {
23381 if (!ptr_is_owned(this_ptr)) return;
23382 void* this_ptr_ptr = untag_ptr(this_ptr);
23383 CHECK_ACCESS(this_ptr_ptr);
23384 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
23385 FREE(untag_ptr(this_ptr));
23386 Persist_free(this_ptr_conv);
23389 void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) {
23390 LDKLockedChannelMonitor this_obj_conv;
23391 this_obj_conv.inner = untag_ptr(this_obj);
23392 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23394 LockedChannelMonitor_free(this_obj_conv);
23397 void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) {
23398 LDKChainMonitor this_obj_conv;
23399 this_obj_conv.inner = untag_ptr(this_obj);
23400 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23402 ChainMonitor_free(this_obj_conv);
23405 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) {
23406 void* chain_source_ptr = untag_ptr(chain_source);
23407 CHECK_ACCESS(chain_source_ptr);
23408 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
23409 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
23410 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
23411 // Manually implement clone for Java trait instances
23412 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
23413 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23414 LDKFilter_JCalls_cloned(&chain_source_conv.some);
23417 void* broadcaster_ptr = untag_ptr(broadcaster);
23418 CHECK_ACCESS(broadcaster_ptr);
23419 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23420 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23421 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23422 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23424 void* logger_ptr = untag_ptr(logger);
23425 CHECK_ACCESS(logger_ptr);
23426 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23427 if (logger_conv.free == LDKLogger_JCalls_free) {
23428 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23429 LDKLogger_JCalls_cloned(&logger_conv);
23431 void* feeest_ptr = untag_ptr(feeest);
23432 CHECK_ACCESS(feeest_ptr);
23433 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
23434 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
23435 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23436 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
23438 void* persister_ptr = untag_ptr(persister);
23439 CHECK_ACCESS(persister_ptr);
23440 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
23441 if (persister_conv.free == LDKPersist_JCalls_free) {
23442 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23443 LDKPersist_JCalls_cloned(&persister_conv);
23445 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
23446 uint64_t ret_ref = 0;
23447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23448 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23452 uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) {
23453 LDKChainMonitor this_arg_conv;
23454 this_arg_conv.inner = untag_ptr(this_arg);
23455 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23457 this_arg_conv.is_owned = false;
23458 LDKCVec_ChannelDetailsZ ignored_channels_constr;
23459 ignored_channels_constr.datalen = ignored_channels->arr_len;
23460 if (ignored_channels_constr.datalen > 0)
23461 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
23463 ignored_channels_constr.data = NULL;
23464 uint64_t* ignored_channels_vals = ignored_channels->elems;
23465 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
23466 uint64_t ignored_channels_conv_16 = ignored_channels_vals[q];
23467 LDKChannelDetails ignored_channels_conv_16_conv;
23468 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
23469 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
23470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
23471 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
23472 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
23474 FREE(ignored_channels);
23475 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
23476 uint64_tArray ret_arr = NULL;
23477 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23478 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23479 for (size_t j = 0; j < ret_var.datalen; j++) {
23480 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23481 *ret_conv_9_copy = ret_var.data[j];
23482 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
23483 ret_arr_ptr[j] = ret_conv_9_ref;
23486 FREE(ret_var.data);
23490 uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) {
23491 LDKChainMonitor this_arg_conv;
23492 this_arg_conv.inner = untag_ptr(this_arg);
23493 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23495 this_arg_conv.is_owned = false;
23496 LDKOutPoint funding_txo_conv;
23497 funding_txo_conv.inner = untag_ptr(funding_txo);
23498 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23499 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23500 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23501 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
23502 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
23503 return tag_ptr(ret_conv, true);
23506 uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) {
23507 LDKChainMonitor this_arg_conv;
23508 this_arg_conv.inner = untag_ptr(this_arg);
23509 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23511 this_arg_conv.is_owned = false;
23512 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
23513 uint64_tArray ret_arr = NULL;
23514 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23515 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23516 for (size_t k = 0; k < ret_var.datalen; k++) {
23517 LDKOutPoint ret_conv_10_var = ret_var.data[k];
23518 uint64_t ret_conv_10_ref = 0;
23519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
23520 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
23521 ret_arr_ptr[k] = ret_conv_10_ref;
23524 FREE(ret_var.data);
23528 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) {
23529 LDKChainMonitor this_arg_conv;
23530 this_arg_conv.inner = untag_ptr(this_arg);
23531 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23533 this_arg_conv.is_owned = false;
23534 LDKOutPoint funding_txo_conv;
23535 funding_txo_conv.inner = untag_ptr(funding_txo);
23536 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23537 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23538 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23539 LDKMonitorUpdateId completed_update_id_conv;
23540 completed_update_id_conv.inner = untag_ptr(completed_update_id);
23541 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
23542 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
23543 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
23544 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
23545 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
23546 return tag_ptr(ret_conv, true);
23549 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) {
23550 LDKChainMonitor this_arg_conv;
23551 this_arg_conv.inner = untag_ptr(this_arg);
23552 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23554 this_arg_conv.is_owned = false;
23555 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
23556 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
23557 return tag_ptr(ret_ret, true);
23560 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint64_t this_arg) {
23561 LDKChainMonitor this_arg_conv;
23562 this_arg_conv.inner = untag_ptr(this_arg);
23563 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23565 this_arg_conv.is_owned = false;
23566 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
23567 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
23568 return tag_ptr(ret_ret, true);
23571 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint64_t this_arg) {
23572 LDKChainMonitor this_arg_conv;
23573 this_arg_conv.inner = untag_ptr(this_arg);
23574 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23576 this_arg_conv.is_owned = false;
23577 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
23578 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
23579 return tag_ptr(ret_ret, true);
23582 uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) {
23583 LDKChainMonitor this_arg_conv;
23584 this_arg_conv.inner = untag_ptr(this_arg);
23585 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23587 this_arg_conv.is_owned = false;
23588 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
23589 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
23590 return tag_ptr(ret_ret, true);
23593 void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) {
23594 LDKChannelMonitorUpdate this_obj_conv;
23595 this_obj_conv.inner = untag_ptr(this_obj);
23596 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23598 ChannelMonitorUpdate_free(this_obj_conv);
23601 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) {
23602 LDKChannelMonitorUpdate this_ptr_conv;
23603 this_ptr_conv.inner = untag_ptr(this_ptr);
23604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23606 this_ptr_conv.is_owned = false;
23607 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
23611 void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) {
23612 LDKChannelMonitorUpdate this_ptr_conv;
23613 this_ptr_conv.inner = untag_ptr(this_ptr);
23614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23616 this_ptr_conv.is_owned = false;
23617 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
23620 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
23621 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
23622 uint64_t ret_ref = 0;
23623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23627 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) {
23628 LDKChannelMonitorUpdate arg_conv;
23629 arg_conv.inner = untag_ptr(arg);
23630 arg_conv.is_owned = ptr_is_owned(arg);
23631 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23632 arg_conv.is_owned = false;
23633 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
23637 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) {
23638 LDKChannelMonitorUpdate orig_conv;
23639 orig_conv.inner = untag_ptr(orig);
23640 orig_conv.is_owned = ptr_is_owned(orig);
23641 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23642 orig_conv.is_owned = false;
23643 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
23644 uint64_t ret_ref = 0;
23645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23650 int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) {
23651 LDKChannelMonitorUpdate obj_conv;
23652 obj_conv.inner = untag_ptr(obj);
23653 obj_conv.is_owned = ptr_is_owned(obj);
23654 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23655 obj_conv.is_owned = false;
23656 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
23657 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23658 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23659 CVec_u8Z_free(ret_var);
23663 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
23664 LDKu8slice ser_ref;
23665 ser_ref.datalen = ser->arr_len;
23666 ser_ref.data = ser->elems;
23667 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
23668 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
23670 return tag_ptr(ret_conv, true);
23673 void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint64_t this_ptr) {
23674 if (!ptr_is_owned(this_ptr)) return;
23675 void* this_ptr_ptr = untag_ptr(this_ptr);
23676 CHECK_ACCESS(this_ptr_ptr);
23677 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
23678 FREE(untag_ptr(this_ptr));
23679 MonitorEvent_free(this_ptr_conv);
23682 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
23683 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23684 *ret_copy = MonitorEvent_clone(arg);
23685 uint64_t ret_ref = tag_ptr(ret_copy, true);
23688 int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) {
23689 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
23690 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
23694 uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) {
23695 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
23696 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23697 *ret_copy = MonitorEvent_clone(orig_conv);
23698 uint64_t ret_ref = tag_ptr(ret_copy, true);
23702 uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) {
23703 LDKHTLCUpdate a_conv;
23704 a_conv.inner = untag_ptr(a);
23705 a_conv.is_owned = ptr_is_owned(a);
23706 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23707 a_conv = HTLCUpdate_clone(&a_conv);
23708 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23709 *ret_copy = MonitorEvent_htlcevent(a_conv);
23710 uint64_t ret_ref = tag_ptr(ret_copy, true);
23714 uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed"))) TS_MonitorEvent_commitment_tx_confirmed(uint64_t a) {
23715 LDKOutPoint a_conv;
23716 a_conv.inner = untag_ptr(a);
23717 a_conv.is_owned = ptr_is_owned(a);
23718 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23719 a_conv = OutPoint_clone(&a_conv);
23720 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23721 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
23722 uint64_t ret_ref = tag_ptr(ret_copy, true);
23726 uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) {
23727 LDKOutPoint funding_txo_conv;
23728 funding_txo_conv.inner = untag_ptr(funding_txo);
23729 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
23730 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
23731 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
23732 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23733 *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
23734 uint64_t ret_ref = tag_ptr(ret_copy, true);
23738 uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_MonitorEvent_update_failed(uint64_t a) {
23739 LDKOutPoint a_conv;
23740 a_conv.inner = untag_ptr(a);
23741 a_conv.is_owned = ptr_is_owned(a);
23742 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23743 a_conv = OutPoint_clone(&a_conv);
23744 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
23745 *ret_copy = MonitorEvent_update_failed(a_conv);
23746 uint64_t ret_ref = tag_ptr(ret_copy, true);
23750 int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
23751 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
23752 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
23753 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23754 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23755 CVec_u8Z_free(ret_var);
23759 uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
23760 LDKu8slice ser_ref;
23761 ser_ref.datalen = ser->arr_len;
23762 ser_ref.data = ser->elems;
23763 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
23764 *ret_conv = MonitorEvent_read(ser_ref);
23766 return tag_ptr(ret_conv, true);
23769 void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) {
23770 LDKHTLCUpdate this_obj_conv;
23771 this_obj_conv.inner = untag_ptr(this_obj);
23772 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23774 HTLCUpdate_free(this_obj_conv);
23777 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
23778 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
23779 uint64_t ret_ref = 0;
23780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23784 int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) {
23785 LDKHTLCUpdate arg_conv;
23786 arg_conv.inner = untag_ptr(arg);
23787 arg_conv.is_owned = ptr_is_owned(arg);
23788 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23789 arg_conv.is_owned = false;
23790 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
23794 uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) {
23795 LDKHTLCUpdate orig_conv;
23796 orig_conv.inner = untag_ptr(orig);
23797 orig_conv.is_owned = ptr_is_owned(orig);
23798 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23799 orig_conv.is_owned = false;
23800 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
23801 uint64_t ret_ref = 0;
23802 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23803 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23807 int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
23808 LDKHTLCUpdate obj_conv;
23809 obj_conv.inner = untag_ptr(obj);
23810 obj_conv.is_owned = ptr_is_owned(obj);
23811 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23812 obj_conv.is_owned = false;
23813 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
23814 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23815 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23816 CVec_u8Z_free(ret_var);
23820 uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
23821 LDKu8slice ser_ref;
23822 ser_ref.datalen = ser->arr_len;
23823 ser_ref.data = ser->elems;
23824 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
23825 *ret_conv = HTLCUpdate_read(ser_ref);
23827 return tag_ptr(ret_conv, true);
23830 void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint64_t this_ptr) {
23831 if (!ptr_is_owned(this_ptr)) return;
23832 void* this_ptr_ptr = untag_ptr(this_ptr);
23833 CHECK_ACCESS(this_ptr_ptr);
23834 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
23835 FREE(untag_ptr(this_ptr));
23836 Balance_free(this_ptr_conv);
23839 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
23840 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23841 *ret_copy = Balance_clone(arg);
23842 uint64_t ret_ref = tag_ptr(ret_copy, true);
23845 int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) {
23846 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
23847 int64_t ret_conv = Balance_clone_ptr(arg_conv);
23851 uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) {
23852 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
23853 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23854 *ret_copy = Balance_clone(orig_conv);
23855 uint64_t ret_ref = tag_ptr(ret_copy, true);
23859 uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) {
23860 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23861 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
23862 uint64_t ret_ref = tag_ptr(ret_copy, true);
23866 uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) {
23867 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23868 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
23869 uint64_t ret_ref = tag_ptr(ret_copy, true);
23873 uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) {
23874 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23875 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
23876 uint64_t ret_ref = tag_ptr(ret_copy, true);
23880 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) {
23881 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23882 *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
23883 uint64_t ret_ref = tag_ptr(ret_copy, true);
23887 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) {
23888 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23889 *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
23890 uint64_t ret_ref = tag_ptr(ret_copy, true);
23894 uint64_t __attribute__((export_name("TS_Balance_counterparty_revoked_output_claimable"))) TS_Balance_counterparty_revoked_output_claimable(int64_t claimable_amount_satoshis) {
23895 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23896 *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
23897 uint64_t ret_ref = tag_ptr(ret_copy, true);
23901 jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) {
23902 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
23903 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
23904 jboolean ret_conv = Balance_eq(a_conv, b_conv);
23908 void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) {
23909 LDKChannelMonitor this_obj_conv;
23910 this_obj_conv.inner = untag_ptr(this_obj);
23911 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23913 ChannelMonitor_free(this_obj_conv);
23916 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
23917 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
23918 uint64_t ret_ref = 0;
23919 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23920 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23923 int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) {
23924 LDKChannelMonitor arg_conv;
23925 arg_conv.inner = untag_ptr(arg);
23926 arg_conv.is_owned = ptr_is_owned(arg);
23927 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23928 arg_conv.is_owned = false;
23929 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
23933 uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) {
23934 LDKChannelMonitor orig_conv;
23935 orig_conv.inner = untag_ptr(orig);
23936 orig_conv.is_owned = ptr_is_owned(orig);
23937 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23938 orig_conv.is_owned = false;
23939 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
23940 uint64_t ret_ref = 0;
23941 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23942 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23946 int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) {
23947 LDKChannelMonitor obj_conv;
23948 obj_conv.inner = untag_ptr(obj);
23949 obj_conv.is_owned = ptr_is_owned(obj);
23950 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23951 obj_conv.is_owned = false;
23952 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
23953 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23954 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23955 CVec_u8Z_free(ret_var);
23959 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) {
23960 LDKChannelMonitor this_arg_conv;
23961 this_arg_conv.inner = untag_ptr(this_arg);
23962 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23964 this_arg_conv.is_owned = false;
23965 LDKChannelMonitorUpdate updates_conv;
23966 updates_conv.inner = untag_ptr(updates);
23967 updates_conv.is_owned = ptr_is_owned(updates);
23968 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
23969 updates_conv.is_owned = false;
23970 void* broadcaster_ptr = untag_ptr(broadcaster);
23971 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
23972 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
23973 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23974 CHECK_ACCESS(fee_estimator_ptr);
23975 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23976 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23977 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23978 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23980 void* logger_ptr = untag_ptr(logger);
23981 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
23982 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
23983 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
23984 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
23985 return tag_ptr(ret_conv, true);
23988 int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) {
23989 LDKChannelMonitor this_arg_conv;
23990 this_arg_conv.inner = untag_ptr(this_arg);
23991 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23993 this_arg_conv.is_owned = false;
23994 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
23998 uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) {
23999 LDKChannelMonitor this_arg_conv;
24000 this_arg_conv.inner = untag_ptr(this_arg);
24001 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24003 this_arg_conv.is_owned = false;
24004 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
24005 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
24006 return tag_ptr(ret_conv, true);
24009 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) {
24010 LDKChannelMonitor this_arg_conv;
24011 this_arg_conv.inner = untag_ptr(this_arg);
24012 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24014 this_arg_conv.is_owned = false;
24015 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
24016 uint64_tArray ret_arr = NULL;
24017 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24018 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24019 for (size_t o = 0; o < ret_var.datalen; o++) {
24020 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
24021 *ret_conv_40_conv = ret_var.data[o];
24022 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
24025 FREE(ret_var.data);
24029 void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter) {
24030 LDKChannelMonitor this_arg_conv;
24031 this_arg_conv.inner = untag_ptr(this_arg);
24032 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24034 this_arg_conv.is_owned = false;
24035 void* filter_ptr = untag_ptr(filter);
24036 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
24037 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
24038 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
24041 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) {
24042 LDKChannelMonitor this_arg_conv;
24043 this_arg_conv.inner = untag_ptr(this_arg);
24044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24046 this_arg_conv.is_owned = false;
24047 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
24048 uint64_tArray ret_arr = NULL;
24049 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24050 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24051 for (size_t o = 0; o < ret_var.datalen; o++) {
24052 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
24053 *ret_conv_14_copy = ret_var.data[o];
24054 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
24055 ret_arr_ptr[o] = ret_conv_14_ref;
24058 FREE(ret_var.data);
24062 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_events"))) TS_ChannelMonitor_get_and_clear_pending_events(uint64_t this_arg) {
24063 LDKChannelMonitor this_arg_conv;
24064 this_arg_conv.inner = untag_ptr(this_arg);
24065 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24067 this_arg_conv.is_owned = false;
24068 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
24069 uint64_tArray ret_arr = NULL;
24070 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24071 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24072 for (size_t h = 0; h < ret_var.datalen; h++) {
24073 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
24074 *ret_conv_7_copy = ret_var.data[h];
24075 uint64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
24076 ret_arr_ptr[h] = ret_conv_7_ref;
24079 FREE(ret_var.data);
24083 int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) {
24084 LDKChannelMonitor this_arg_conv;
24085 this_arg_conv.inner = untag_ptr(this_arg);
24086 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24088 this_arg_conv.is_owned = false;
24089 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24090 memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33);
24094 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) {
24095 LDKChannelMonitor this_arg_conv;
24096 this_arg_conv.inner = untag_ptr(this_arg);
24097 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24099 this_arg_conv.is_owned = false;
24100 void* logger_ptr = untag_ptr(logger);
24101 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
24102 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
24103 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
24104 ptrArray ret_arr = NULL;
24105 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
24106 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
24107 for (size_t m = 0; m < ret_var.datalen; m++) {
24108 LDKTransaction ret_conv_12_var = ret_var.data[m];
24109 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
24110 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
24111 Transaction_free(ret_conv_12_var);
24112 ret_arr_ptr[m] = ret_conv_12_arr;
24115 FREE(ret_var.data);
24119 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) {
24120 LDKChannelMonitor this_arg_conv;
24121 this_arg_conv.inner = untag_ptr(this_arg);
24122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24124 this_arg_conv.is_owned = false;
24125 unsigned char header_arr[80];
24126 CHECK(header->arr_len == 80);
24127 memcpy(header_arr, header->elems, 80); FREE(header);
24128 unsigned char (*header_ref)[80] = &header_arr;
24129 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
24130 txdata_constr.datalen = txdata->arr_len;
24131 if (txdata_constr.datalen > 0)
24132 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
24134 txdata_constr.data = NULL;
24135 uint64_t* txdata_vals = txdata->elems;
24136 for (size_t c = 0; c < txdata_constr.datalen; c++) {
24137 uint64_t txdata_conv_28 = txdata_vals[c];
24138 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
24139 CHECK_ACCESS(txdata_conv_28_ptr);
24140 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
24141 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
24142 txdata_constr.data[c] = txdata_conv_28_conv;
24145 void* broadcaster_ptr = untag_ptr(broadcaster);
24146 CHECK_ACCESS(broadcaster_ptr);
24147 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24148 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24149 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24150 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24152 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24153 CHECK_ACCESS(fee_estimator_ptr);
24154 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24155 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24156 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24157 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24159 void* logger_ptr = untag_ptr(logger);
24160 CHECK_ACCESS(logger_ptr);
24161 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24162 if (logger_conv.free == LDKLogger_JCalls_free) {
24163 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24164 LDKLogger_JCalls_cloned(&logger_conv);
24166 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);
24167 uint64_tArray ret_arr = NULL;
24168 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24169 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24170 for (size_t n = 0; n < ret_var.datalen; n++) {
24171 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24172 *ret_conv_39_conv = ret_var.data[n];
24173 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24176 FREE(ret_var.data);
24180 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) {
24181 LDKChannelMonitor this_arg_conv;
24182 this_arg_conv.inner = untag_ptr(this_arg);
24183 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24185 this_arg_conv.is_owned = false;
24186 unsigned char header_arr[80];
24187 CHECK(header->arr_len == 80);
24188 memcpy(header_arr, header->elems, 80); FREE(header);
24189 unsigned char (*header_ref)[80] = &header_arr;
24190 void* broadcaster_ptr = untag_ptr(broadcaster);
24191 CHECK_ACCESS(broadcaster_ptr);
24192 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24193 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24194 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24195 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24197 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24198 CHECK_ACCESS(fee_estimator_ptr);
24199 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24200 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24201 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24202 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24204 void* logger_ptr = untag_ptr(logger);
24205 CHECK_ACCESS(logger_ptr);
24206 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24207 if (logger_conv.free == LDKLogger_JCalls_free) {
24208 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24209 LDKLogger_JCalls_cloned(&logger_conv);
24211 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
24214 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) {
24215 LDKChannelMonitor this_arg_conv;
24216 this_arg_conv.inner = untag_ptr(this_arg);
24217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24219 this_arg_conv.is_owned = false;
24220 unsigned char header_arr[80];
24221 CHECK(header->arr_len == 80);
24222 memcpy(header_arr, header->elems, 80); FREE(header);
24223 unsigned char (*header_ref)[80] = &header_arr;
24224 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
24225 txdata_constr.datalen = txdata->arr_len;
24226 if (txdata_constr.datalen > 0)
24227 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
24229 txdata_constr.data = NULL;
24230 uint64_t* txdata_vals = txdata->elems;
24231 for (size_t c = 0; c < txdata_constr.datalen; c++) {
24232 uint64_t txdata_conv_28 = txdata_vals[c];
24233 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
24234 CHECK_ACCESS(txdata_conv_28_ptr);
24235 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
24236 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
24237 txdata_constr.data[c] = txdata_conv_28_conv;
24240 void* broadcaster_ptr = untag_ptr(broadcaster);
24241 CHECK_ACCESS(broadcaster_ptr);
24242 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24243 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24244 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24245 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24247 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24248 CHECK_ACCESS(fee_estimator_ptr);
24249 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24250 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24251 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24252 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24254 void* logger_ptr = untag_ptr(logger);
24255 CHECK_ACCESS(logger_ptr);
24256 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24257 if (logger_conv.free == LDKLogger_JCalls_free) {
24258 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24259 LDKLogger_JCalls_cloned(&logger_conv);
24261 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);
24262 uint64_tArray ret_arr = NULL;
24263 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24264 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24265 for (size_t n = 0; n < ret_var.datalen; n++) {
24266 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24267 *ret_conv_39_conv = ret_var.data[n];
24268 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24271 FREE(ret_var.data);
24275 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) {
24276 LDKChannelMonitor this_arg_conv;
24277 this_arg_conv.inner = untag_ptr(this_arg);
24278 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24280 this_arg_conv.is_owned = false;
24281 unsigned char txid_arr[32];
24282 CHECK(txid->arr_len == 32);
24283 memcpy(txid_arr, txid->elems, 32); FREE(txid);
24284 unsigned char (*txid_ref)[32] = &txid_arr;
24285 void* broadcaster_ptr = untag_ptr(broadcaster);
24286 CHECK_ACCESS(broadcaster_ptr);
24287 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24288 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24289 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24290 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24292 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24293 CHECK_ACCESS(fee_estimator_ptr);
24294 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24295 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24296 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24297 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24299 void* logger_ptr = untag_ptr(logger);
24300 CHECK_ACCESS(logger_ptr);
24301 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24302 if (logger_conv.free == LDKLogger_JCalls_free) {
24303 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24304 LDKLogger_JCalls_cloned(&logger_conv);
24306 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
24309 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) {
24310 LDKChannelMonitor this_arg_conv;
24311 this_arg_conv.inner = untag_ptr(this_arg);
24312 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24314 this_arg_conv.is_owned = false;
24315 unsigned char header_arr[80];
24316 CHECK(header->arr_len == 80);
24317 memcpy(header_arr, header->elems, 80); FREE(header);
24318 unsigned char (*header_ref)[80] = &header_arr;
24319 void* broadcaster_ptr = untag_ptr(broadcaster);
24320 CHECK_ACCESS(broadcaster_ptr);
24321 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
24322 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
24323 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24324 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
24326 void* fee_estimator_ptr = untag_ptr(fee_estimator);
24327 CHECK_ACCESS(fee_estimator_ptr);
24328 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
24329 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
24330 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24331 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
24333 void* logger_ptr = untag_ptr(logger);
24334 CHECK_ACCESS(logger_ptr);
24335 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
24336 if (logger_conv.free == LDKLogger_JCalls_free) {
24337 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
24338 LDKLogger_JCalls_cloned(&logger_conv);
24340 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
24341 uint64_tArray ret_arr = NULL;
24342 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24343 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24344 for (size_t n = 0; n < ret_var.datalen; n++) {
24345 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
24346 *ret_conv_39_conv = ret_var.data[n];
24347 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
24350 FREE(ret_var.data);
24354 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
24355 LDKChannelMonitor this_arg_conv;
24356 this_arg_conv.inner = untag_ptr(this_arg);
24357 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24359 this_arg_conv.is_owned = false;
24360 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
24361 ptrArray ret_arr = NULL;
24362 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
24363 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
24364 for (size_t m = 0; m < ret_var.datalen; m++) {
24365 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
24366 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
24367 ret_arr_ptr[m] = ret_conv_12_arr;
24370 FREE(ret_var.data);
24374 uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) {
24375 LDKChannelMonitor this_arg_conv;
24376 this_arg_conv.inner = untag_ptr(this_arg);
24377 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24379 this_arg_conv.is_owned = false;
24380 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
24381 uint64_t ret_ref = 0;
24382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24387 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) {
24388 LDKChannelMonitor this_arg_conv;
24389 this_arg_conv.inner = untag_ptr(this_arg);
24390 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24392 this_arg_conv.is_owned = false;
24393 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
24394 uint64_tArray ret_arr = NULL;
24395 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
24396 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
24397 for (size_t j = 0; j < ret_var.datalen; j++) {
24398 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
24399 *ret_conv_9_copy = ret_var.data[j];
24400 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
24401 ret_arr_ptr[j] = ret_conv_9_ref;
24404 FREE(ret_var.data);
24408 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
24409 LDKu8slice ser_ref;
24410 ser_ref.datalen = ser->arr_len;
24411 ser_ref.data = ser->elems;
24412 void* arg_ptr = untag_ptr(arg);
24413 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
24414 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
24415 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
24416 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
24418 return tag_ptr(ret_conv, true);
24421 void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) {
24422 LDKOutPoint this_obj_conv;
24423 this_obj_conv.inner = untag_ptr(this_obj);
24424 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24426 OutPoint_free(this_obj_conv);
24429 int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) {
24430 LDKOutPoint this_ptr_conv;
24431 this_ptr_conv.inner = untag_ptr(this_ptr);
24432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24434 this_ptr_conv.is_owned = false;
24435 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24436 memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32);
24440 void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) {
24441 LDKOutPoint this_ptr_conv;
24442 this_ptr_conv.inner = untag_ptr(this_ptr);
24443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24445 this_ptr_conv.is_owned = false;
24446 LDKThirtyTwoBytes val_ref;
24447 CHECK(val->arr_len == 32);
24448 memcpy(val_ref.data, val->elems, 32); FREE(val);
24449 OutPoint_set_txid(&this_ptr_conv, val_ref);
24452 int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) {
24453 LDKOutPoint this_ptr_conv;
24454 this_ptr_conv.inner = untag_ptr(this_ptr);
24455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24457 this_ptr_conv.is_owned = false;
24458 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
24462 void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) {
24463 LDKOutPoint this_ptr_conv;
24464 this_ptr_conv.inner = untag_ptr(this_ptr);
24465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24467 this_ptr_conv.is_owned = false;
24468 OutPoint_set_index(&this_ptr_conv, val);
24471 uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
24472 LDKThirtyTwoBytes txid_arg_ref;
24473 CHECK(txid_arg->arr_len == 32);
24474 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
24475 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
24476 uint64_t ret_ref = 0;
24477 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24478 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24482 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
24483 LDKOutPoint ret_var = OutPoint_clone(arg);
24484 uint64_t ret_ref = 0;
24485 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24486 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24489 int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) {
24490 LDKOutPoint arg_conv;
24491 arg_conv.inner = untag_ptr(arg);
24492 arg_conv.is_owned = ptr_is_owned(arg);
24493 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24494 arg_conv.is_owned = false;
24495 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
24499 uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) {
24500 LDKOutPoint orig_conv;
24501 orig_conv.inner = untag_ptr(orig);
24502 orig_conv.is_owned = ptr_is_owned(orig);
24503 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24504 orig_conv.is_owned = false;
24505 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
24506 uint64_t ret_ref = 0;
24507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24512 jboolean __attribute__((export_name("TS_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) {
24513 LDKOutPoint a_conv;
24514 a_conv.inner = untag_ptr(a);
24515 a_conv.is_owned = ptr_is_owned(a);
24516 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
24517 a_conv.is_owned = false;
24518 LDKOutPoint b_conv;
24519 b_conv.inner = untag_ptr(b);
24520 b_conv.is_owned = ptr_is_owned(b);
24521 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
24522 b_conv.is_owned = false;
24523 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
24527 int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) {
24528 LDKOutPoint o_conv;
24529 o_conv.inner = untag_ptr(o);
24530 o_conv.is_owned = ptr_is_owned(o);
24531 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24532 o_conv.is_owned = false;
24533 int64_t ret_conv = OutPoint_hash(&o_conv);
24537 int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) {
24538 LDKOutPoint this_arg_conv;
24539 this_arg_conv.inner = untag_ptr(this_arg);
24540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24542 this_arg_conv.is_owned = false;
24543 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24544 memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32);
24548 int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) {
24549 LDKOutPoint obj_conv;
24550 obj_conv.inner = untag_ptr(obj);
24551 obj_conv.is_owned = ptr_is_owned(obj);
24552 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24553 obj_conv.is_owned = false;
24554 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
24555 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24556 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24557 CVec_u8Z_free(ret_var);
24561 uint64_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
24562 LDKu8slice ser_ref;
24563 ser_ref.datalen = ser->arr_len;
24564 ser_ref.data = ser->elems;
24565 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
24566 *ret_conv = OutPoint_read(ser_ref);
24568 return tag_ptr(ret_conv, true);
24571 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint64_t this_obj) {
24572 LDKDelayedPaymentOutputDescriptor this_obj_conv;
24573 this_obj_conv.inner = untag_ptr(this_obj);
24574 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24576 DelayedPaymentOutputDescriptor_free(this_obj_conv);
24579 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outpoint"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
24580 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24581 this_ptr_conv.inner = untag_ptr(this_ptr);
24582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24584 this_ptr_conv.is_owned = false;
24585 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
24586 uint64_t ret_ref = 0;
24587 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24588 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24592 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_outpoint"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
24593 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24594 this_ptr_conv.inner = untag_ptr(this_ptr);
24595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24597 this_ptr_conv.is_owned = false;
24598 LDKOutPoint val_conv;
24599 val_conv.inner = untag_ptr(val);
24600 val_conv.is_owned = ptr_is_owned(val);
24601 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24602 val_conv = OutPoint_clone(&val_conv);
24603 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
24606 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint64_t this_ptr) {
24607 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24608 this_ptr_conv.inner = untag_ptr(this_ptr);
24609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24611 this_ptr_conv.is_owned = false;
24612 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24613 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
24617 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
24618 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24619 this_ptr_conv.inner = untag_ptr(this_ptr);
24620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24622 this_ptr_conv.is_owned = false;
24623 LDKPublicKey val_ref;
24624 CHECK(val->arr_len == 33);
24625 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24626 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
24629 int16_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint64_t this_ptr) {
24630 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24631 this_ptr_conv.inner = untag_ptr(this_ptr);
24632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24634 this_ptr_conv.is_owned = false;
24635 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
24639 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint64_t this_ptr, int16_t val) {
24640 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24641 this_ptr_conv.inner = untag_ptr(this_ptr);
24642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24644 this_ptr_conv.is_owned = false;
24645 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
24648 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_output"))) TS_DelayedPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
24649 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24650 this_ptr_conv.inner = untag_ptr(this_ptr);
24651 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24653 this_ptr_conv.is_owned = false;
24654 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
24655 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
24656 return tag_ptr(ret_ref, true);
24659 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output"))) TS_DelayedPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
24660 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24661 this_ptr_conv.inner = untag_ptr(this_ptr);
24662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24664 this_ptr_conv.is_owned = false;
24665 void* val_ptr = untag_ptr(val);
24666 CHECK_ACCESS(val_ptr);
24667 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
24668 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
24669 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
24672 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint64_t this_ptr) {
24673 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24674 this_ptr_conv.inner = untag_ptr(this_ptr);
24675 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24676 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24677 this_ptr_conv.is_owned = false;
24678 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24679 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
24683 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint64_t this_ptr, int8_tArray val) {
24684 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24685 this_ptr_conv.inner = untag_ptr(this_ptr);
24686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24688 this_ptr_conv.is_owned = false;
24689 LDKPublicKey val_ref;
24690 CHECK(val->arr_len == 33);
24691 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24692 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
24695 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
24696 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24697 this_ptr_conv.inner = untag_ptr(this_ptr);
24698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24700 this_ptr_conv.is_owned = false;
24701 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24702 memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
24706 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
24707 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24708 this_ptr_conv.inner = untag_ptr(this_ptr);
24709 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24711 this_ptr_conv.is_owned = false;
24712 LDKThirtyTwoBytes val_ref;
24713 CHECK(val->arr_len == 32);
24714 memcpy(val_ref.data, val->elems, 32); FREE(val);
24715 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
24718 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
24719 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24720 this_ptr_conv.inner = untag_ptr(this_ptr);
24721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24723 this_ptr_conv.is_owned = false;
24724 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
24728 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
24729 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
24730 this_ptr_conv.inner = untag_ptr(this_ptr);
24731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24733 this_ptr_conv.is_owned = false;
24734 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
24737 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) {
24738 LDKOutPoint outpoint_arg_conv;
24739 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
24740 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
24741 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
24742 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
24743 LDKPublicKey per_commitment_point_arg_ref;
24744 CHECK(per_commitment_point_arg->arr_len == 33);
24745 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
24746 void* output_arg_ptr = untag_ptr(output_arg);
24747 CHECK_ACCESS(output_arg_ptr);
24748 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
24749 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
24750 LDKPublicKey revocation_pubkey_arg_ref;
24751 CHECK(revocation_pubkey_arg->arr_len == 33);
24752 memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg);
24753 LDKThirtyTwoBytes channel_keys_id_arg_ref;
24754 CHECK(channel_keys_id_arg->arr_len == 32);
24755 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
24756 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);
24757 uint64_t ret_ref = 0;
24758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24763 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
24764 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
24765 uint64_t ret_ref = 0;
24766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24770 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
24771 LDKDelayedPaymentOutputDescriptor arg_conv;
24772 arg_conv.inner = untag_ptr(arg);
24773 arg_conv.is_owned = ptr_is_owned(arg);
24774 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24775 arg_conv.is_owned = false;
24776 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
24780 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone"))) TS_DelayedPaymentOutputDescriptor_clone(uint64_t orig) {
24781 LDKDelayedPaymentOutputDescriptor orig_conv;
24782 orig_conv.inner = untag_ptr(orig);
24783 orig_conv.is_owned = ptr_is_owned(orig);
24784 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24785 orig_conv.is_owned = false;
24786 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
24787 uint64_t ret_ref = 0;
24788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24793 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
24794 LDKDelayedPaymentOutputDescriptor obj_conv;
24795 obj_conv.inner = untag_ptr(obj);
24796 obj_conv.is_owned = ptr_is_owned(obj);
24797 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24798 obj_conv.is_owned = false;
24799 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
24800 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24801 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24802 CVec_u8Z_free(ret_var);
24806 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
24807 LDKu8slice ser_ref;
24808 ser_ref.datalen = ser->arr_len;
24809 ser_ref.data = ser->elems;
24810 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
24811 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
24813 return tag_ptr(ret_conv, true);
24816 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint64_t this_obj) {
24817 LDKStaticPaymentOutputDescriptor this_obj_conv;
24818 this_obj_conv.inner = untag_ptr(this_obj);
24819 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24821 StaticPaymentOutputDescriptor_free(this_obj_conv);
24824 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpoint"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
24825 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24826 this_ptr_conv.inner = untag_ptr(this_ptr);
24827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24829 this_ptr_conv.is_owned = false;
24830 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
24831 uint64_t ret_ref = 0;
24832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24837 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_outpoint"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
24838 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24839 this_ptr_conv.inner = untag_ptr(this_ptr);
24840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24842 this_ptr_conv.is_owned = false;
24843 LDKOutPoint val_conv;
24844 val_conv.inner = untag_ptr(val);
24845 val_conv.is_owned = ptr_is_owned(val);
24846 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24847 val_conv = OutPoint_clone(&val_conv);
24848 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
24851 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_output"))) TS_StaticPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
24852 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24853 this_ptr_conv.inner = untag_ptr(this_ptr);
24854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24856 this_ptr_conv.is_owned = false;
24857 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
24858 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
24859 return tag_ptr(ret_ref, true);
24862 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output"))) TS_StaticPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
24863 LDKStaticPaymentOutputDescriptor 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 void* val_ptr = untag_ptr(val);
24869 CHECK_ACCESS(val_ptr);
24870 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
24871 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
24872 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
24875 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
24876 LDKStaticPaymentOutputDescriptor 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24882 memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
24886 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
24887 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24888 this_ptr_conv.inner = untag_ptr(this_ptr);
24889 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24891 this_ptr_conv.is_owned = false;
24892 LDKThirtyTwoBytes val_ref;
24893 CHECK(val->arr_len == 32);
24894 memcpy(val_ref.data, val->elems, 32); FREE(val);
24895 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
24898 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
24899 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24900 this_ptr_conv.inner = untag_ptr(this_ptr);
24901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24903 this_ptr_conv.is_owned = false;
24904 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
24908 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
24909 LDKStaticPaymentOutputDescriptor this_ptr_conv;
24910 this_ptr_conv.inner = untag_ptr(this_ptr);
24911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24913 this_ptr_conv.is_owned = false;
24914 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
24917 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) {
24918 LDKOutPoint outpoint_arg_conv;
24919 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
24920 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
24921 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
24922 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
24923 void* output_arg_ptr = untag_ptr(output_arg);
24924 CHECK_ACCESS(output_arg_ptr);
24925 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
24926 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
24927 LDKThirtyTwoBytes channel_keys_id_arg_ref;
24928 CHECK(channel_keys_id_arg->arr_len == 32);
24929 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
24930 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
24931 uint64_t ret_ref = 0;
24932 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24933 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24937 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
24938 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
24939 uint64_t ret_ref = 0;
24940 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24941 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24944 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
24945 LDKStaticPaymentOutputDescriptor arg_conv;
24946 arg_conv.inner = untag_ptr(arg);
24947 arg_conv.is_owned = ptr_is_owned(arg);
24948 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24949 arg_conv.is_owned = false;
24950 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
24954 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) TS_StaticPaymentOutputDescriptor_clone(uint64_t orig) {
24955 LDKStaticPaymentOutputDescriptor orig_conv;
24956 orig_conv.inner = untag_ptr(orig);
24957 orig_conv.is_owned = ptr_is_owned(orig);
24958 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24959 orig_conv.is_owned = false;
24960 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
24961 uint64_t ret_ref = 0;
24962 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24963 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24967 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
24968 LDKStaticPaymentOutputDescriptor obj_conv;
24969 obj_conv.inner = untag_ptr(obj);
24970 obj_conv.is_owned = ptr_is_owned(obj);
24971 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24972 obj_conv.is_owned = false;
24973 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
24974 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24975 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24976 CVec_u8Z_free(ret_var);
24980 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
24981 LDKu8slice ser_ref;
24982 ser_ref.datalen = ser->arr_len;
24983 ser_ref.data = ser->elems;
24984 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
24985 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
24987 return tag_ptr(ret_conv, true);
24990 void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint64_t this_ptr) {
24991 if (!ptr_is_owned(this_ptr)) return;
24992 void* this_ptr_ptr = untag_ptr(this_ptr);
24993 CHECK_ACCESS(this_ptr_ptr);
24994 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
24995 FREE(untag_ptr(this_ptr));
24996 SpendableOutputDescriptor_free(this_ptr_conv);
24999 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
25000 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25001 *ret_copy = SpendableOutputDescriptor_clone(arg);
25002 uint64_t ret_ref = tag_ptr(ret_copy, true);
25005 int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint64_t arg) {
25006 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
25007 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
25011 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_SpendableOutputDescriptor_clone(uint64_t orig) {
25012 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
25013 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25014 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
25015 uint64_t ret_ref = tag_ptr(ret_copy, true);
25019 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output"))) TS_SpendableOutputDescriptor_static_output(uint64_t outpoint, uint64_t output) {
25020 LDKOutPoint outpoint_conv;
25021 outpoint_conv.inner = untag_ptr(outpoint);
25022 outpoint_conv.is_owned = ptr_is_owned(outpoint);
25023 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
25024 outpoint_conv = OutPoint_clone(&outpoint_conv);
25025 void* output_ptr = untag_ptr(output);
25026 CHECK_ACCESS(output_ptr);
25027 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
25028 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
25029 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25030 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
25031 uint64_t ret_ref = tag_ptr(ret_copy, true);
25035 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payment_output"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint64_t a) {
25036 LDKDelayedPaymentOutputDescriptor a_conv;
25037 a_conv.inner = untag_ptr(a);
25038 a_conv.is_owned = ptr_is_owned(a);
25039 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25040 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
25041 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25042 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
25043 uint64_t ret_ref = tag_ptr(ret_copy, true);
25047 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_payment_output"))) TS_SpendableOutputDescriptor_static_payment_output(uint64_t a) {
25048 LDKStaticPaymentOutputDescriptor a_conv;
25049 a_conv.inner = untag_ptr(a);
25050 a_conv.is_owned = ptr_is_owned(a);
25051 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25052 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
25053 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
25054 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
25055 uint64_t ret_ref = tag_ptr(ret_copy, true);
25059 int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
25060 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
25061 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
25062 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25063 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25064 CVec_u8Z_free(ret_var);
25068 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
25069 LDKu8slice ser_ref;
25070 ser_ref.datalen = ser->arr_len;
25071 ser_ref.data = ser->elems;
25072 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
25073 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
25075 return tag_ptr(ret_conv, true);
25078 void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
25079 if (!ptr_is_owned(this_ptr)) return;
25080 void* this_ptr_ptr = untag_ptr(this_ptr);
25081 CHECK_ACCESS(this_ptr_ptr);
25082 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
25083 FREE(untag_ptr(this_ptr));
25084 BaseSign_free(this_ptr_conv);
25087 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
25088 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25089 *ret_ret = Sign_clone(arg);
25090 return tag_ptr(ret_ret, true);
25092 int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
25093 void* arg_ptr = untag_ptr(arg);
25094 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
25095 LDKSign* arg_conv = (LDKSign*)arg_ptr;
25096 int64_t ret_conv = Sign_clone_ptr(arg_conv);
25100 uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
25101 void* orig_ptr = untag_ptr(orig);
25102 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
25103 LDKSign* orig_conv = (LDKSign*)orig_ptr;
25104 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25105 *ret_ret = Sign_clone(orig_conv);
25106 return tag_ptr(ret_ret, true);
25109 void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
25110 if (!ptr_is_owned(this_ptr)) return;
25111 void* this_ptr_ptr = untag_ptr(this_ptr);
25112 CHECK_ACCESS(this_ptr_ptr);
25113 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
25114 FREE(untag_ptr(this_ptr));
25115 Sign_free(this_ptr_conv);
25118 uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
25119 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
25120 uint32_t ret_conv = LDKRecipient_to_js(Recipient_clone(orig_conv));
25124 uint32_t __attribute__((export_name("TS_Recipient_node"))) TS_Recipient_node() {
25125 uint32_t ret_conv = LDKRecipient_to_js(Recipient_node());
25129 uint32_t __attribute__((export_name("TS_Recipient_phantom_node"))) TS_Recipient_phantom_node() {
25130 uint32_t ret_conv = LDKRecipient_to_js(Recipient_phantom_node());
25134 void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
25135 if (!ptr_is_owned(this_ptr)) return;
25136 void* this_ptr_ptr = untag_ptr(this_ptr);
25137 CHECK_ACCESS(this_ptr_ptr);
25138 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
25139 FREE(untag_ptr(this_ptr));
25140 KeysInterface_free(this_ptr_conv);
25143 void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
25144 LDKInMemorySigner this_obj_conv;
25145 this_obj_conv.inner = untag_ptr(this_obj);
25146 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25148 InMemorySigner_free(this_obj_conv);
25151 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) TS_InMemorySigner_get_funding_key(uint64_t this_ptr) {
25152 LDKInMemorySigner this_ptr_conv;
25153 this_ptr_conv.inner = untag_ptr(this_ptr);
25154 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25156 this_ptr_conv.is_owned = false;
25157 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25158 memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
25162 void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMemorySigner_set_funding_key(uint64_t this_ptr, int8_tArray val) {
25163 LDKInMemorySigner this_ptr_conv;
25164 this_ptr_conv.inner = untag_ptr(this_ptr);
25165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25167 this_ptr_conv.is_owned = false;
25168 LDKSecretKey val_ref;
25169 CHECK(val->arr_len == 32);
25170 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25171 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
25174 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_key"))) TS_InMemorySigner_get_revocation_base_key(uint64_t this_ptr) {
25175 LDKInMemorySigner this_ptr_conv;
25176 this_ptr_conv.inner = untag_ptr(this_ptr);
25177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25179 this_ptr_conv.is_owned = false;
25180 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25181 memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
25185 void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) TS_InMemorySigner_set_revocation_base_key(uint64_t this_ptr, int8_tArray val) {
25186 LDKInMemorySigner this_ptr_conv;
25187 this_ptr_conv.inner = untag_ptr(this_ptr);
25188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25190 this_ptr_conv.is_owned = false;
25191 LDKSecretKey val_ref;
25192 CHECK(val->arr_len == 32);
25193 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25194 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
25197 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) TS_InMemorySigner_get_payment_key(uint64_t this_ptr) {
25198 LDKInMemorySigner this_ptr_conv;
25199 this_ptr_conv.inner = untag_ptr(this_ptr);
25200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25202 this_ptr_conv.is_owned = false;
25203 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25204 memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
25208 void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMemorySigner_set_payment_key(uint64_t this_ptr, int8_tArray val) {
25209 LDKInMemorySigner this_ptr_conv;
25210 this_ptr_conv.inner = untag_ptr(this_ptr);
25211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25213 this_ptr_conv.is_owned = false;
25214 LDKSecretKey val_ref;
25215 CHECK(val->arr_len == 32);
25216 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25217 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
25220 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_base_key"))) TS_InMemorySigner_get_delayed_payment_base_key(uint64_t this_ptr) {
25221 LDKInMemorySigner this_ptr_conv;
25222 this_ptr_conv.inner = untag_ptr(this_ptr);
25223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25225 this_ptr_conv.is_owned = false;
25226 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25227 memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
25231 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) {
25232 LDKInMemorySigner this_ptr_conv;
25233 this_ptr_conv.inner = untag_ptr(this_ptr);
25234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25236 this_ptr_conv.is_owned = false;
25237 LDKSecretKey val_ref;
25238 CHECK(val->arr_len == 32);
25239 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25240 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
25243 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) TS_InMemorySigner_get_htlc_base_key(uint64_t this_ptr) {
25244 LDKInMemorySigner this_ptr_conv;
25245 this_ptr_conv.inner = untag_ptr(this_ptr);
25246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25248 this_ptr_conv.is_owned = false;
25249 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25250 memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
25254 void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InMemorySigner_set_htlc_base_key(uint64_t this_ptr, int8_tArray val) {
25255 LDKInMemorySigner this_ptr_conv;
25256 this_ptr_conv.inner = untag_ptr(this_ptr);
25257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25259 this_ptr_conv.is_owned = false;
25260 LDKSecretKey val_ref;
25261 CHECK(val->arr_len == 32);
25262 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
25263 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
25266 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed"))) TS_InMemorySigner_get_commitment_seed(uint64_t this_ptr) {
25267 LDKInMemorySigner this_ptr_conv;
25268 this_ptr_conv.inner = untag_ptr(this_ptr);
25269 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25270 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25271 this_ptr_conv.is_owned = false;
25272 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
25273 memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
25277 void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_InMemorySigner_set_commitment_seed(uint64_t this_ptr, int8_tArray val) {
25278 LDKInMemorySigner this_ptr_conv;
25279 this_ptr_conv.inner = untag_ptr(this_ptr);
25280 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25282 this_ptr_conv.is_owned = false;
25283 LDKThirtyTwoBytes val_ref;
25284 CHECK(val->arr_len == 32);
25285 memcpy(val_ref.data, val->elems, 32); FREE(val);
25286 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
25289 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
25290 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
25291 uint64_t ret_ref = 0;
25292 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25293 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25296 int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint64_t arg) {
25297 LDKInMemorySigner arg_conv;
25298 arg_conv.inner = untag_ptr(arg);
25299 arg_conv.is_owned = ptr_is_owned(arg);
25300 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25301 arg_conv.is_owned = false;
25302 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
25306 uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySigner_clone(uint64_t orig) {
25307 LDKInMemorySigner orig_conv;
25308 orig_conv.inner = untag_ptr(orig);
25309 orig_conv.is_owned = ptr_is_owned(orig);
25310 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25311 orig_conv.is_owned = false;
25312 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
25313 uint64_t ret_ref = 0;
25314 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25315 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25319 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) {
25320 LDKSecretKey node_secret_ref;
25321 CHECK(node_secret->arr_len == 32);
25322 memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
25323 LDKSecretKey funding_key_ref;
25324 CHECK(funding_key->arr_len == 32);
25325 memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
25326 LDKSecretKey revocation_base_key_ref;
25327 CHECK(revocation_base_key->arr_len == 32);
25328 memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key);
25329 LDKSecretKey payment_key_ref;
25330 CHECK(payment_key->arr_len == 32);
25331 memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key);
25332 LDKSecretKey delayed_payment_base_key_ref;
25333 CHECK(delayed_payment_base_key->arr_len == 32);
25334 memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key);
25335 LDKSecretKey htlc_base_key_ref;
25336 CHECK(htlc_base_key->arr_len == 32);
25337 memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key);
25338 LDKThirtyTwoBytes commitment_seed_ref;
25339 CHECK(commitment_seed->arr_len == 32);
25340 memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed);
25341 LDKThirtyTwoBytes channel_keys_id_ref;
25342 CHECK(channel_keys_id->arr_len == 32);
25343 memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
25344 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);
25345 uint64_t ret_ref = 0;
25346 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25347 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25351 uint64_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) TS_InMemorySigner_counterparty_pubkeys(uint64_t this_arg) {
25352 LDKInMemorySigner this_arg_conv;
25353 this_arg_conv.inner = untag_ptr(this_arg);
25354 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25356 this_arg_conv.is_owned = false;
25357 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
25358 uint64_t ret_ref = 0;
25359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25364 int16_t __attribute__((export_name("TS_InMemorySigner_counterparty_selected_contest_delay"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint64_t this_arg) {
25365 LDKInMemorySigner this_arg_conv;
25366 this_arg_conv.inner = untag_ptr(this_arg);
25367 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25369 this_arg_conv.is_owned = false;
25370 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
25374 int16_t __attribute__((export_name("TS_InMemorySigner_holder_selected_contest_delay"))) TS_InMemorySigner_holder_selected_contest_delay(uint64_t this_arg) {
25375 LDKInMemorySigner this_arg_conv;
25376 this_arg_conv.inner = untag_ptr(this_arg);
25377 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25379 this_arg_conv.is_owned = false;
25380 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
25384 jboolean __attribute__((export_name("TS_InMemorySigner_is_outbound"))) TS_InMemorySigner_is_outbound(uint64_t this_arg) {
25385 LDKInMemorySigner this_arg_conv;
25386 this_arg_conv.inner = untag_ptr(this_arg);
25387 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25389 this_arg_conv.is_owned = false;
25390 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
25394 uint64_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_InMemorySigner_funding_outpoint(uint64_t this_arg) {
25395 LDKInMemorySigner this_arg_conv;
25396 this_arg_conv.inner = untag_ptr(this_arg);
25397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25399 this_arg_conv.is_owned = false;
25400 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
25401 uint64_t ret_ref = 0;
25402 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25403 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25407 uint64_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters"))) TS_InMemorySigner_get_channel_parameters(uint64_t this_arg) {
25408 LDKInMemorySigner this_arg_conv;
25409 this_arg_conv.inner = untag_ptr(this_arg);
25410 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25412 this_arg_conv.is_owned = false;
25413 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
25414 uint64_t ret_ref = 0;
25415 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25416 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25420 jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMemorySigner_opt_anchors(uint64_t this_arg) {
25421 LDKInMemorySigner this_arg_conv;
25422 this_arg_conv.inner = untag_ptr(this_arg);
25423 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25425 this_arg_conv.is_owned = false;
25426 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
25430 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) {
25431 LDKInMemorySigner this_arg_conv;
25432 this_arg_conv.inner = untag_ptr(this_arg);
25433 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25435 this_arg_conv.is_owned = false;
25436 LDKTransaction spend_tx_ref;
25437 spend_tx_ref.datalen = spend_tx->arr_len;
25438 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
25439 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
25440 spend_tx_ref.data_is_owned = true;
25441 LDKStaticPaymentOutputDescriptor descriptor_conv;
25442 descriptor_conv.inner = untag_ptr(descriptor);
25443 descriptor_conv.is_owned = ptr_is_owned(descriptor);
25444 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
25445 descriptor_conv.is_owned = false;
25446 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
25447 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
25448 return tag_ptr(ret_conv, true);
25451 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) {
25452 LDKInMemorySigner this_arg_conv;
25453 this_arg_conv.inner = untag_ptr(this_arg);
25454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25456 this_arg_conv.is_owned = false;
25457 LDKTransaction spend_tx_ref;
25458 spend_tx_ref.datalen = spend_tx->arr_len;
25459 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
25460 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
25461 spend_tx_ref.data_is_owned = true;
25462 LDKDelayedPaymentOutputDescriptor descriptor_conv;
25463 descriptor_conv.inner = untag_ptr(descriptor);
25464 descriptor_conv.is_owned = ptr_is_owned(descriptor);
25465 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
25466 descriptor_conv.is_owned = false;
25467 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
25468 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
25469 return tag_ptr(ret_conv, true);
25472 uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
25473 LDKInMemorySigner this_arg_conv;
25474 this_arg_conv.inner = untag_ptr(this_arg);
25475 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25477 this_arg_conv.is_owned = false;
25478 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
25479 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
25480 return tag_ptr(ret_ret, true);
25483 uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
25484 LDKInMemorySigner this_arg_conv;
25485 this_arg_conv.inner = untag_ptr(this_arg);
25486 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25488 this_arg_conv.is_owned = false;
25489 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
25490 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
25491 return tag_ptr(ret_ret, true);
25494 int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint64_t obj) {
25495 LDKInMemorySigner obj_conv;
25496 obj_conv.inner = untag_ptr(obj);
25497 obj_conv.is_owned = ptr_is_owned(obj);
25498 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
25499 obj_conv.is_owned = false;
25500 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
25501 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
25502 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
25503 CVec_u8Z_free(ret_var);
25507 uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
25508 LDKu8slice ser_ref;
25509 ser_ref.datalen = ser->arr_len;
25510 ser_ref.data = ser->elems;
25511 LDKSecretKey arg_ref;
25512 CHECK(arg->arr_len == 32);
25513 memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
25514 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
25515 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
25517 return tag_ptr(ret_conv, true);
25520 void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint64_t this_obj) {
25521 LDKKeysManager this_obj_conv;
25522 this_obj_conv.inner = untag_ptr(this_obj);
25523 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25525 KeysManager_free(this_obj_conv);
25528 uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
25529 unsigned char seed_arr[32];
25530 CHECK(seed->arr_len == 32);
25531 memcpy(seed_arr, seed->elems, 32); FREE(seed);
25532 unsigned char (*seed_ref)[32] = &seed_arr;
25533 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
25534 uint64_t ret_ref = 0;
25535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25540 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) {
25541 LDKKeysManager this_arg_conv;
25542 this_arg_conv.inner = untag_ptr(this_arg);
25543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25545 this_arg_conv.is_owned = false;
25546 unsigned char params_arr[32];
25547 CHECK(params->arr_len == 32);
25548 memcpy(params_arr, params->elems, 32); FREE(params);
25549 unsigned char (*params_ref)[32] = ¶ms_arr;
25550 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
25551 uint64_t ret_ref = 0;
25552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25557 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) {
25558 LDKKeysManager this_arg_conv;
25559 this_arg_conv.inner = untag_ptr(this_arg);
25560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25562 this_arg_conv.is_owned = false;
25563 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
25564 descriptors_constr.datalen = descriptors->arr_len;
25565 if (descriptors_constr.datalen > 0)
25566 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
25568 descriptors_constr.data = NULL;
25569 uint64_t* descriptors_vals = descriptors->elems;
25570 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
25571 uint64_t descriptors_conv_27 = descriptors_vals[b];
25572 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
25573 CHECK_ACCESS(descriptors_conv_27_ptr);
25574 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
25575 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
25576 descriptors_constr.data[b] = descriptors_conv_27_conv;
25579 LDKCVec_TxOutZ outputs_constr;
25580 outputs_constr.datalen = outputs->arr_len;
25581 if (outputs_constr.datalen > 0)
25582 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
25584 outputs_constr.data = NULL;
25585 uint64_t* outputs_vals = outputs->elems;
25586 for (size_t h = 0; h < outputs_constr.datalen; h++) {
25587 uint64_t outputs_conv_7 = outputs_vals[h];
25588 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
25589 CHECK_ACCESS(outputs_conv_7_ptr);
25590 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
25591 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
25592 outputs_constr.data[h] = outputs_conv_7_conv;
25595 LDKCVec_u8Z change_destination_script_ref;
25596 change_destination_script_ref.datalen = change_destination_script->arr_len;
25597 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
25598 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
25599 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
25600 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
25601 return tag_ptr(ret_conv, true);
25604 uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
25605 LDKKeysManager this_arg_conv;
25606 this_arg_conv.inner = untag_ptr(this_arg);
25607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25609 this_arg_conv.is_owned = false;
25610 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
25611 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
25612 return tag_ptr(ret_ret, true);
25615 void __attribute__((export_name("TS_PhantomKeysManager_free"))) TS_PhantomKeysManager_free(uint64_t this_obj) {
25616 LDKPhantomKeysManager this_obj_conv;
25617 this_obj_conv.inner = untag_ptr(this_obj);
25618 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25620 PhantomKeysManager_free(this_obj_conv);
25623 uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
25624 LDKPhantomKeysManager this_arg_conv;
25625 this_arg_conv.inner = untag_ptr(this_arg);
25626 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25628 this_arg_conv.is_owned = false;
25629 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
25630 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
25631 return tag_ptr(ret_ret, true);
25634 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) {
25635 unsigned char seed_arr[32];
25636 CHECK(seed->arr_len == 32);
25637 memcpy(seed_arr, seed->elems, 32); FREE(seed);
25638 unsigned char (*seed_ref)[32] = &seed_arr;
25639 unsigned char cross_node_seed_arr[32];
25640 CHECK(cross_node_seed->arr_len == 32);
25641 memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
25642 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
25643 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
25644 uint64_t ret_ref = 0;
25645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25650 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) {
25651 LDKPhantomKeysManager this_arg_conv;
25652 this_arg_conv.inner = untag_ptr(this_arg);
25653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25655 this_arg_conv.is_owned = false;
25656 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
25657 descriptors_constr.datalen = descriptors->arr_len;
25658 if (descriptors_constr.datalen > 0)
25659 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
25661 descriptors_constr.data = NULL;
25662 uint64_t* descriptors_vals = descriptors->elems;
25663 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
25664 uint64_t descriptors_conv_27 = descriptors_vals[b];
25665 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
25666 CHECK_ACCESS(descriptors_conv_27_ptr);
25667 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
25668 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
25669 descriptors_constr.data[b] = descriptors_conv_27_conv;
25672 LDKCVec_TxOutZ outputs_constr;
25673 outputs_constr.datalen = outputs->arr_len;
25674 if (outputs_constr.datalen > 0)
25675 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
25677 outputs_constr.data = NULL;
25678 uint64_t* outputs_vals = outputs->elems;
25679 for (size_t h = 0; h < outputs_constr.datalen; h++) {
25680 uint64_t outputs_conv_7 = outputs_vals[h];
25681 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
25682 CHECK_ACCESS(outputs_conv_7_ptr);
25683 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
25684 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
25685 outputs_constr.data[h] = outputs_conv_7_conv;
25688 LDKCVec_u8Z change_destination_script_ref;
25689 change_destination_script_ref.datalen = change_destination_script->arr_len;
25690 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
25691 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
25692 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
25693 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
25694 return tag_ptr(ret_conv, true);
25697 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) {
25698 LDKPhantomKeysManager this_arg_conv;
25699 this_arg_conv.inner = untag_ptr(this_arg);
25700 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25702 this_arg_conv.is_owned = false;
25703 unsigned char params_arr[32];
25704 CHECK(params->arr_len == 32);
25705 memcpy(params_arr, params->elems, 32); FREE(params);
25706 unsigned char (*params_ref)[32] = ¶ms_arr;
25707 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
25708 uint64_t ret_ref = 0;
25709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25710 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25714 void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
25715 LDKChannelManager this_obj_conv;
25716 this_obj_conv.inner = untag_ptr(this_obj);
25717 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25719 ChannelManager_free(this_obj_conv);
25722 void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) {
25723 LDKChainParameters this_obj_conv;
25724 this_obj_conv.inner = untag_ptr(this_obj);
25725 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25727 ChainParameters_free(this_obj_conv);
25730 uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) {
25731 LDKChainParameters this_ptr_conv;
25732 this_ptr_conv.inner = untag_ptr(this_ptr);
25733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25735 this_ptr_conv.is_owned = false;
25736 uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv));
25740 void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) {
25741 LDKChainParameters this_ptr_conv;
25742 this_ptr_conv.inner = untag_ptr(this_ptr);
25743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25745 this_ptr_conv.is_owned = false;
25746 LDKNetwork val_conv = LDKNetwork_from_js(val);
25747 ChainParameters_set_network(&this_ptr_conv, val_conv);
25750 uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) {
25751 LDKChainParameters this_ptr_conv;
25752 this_ptr_conv.inner = untag_ptr(this_ptr);
25753 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25755 this_ptr_conv.is_owned = false;
25756 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
25757 uint64_t ret_ref = 0;
25758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25763 void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) {
25764 LDKChainParameters this_ptr_conv;
25765 this_ptr_conv.inner = untag_ptr(this_ptr);
25766 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25768 this_ptr_conv.is_owned = false;
25769 LDKBestBlock val_conv;
25770 val_conv.inner = untag_ptr(val);
25771 val_conv.is_owned = ptr_is_owned(val);
25772 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25773 val_conv = BestBlock_clone(&val_conv);
25774 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
25777 uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) {
25778 LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg);
25779 LDKBestBlock best_block_arg_conv;
25780 best_block_arg_conv.inner = untag_ptr(best_block_arg);
25781 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
25782 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
25783 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
25784 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
25785 uint64_t ret_ref = 0;
25786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25791 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
25792 LDKChainParameters ret_var = ChainParameters_clone(arg);
25793 uint64_t ret_ref = 0;
25794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25798 int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) {
25799 LDKChainParameters arg_conv;
25800 arg_conv.inner = untag_ptr(arg);
25801 arg_conv.is_owned = ptr_is_owned(arg);
25802 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25803 arg_conv.is_owned = false;
25804 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
25808 uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) {
25809 LDKChainParameters orig_conv;
25810 orig_conv.inner = untag_ptr(orig);
25811 orig_conv.is_owned = ptr_is_owned(orig);
25812 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25813 orig_conv.is_owned = false;
25814 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
25815 uint64_t ret_ref = 0;
25816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25821 void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) {
25822 LDKCounterpartyForwardingInfo this_obj_conv;
25823 this_obj_conv.inner = untag_ptr(this_obj);
25824 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25826 CounterpartyForwardingInfo_free(this_obj_conv);
25829 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) {
25830 LDKCounterpartyForwardingInfo this_ptr_conv;
25831 this_ptr_conv.inner = untag_ptr(this_ptr);
25832 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25834 this_ptr_conv.is_owned = false;
25835 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
25839 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
25840 LDKCounterpartyForwardingInfo this_ptr_conv;
25841 this_ptr_conv.inner = untag_ptr(this_ptr);
25842 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25844 this_ptr_conv.is_owned = false;
25845 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
25848 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) {
25849 LDKCounterpartyForwardingInfo this_ptr_conv;
25850 this_ptr_conv.inner = untag_ptr(this_ptr);
25851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25853 this_ptr_conv.is_owned = false;
25854 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
25858 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
25859 LDKCounterpartyForwardingInfo this_ptr_conv;
25860 this_ptr_conv.inner = untag_ptr(this_ptr);
25861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25863 this_ptr_conv.is_owned = false;
25864 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
25867 int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
25868 LDKCounterpartyForwardingInfo this_ptr_conv;
25869 this_ptr_conv.inner = untag_ptr(this_ptr);
25870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25872 this_ptr_conv.is_owned = false;
25873 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
25877 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
25878 LDKCounterpartyForwardingInfo this_ptr_conv;
25879 this_ptr_conv.inner = untag_ptr(this_ptr);
25880 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25882 this_ptr_conv.is_owned = false;
25883 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
25886 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) {
25887 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
25888 uint64_t ret_ref = 0;
25889 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25890 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25894 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
25895 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
25896 uint64_t ret_ref = 0;
25897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25901 int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) {
25902 LDKCounterpartyForwardingInfo arg_conv;
25903 arg_conv.inner = untag_ptr(arg);
25904 arg_conv.is_owned = ptr_is_owned(arg);
25905 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25906 arg_conv.is_owned = false;
25907 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
25911 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) {
25912 LDKCounterpartyForwardingInfo orig_conv;
25913 orig_conv.inner = untag_ptr(orig);
25914 orig_conv.is_owned = ptr_is_owned(orig);
25915 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25916 orig_conv.is_owned = false;
25917 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
25918 uint64_t ret_ref = 0;
25919 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25920 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25924 void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) {
25925 LDKChannelCounterparty this_obj_conv;
25926 this_obj_conv.inner = untag_ptr(this_obj);
25927 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25929 ChannelCounterparty_free(this_obj_conv);
25932 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) {
25933 LDKChannelCounterparty this_ptr_conv;
25934 this_ptr_conv.inner = untag_ptr(this_ptr);
25935 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25937 this_ptr_conv.is_owned = false;
25938 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
25939 memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
25943 void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) {
25944 LDKChannelCounterparty this_ptr_conv;
25945 this_ptr_conv.inner = untag_ptr(this_ptr);
25946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25948 this_ptr_conv.is_owned = false;
25949 LDKPublicKey val_ref;
25950 CHECK(val->arr_len == 33);
25951 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
25952 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
25955 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) {
25956 LDKChannelCounterparty this_ptr_conv;
25957 this_ptr_conv.inner = untag_ptr(this_ptr);
25958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25960 this_ptr_conv.is_owned = false;
25961 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
25962 uint64_t ret_ref = 0;
25963 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25964 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25968 void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) {
25969 LDKChannelCounterparty this_ptr_conv;
25970 this_ptr_conv.inner = untag_ptr(this_ptr);
25971 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25973 this_ptr_conv.is_owned = false;
25974 LDKInitFeatures val_conv;
25975 val_conv.inner = untag_ptr(val);
25976 val_conv.is_owned = ptr_is_owned(val);
25977 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25978 val_conv = InitFeatures_clone(&val_conv);
25979 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
25982 int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) {
25983 LDKChannelCounterparty this_ptr_conv;
25984 this_ptr_conv.inner = untag_ptr(this_ptr);
25985 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25987 this_ptr_conv.is_owned = false;
25988 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
25992 void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) {
25993 LDKChannelCounterparty this_ptr_conv;
25994 this_ptr_conv.inner = untag_ptr(this_ptr);
25995 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25997 this_ptr_conv.is_owned = false;
25998 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
26001 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) {
26002 LDKChannelCounterparty this_ptr_conv;
26003 this_ptr_conv.inner = untag_ptr(this_ptr);
26004 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26006 this_ptr_conv.is_owned = false;
26007 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
26008 uint64_t ret_ref = 0;
26009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26014 void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) {
26015 LDKChannelCounterparty this_ptr_conv;
26016 this_ptr_conv.inner = untag_ptr(this_ptr);
26017 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26019 this_ptr_conv.is_owned = false;
26020 LDKCounterpartyForwardingInfo val_conv;
26021 val_conv.inner = untag_ptr(val);
26022 val_conv.is_owned = ptr_is_owned(val);
26023 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26024 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
26025 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
26028 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) {
26029 LDKChannelCounterparty this_ptr_conv;
26030 this_ptr_conv.inner = untag_ptr(this_ptr);
26031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26033 this_ptr_conv.is_owned = false;
26034 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26035 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
26036 uint64_t ret_ref = tag_ptr(ret_copy, true);
26040 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) {
26041 LDKChannelCounterparty this_ptr_conv;
26042 this_ptr_conv.inner = untag_ptr(this_ptr);
26043 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26045 this_ptr_conv.is_owned = false;
26046 void* val_ptr = untag_ptr(val);
26047 CHECK_ACCESS(val_ptr);
26048 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26049 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26050 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
26053 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) {
26054 LDKChannelCounterparty this_ptr_conv;
26055 this_ptr_conv.inner = untag_ptr(this_ptr);
26056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26058 this_ptr_conv.is_owned = false;
26059 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26060 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
26061 uint64_t ret_ref = tag_ptr(ret_copy, true);
26065 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) {
26066 LDKChannelCounterparty this_ptr_conv;
26067 this_ptr_conv.inner = untag_ptr(this_ptr);
26068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26070 this_ptr_conv.is_owned = false;
26071 void* val_ptr = untag_ptr(val);
26072 CHECK_ACCESS(val_ptr);
26073 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26074 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26075 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
26078 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) {
26079 LDKPublicKey node_id_arg_ref;
26080 CHECK(node_id_arg->arr_len == 33);
26081 memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg);
26082 LDKInitFeatures features_arg_conv;
26083 features_arg_conv.inner = untag_ptr(features_arg);
26084 features_arg_conv.is_owned = ptr_is_owned(features_arg);
26085 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
26086 features_arg_conv = InitFeatures_clone(&features_arg_conv);
26087 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
26088 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
26089 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
26090 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
26091 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
26092 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
26093 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
26094 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
26095 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
26096 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
26097 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
26098 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
26099 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
26100 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);
26101 uint64_t ret_ref = 0;
26102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26107 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
26108 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
26109 uint64_t ret_ref = 0;
26110 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26111 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26114 int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) {
26115 LDKChannelCounterparty arg_conv;
26116 arg_conv.inner = untag_ptr(arg);
26117 arg_conv.is_owned = ptr_is_owned(arg);
26118 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26119 arg_conv.is_owned = false;
26120 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
26124 uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) {
26125 LDKChannelCounterparty orig_conv;
26126 orig_conv.inner = untag_ptr(orig);
26127 orig_conv.is_owned = ptr_is_owned(orig);
26128 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26129 orig_conv.is_owned = false;
26130 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
26131 uint64_t ret_ref = 0;
26132 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26133 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26137 void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) {
26138 LDKChannelDetails this_obj_conv;
26139 this_obj_conv.inner = untag_ptr(this_obj);
26140 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26142 ChannelDetails_free(this_obj_conv);
26145 int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) {
26146 LDKChannelDetails this_ptr_conv;
26147 this_ptr_conv.inner = untag_ptr(this_ptr);
26148 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26150 this_ptr_conv.is_owned = false;
26151 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
26152 memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32);
26156 void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) {
26157 LDKChannelDetails this_ptr_conv;
26158 this_ptr_conv.inner = untag_ptr(this_ptr);
26159 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26161 this_ptr_conv.is_owned = false;
26162 LDKThirtyTwoBytes val_ref;
26163 CHECK(val->arr_len == 32);
26164 memcpy(val_ref.data, val->elems, 32); FREE(val);
26165 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
26168 uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) {
26169 LDKChannelDetails 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 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
26175 uint64_t ret_ref = 0;
26176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26181 void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) {
26182 LDKChannelDetails this_ptr_conv;
26183 this_ptr_conv.inner = untag_ptr(this_ptr);
26184 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26185 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26186 this_ptr_conv.is_owned = false;
26187 LDKChannelCounterparty val_conv;
26188 val_conv.inner = untag_ptr(val);
26189 val_conv.is_owned = ptr_is_owned(val);
26190 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26191 val_conv = ChannelCounterparty_clone(&val_conv);
26192 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
26195 uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) {
26196 LDKChannelDetails this_ptr_conv;
26197 this_ptr_conv.inner = untag_ptr(this_ptr);
26198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26200 this_ptr_conv.is_owned = false;
26201 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
26202 uint64_t ret_ref = 0;
26203 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26204 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26208 void __attribute__((export_name("TS_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) {
26209 LDKChannelDetails this_ptr_conv;
26210 this_ptr_conv.inner = untag_ptr(this_ptr);
26211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26213 this_ptr_conv.is_owned = false;
26214 LDKOutPoint val_conv;
26215 val_conv.inner = untag_ptr(val);
26216 val_conv.is_owned = ptr_is_owned(val);
26217 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26218 val_conv = OutPoint_clone(&val_conv);
26219 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
26222 uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(uint64_t this_ptr) {
26223 LDKChannelDetails this_ptr_conv;
26224 this_ptr_conv.inner = untag_ptr(this_ptr);
26225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26227 this_ptr_conv.is_owned = false;
26228 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
26229 uint64_t ret_ref = 0;
26230 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26231 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26235 void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(uint64_t this_ptr, uint64_t val) {
26236 LDKChannelDetails this_ptr_conv;
26237 this_ptr_conv.inner = untag_ptr(this_ptr);
26238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26240 this_ptr_conv.is_owned = false;
26241 LDKChannelTypeFeatures val_conv;
26242 val_conv.inner = untag_ptr(val);
26243 val_conv.is_owned = ptr_is_owned(val);
26244 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26245 val_conv = ChannelTypeFeatures_clone(&val_conv);
26246 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
26249 uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) {
26250 LDKChannelDetails this_ptr_conv;
26251 this_ptr_conv.inner = untag_ptr(this_ptr);
26252 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26254 this_ptr_conv.is_owned = false;
26255 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26256 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
26257 uint64_t ret_ref = tag_ptr(ret_copy, true);
26261 void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(uint64_t this_ptr, uint64_t val) {
26262 LDKChannelDetails this_ptr_conv;
26263 this_ptr_conv.inner = untag_ptr(this_ptr);
26264 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26266 this_ptr_conv.is_owned = false;
26267 void* val_ptr = untag_ptr(val);
26268 CHECK_ACCESS(val_ptr);
26269 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26270 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26271 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
26274 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(uint64_t this_ptr) {
26275 LDKChannelDetails this_ptr_conv;
26276 this_ptr_conv.inner = untag_ptr(this_ptr);
26277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26279 this_ptr_conv.is_owned = false;
26280 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26281 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
26282 uint64_t ret_ref = tag_ptr(ret_copy, true);
26286 void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(uint64_t this_ptr, uint64_t val) {
26287 LDKChannelDetails this_ptr_conv;
26288 this_ptr_conv.inner = untag_ptr(this_ptr);
26289 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26291 this_ptr_conv.is_owned = false;
26292 void* val_ptr = untag_ptr(val);
26293 CHECK_ACCESS(val_ptr);
26294 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26295 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26296 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
26299 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(uint64_t this_ptr) {
26300 LDKChannelDetails this_ptr_conv;
26301 this_ptr_conv.inner = untag_ptr(this_ptr);
26302 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26304 this_ptr_conv.is_owned = false;
26305 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26306 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
26307 uint64_t ret_ref = tag_ptr(ret_copy, true);
26311 void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(uint64_t this_ptr, uint64_t val) {
26312 LDKChannelDetails this_ptr_conv;
26313 this_ptr_conv.inner = untag_ptr(this_ptr);
26314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26316 this_ptr_conv.is_owned = false;
26317 void* val_ptr = untag_ptr(val);
26318 CHECK_ACCESS(val_ptr);
26319 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26320 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26321 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
26324 int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) {
26325 LDKChannelDetails this_ptr_conv;
26326 this_ptr_conv.inner = untag_ptr(this_ptr);
26327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26329 this_ptr_conv.is_owned = false;
26330 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
26334 void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
26335 LDKChannelDetails 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 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
26343 uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint64_t this_ptr) {
26344 LDKChannelDetails this_ptr_conv;
26345 this_ptr_conv.inner = untag_ptr(this_ptr);
26346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26348 this_ptr_conv.is_owned = false;
26349 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26350 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
26351 uint64_t ret_ref = tag_ptr(ret_copy, true);
26355 void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint64_t this_ptr, uint64_t val) {
26356 LDKChannelDetails this_ptr_conv;
26357 this_ptr_conv.inner = untag_ptr(this_ptr);
26358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26360 this_ptr_conv.is_owned = false;
26361 void* val_ptr = untag_ptr(val);
26362 CHECK_ACCESS(val_ptr);
26363 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26364 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26365 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
26368 int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
26369 LDKChannelDetails this_ptr_conv;
26370 this_ptr_conv.inner = untag_ptr(this_ptr);
26371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26373 this_ptr_conv.is_owned = false;
26374 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
26378 void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
26379 LDKChannelDetails this_ptr_conv;
26380 this_ptr_conv.inner = untag_ptr(this_ptr);
26381 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26383 this_ptr_conv.is_owned = false;
26384 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
26387 int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
26388 LDKChannelDetails this_ptr_conv;
26389 this_ptr_conv.inner = untag_ptr(this_ptr);
26390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26392 this_ptr_conv.is_owned = false;
26393 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
26397 void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_t val) {
26398 LDKChannelDetails this_ptr_conv;
26399 this_ptr_conv.inner = untag_ptr(this_ptr);
26400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26402 this_ptr_conv.is_owned = false;
26403 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
26406 int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) {
26407 LDKChannelDetails this_ptr_conv;
26408 this_ptr_conv.inner = untag_ptr(this_ptr);
26409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26411 this_ptr_conv.is_owned = false;
26412 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
26416 void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_t val) {
26417 LDKChannelDetails this_ptr_conv;
26418 this_ptr_conv.inner = untag_ptr(this_ptr);
26419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26421 this_ptr_conv.is_owned = false;
26422 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
26425 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) {
26426 LDKChannelDetails this_ptr_conv;
26427 this_ptr_conv.inner = untag_ptr(this_ptr);
26428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26430 this_ptr_conv.is_owned = false;
26431 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
26435 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) {
26436 LDKChannelDetails this_ptr_conv;
26437 this_ptr_conv.inner = untag_ptr(this_ptr);
26438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26440 this_ptr_conv.is_owned = false;
26441 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
26444 int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) {
26445 LDKChannelDetails this_ptr_conv;
26446 this_ptr_conv.inner = untag_ptr(this_ptr);
26447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26449 this_ptr_conv.is_owned = false;
26450 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
26454 void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_t val) {
26455 LDKChannelDetails this_ptr_conv;
26456 this_ptr_conv.inner = untag_ptr(this_ptr);
26457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26459 this_ptr_conv.is_owned = false;
26460 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
26463 uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) {
26464 LDKChannelDetails this_ptr_conv;
26465 this_ptr_conv.inner = untag_ptr(this_ptr);
26466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26468 this_ptr_conv.is_owned = false;
26469 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
26470 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
26471 uint64_t ret_ref = tag_ptr(ret_copy, true);
26475 void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) {
26476 LDKChannelDetails this_ptr_conv;
26477 this_ptr_conv.inner = untag_ptr(this_ptr);
26478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26480 this_ptr_conv.is_owned = false;
26481 void* val_ptr = untag_ptr(val);
26482 CHECK_ACCESS(val_ptr);
26483 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
26484 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
26485 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
26488 uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(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 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
26495 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
26496 uint64_t ret_ref = tag_ptr(ret_copy, true);
26500 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) {
26501 LDKChannelDetails this_ptr_conv;
26502 this_ptr_conv.inner = untag_ptr(this_ptr);
26503 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26505 this_ptr_conv.is_owned = false;
26506 void* val_ptr = untag_ptr(val);
26507 CHECK_ACCESS(val_ptr);
26508 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
26509 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
26510 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
26513 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(uint64_t this_ptr) {
26514 LDKChannelDetails this_ptr_conv;
26515 this_ptr_conv.inner = untag_ptr(this_ptr);
26516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26518 this_ptr_conv.is_owned = false;
26519 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
26523 void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) {
26524 LDKChannelDetails this_ptr_conv;
26525 this_ptr_conv.inner = untag_ptr(this_ptr);
26526 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26528 this_ptr_conv.is_owned = false;
26529 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
26532 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(uint64_t this_ptr) {
26533 LDKChannelDetails this_ptr_conv;
26534 this_ptr_conv.inner = untag_ptr(this_ptr);
26535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26537 this_ptr_conv.is_owned = false;
26538 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
26542 void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) {
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 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
26551 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(uint64_t this_ptr) {
26552 LDKChannelDetails this_ptr_conv;
26553 this_ptr_conv.inner = untag_ptr(this_ptr);
26554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26556 this_ptr_conv.is_owned = false;
26557 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
26561 void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) {
26562 LDKChannelDetails this_ptr_conv;
26563 this_ptr_conv.inner = untag_ptr(this_ptr);
26564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26566 this_ptr_conv.is_owned = false;
26567 ChannelDetails_set_is_usable(&this_ptr_conv, val);
26570 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) {
26571 LDKChannelDetails this_ptr_conv;
26572 this_ptr_conv.inner = untag_ptr(this_ptr);
26573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26575 this_ptr_conv.is_owned = false;
26576 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
26580 void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) {
26581 LDKChannelDetails this_ptr_conv;
26582 this_ptr_conv.inner = untag_ptr(this_ptr);
26583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26585 this_ptr_conv.is_owned = false;
26586 ChannelDetails_set_is_public(&this_ptr_conv, val);
26589 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) {
26590 LDKChannelDetails this_ptr_conv;
26591 this_ptr_conv.inner = untag_ptr(this_ptr);
26592 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26593 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26594 this_ptr_conv.is_owned = false;
26595 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26596 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
26597 uint64_t ret_ref = tag_ptr(ret_copy, true);
26601 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) {
26602 LDKChannelDetails this_ptr_conv;
26603 this_ptr_conv.inner = untag_ptr(this_ptr);
26604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26606 this_ptr_conv.is_owned = false;
26607 void* val_ptr = untag_ptr(val);
26608 CHECK_ACCESS(val_ptr);
26609 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26610 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26611 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
26614 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(uint64_t this_ptr) {
26615 LDKChannelDetails this_ptr_conv;
26616 this_ptr_conv.inner = untag_ptr(this_ptr);
26617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26619 this_ptr_conv.is_owned = false;
26620 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26621 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
26622 uint64_t ret_ref = tag_ptr(ret_copy, true);
26626 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) {
26627 LDKChannelDetails this_ptr_conv;
26628 this_ptr_conv.inner = untag_ptr(this_ptr);
26629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26631 this_ptr_conv.is_owned = false;
26632 void* val_ptr = untag_ptr(val);
26633 CHECK_ACCESS(val_ptr);
26634 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
26635 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
26636 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
26639 uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(uint64_t this_ptr) {
26640 LDKChannelDetails this_ptr_conv;
26641 this_ptr_conv.inner = untag_ptr(this_ptr);
26642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26644 this_ptr_conv.is_owned = false;
26645 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
26646 uint64_t ret_ref = 0;
26647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26652 void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(uint64_t this_ptr, uint64_t val) {
26653 LDKChannelDetails this_ptr_conv;
26654 this_ptr_conv.inner = untag_ptr(this_ptr);
26655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26657 this_ptr_conv.is_owned = false;
26658 LDKChannelConfig val_conv;
26659 val_conv.inner = untag_ptr(val);
26660 val_conv.is_owned = ptr_is_owned(val);
26661 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26662 val_conv = ChannelConfig_clone(&val_conv);
26663 ChannelDetails_set_config(&this_ptr_conv, val_conv);
26666 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) {
26667 LDKThirtyTwoBytes channel_id_arg_ref;
26668 CHECK(channel_id_arg->arr_len == 32);
26669 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
26670 LDKChannelCounterparty counterparty_arg_conv;
26671 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
26672 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
26673 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
26674 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
26675 LDKOutPoint funding_txo_arg_conv;
26676 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
26677 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
26678 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
26679 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
26680 LDKChannelTypeFeatures channel_type_arg_conv;
26681 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
26682 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
26683 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
26684 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
26685 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
26686 CHECK_ACCESS(short_channel_id_arg_ptr);
26687 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
26688 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
26689 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
26690 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
26691 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
26692 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
26693 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
26694 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
26695 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
26696 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
26697 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
26698 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
26699 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
26700 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
26701 CHECK_ACCESS(confirmations_required_arg_ptr);
26702 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
26703 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
26704 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
26705 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
26706 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
26707 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
26708 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
26709 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
26710 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
26711 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
26712 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
26713 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
26714 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
26715 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
26716 LDKChannelConfig config_arg_conv;
26717 config_arg_conv.inner = untag_ptr(config_arg);
26718 config_arg_conv.is_owned = ptr_is_owned(config_arg);
26719 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
26720 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
26721 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);
26722 uint64_t ret_ref = 0;
26723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26728 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
26729 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
26730 uint64_t ret_ref = 0;
26731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26735 int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) {
26736 LDKChannelDetails arg_conv;
26737 arg_conv.inner = untag_ptr(arg);
26738 arg_conv.is_owned = ptr_is_owned(arg);
26739 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26740 arg_conv.is_owned = false;
26741 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
26745 uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) {
26746 LDKChannelDetails orig_conv;
26747 orig_conv.inner = untag_ptr(orig);
26748 orig_conv.is_owned = ptr_is_owned(orig);
26749 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26750 orig_conv.is_owned = false;
26751 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
26752 uint64_t ret_ref = 0;
26753 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26754 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26758 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) {
26759 LDKChannelDetails this_arg_conv;
26760 this_arg_conv.inner = untag_ptr(this_arg);
26761 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26763 this_arg_conv.is_owned = false;
26764 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26765 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
26766 uint64_t ret_ref = tag_ptr(ret_copy, true);
26770 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) {
26771 LDKChannelDetails this_arg_conv;
26772 this_arg_conv.inner = untag_ptr(this_arg);
26773 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26775 this_arg_conv.is_owned = false;
26776 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
26777 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
26778 uint64_t ret_ref = tag_ptr(ret_copy, true);
26782 void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
26783 if (!ptr_is_owned(this_ptr)) return;
26784 void* this_ptr_ptr = untag_ptr(this_ptr);
26785 CHECK_ACCESS(this_ptr_ptr);
26786 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
26787 FREE(untag_ptr(this_ptr));
26788 PaymentSendFailure_free(this_ptr_conv);
26791 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
26792 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26793 *ret_copy = PaymentSendFailure_clone(arg);
26794 uint64_t ret_ref = tag_ptr(ret_copy, true);
26797 int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
26798 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
26799 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
26803 uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
26804 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
26805 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26806 *ret_copy = PaymentSendFailure_clone(orig_conv);
26807 uint64_t ret_ref = tag_ptr(ret_copy, true);
26811 uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
26812 void* a_ptr = untag_ptr(a);
26813 CHECK_ACCESS(a_ptr);
26814 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
26815 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
26816 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26817 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
26818 uint64_t ret_ref = tag_ptr(ret_copy, true);
26822 uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
26823 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
26824 a_constr.datalen = a->arr_len;
26825 if (a_constr.datalen > 0)
26826 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
26828 a_constr.data = NULL;
26829 uint64_t* a_vals = a->elems;
26830 for (size_t w = 0; w < a_constr.datalen; w++) {
26831 uint64_t a_conv_22 = a_vals[w];
26832 void* a_conv_22_ptr = untag_ptr(a_conv_22);
26833 CHECK_ACCESS(a_conv_22_ptr);
26834 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
26835 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
26836 a_constr.data[w] = a_conv_22_conv;
26839 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26840 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
26841 uint64_t ret_ref = tag_ptr(ret_copy, true);
26845 uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
26846 LDKCVec_APIErrorZ a_constr;
26847 a_constr.datalen = a->arr_len;
26848 if (a_constr.datalen > 0)
26849 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
26851 a_constr.data = NULL;
26852 uint64_t* a_vals = a->elems;
26853 for (size_t k = 0; k < a_constr.datalen; k++) {
26854 uint64_t a_conv_10 = a_vals[k];
26855 void* a_conv_10_ptr = untag_ptr(a_conv_10);
26856 CHECK_ACCESS(a_conv_10_ptr);
26857 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
26858 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
26859 a_constr.data[k] = a_conv_10_conv;
26862 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26863 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
26864 uint64_t ret_ref = tag_ptr(ret_copy, true);
26868 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) {
26869 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
26870 results_constr.datalen = results->arr_len;
26871 if (results_constr.datalen > 0)
26872 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
26874 results_constr.data = NULL;
26875 uint64_t* results_vals = results->elems;
26876 for (size_t w = 0; w < results_constr.datalen; w++) {
26877 uint64_t results_conv_22 = results_vals[w];
26878 void* results_conv_22_ptr = untag_ptr(results_conv_22);
26879 CHECK_ACCESS(results_conv_22_ptr);
26880 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
26881 results_constr.data[w] = results_conv_22_conv;
26884 LDKRouteParameters failed_paths_retry_conv;
26885 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
26886 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
26887 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
26888 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
26889 LDKThirtyTwoBytes payment_id_ref;
26890 CHECK(payment_id->arr_len == 32);
26891 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
26892 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
26893 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
26894 uint64_t ret_ref = tag_ptr(ret_copy, true);
26898 void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) {
26899 LDKPhantomRouteHints this_obj_conv;
26900 this_obj_conv.inner = untag_ptr(this_obj);
26901 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26903 PhantomRouteHints_free(this_obj_conv);
26906 uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) {
26907 LDKPhantomRouteHints this_ptr_conv;
26908 this_ptr_conv.inner = untag_ptr(this_ptr);
26909 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26911 this_ptr_conv.is_owned = false;
26912 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
26913 uint64_tArray ret_arr = NULL;
26914 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
26915 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
26916 for (size_t q = 0; q < ret_var.datalen; q++) {
26917 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
26918 uint64_t ret_conv_16_ref = 0;
26919 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
26920 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
26921 ret_arr_ptr[q] = ret_conv_16_ref;
26924 FREE(ret_var.data);
26928 void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) {
26929 LDKPhantomRouteHints this_ptr_conv;
26930 this_ptr_conv.inner = untag_ptr(this_ptr);
26931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26933 this_ptr_conv.is_owned = false;
26934 LDKCVec_ChannelDetailsZ val_constr;
26935 val_constr.datalen = val->arr_len;
26936 if (val_constr.datalen > 0)
26937 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
26939 val_constr.data = NULL;
26940 uint64_t* val_vals = val->elems;
26941 for (size_t q = 0; q < val_constr.datalen; q++) {
26942 uint64_t val_conv_16 = val_vals[q];
26943 LDKChannelDetails val_conv_16_conv;
26944 val_conv_16_conv.inner = untag_ptr(val_conv_16);
26945 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
26946 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
26947 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
26948 val_constr.data[q] = val_conv_16_conv;
26951 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
26954 int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) {
26955 LDKPhantomRouteHints this_ptr_conv;
26956 this_ptr_conv.inner = untag_ptr(this_ptr);
26957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26959 this_ptr_conv.is_owned = false;
26960 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
26964 void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) {
26965 LDKPhantomRouteHints this_ptr_conv;
26966 this_ptr_conv.inner = untag_ptr(this_ptr);
26967 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26969 this_ptr_conv.is_owned = false;
26970 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
26973 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) {
26974 LDKPhantomRouteHints this_ptr_conv;
26975 this_ptr_conv.inner = untag_ptr(this_ptr);
26976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26978 this_ptr_conv.is_owned = false;
26979 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
26980 memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33);
26984 void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) {
26985 LDKPhantomRouteHints this_ptr_conv;
26986 this_ptr_conv.inner = untag_ptr(this_ptr);
26987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26989 this_ptr_conv.is_owned = false;
26990 LDKPublicKey val_ref;
26991 CHECK(val->arr_len == 33);
26992 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
26993 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
26996 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) {
26997 LDKCVec_ChannelDetailsZ channels_arg_constr;
26998 channels_arg_constr.datalen = channels_arg->arr_len;
26999 if (channels_arg_constr.datalen > 0)
27000 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
27002 channels_arg_constr.data = NULL;
27003 uint64_t* channels_arg_vals = channels_arg->elems;
27004 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
27005 uint64_t channels_arg_conv_16 = channels_arg_vals[q];
27006 LDKChannelDetails channels_arg_conv_16_conv;
27007 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
27008 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
27009 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
27010 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
27011 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
27013 FREE(channels_arg);
27014 LDKPublicKey real_node_pubkey_arg_ref;
27015 CHECK(real_node_pubkey_arg->arr_len == 33);
27016 memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
27017 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
27018 uint64_t ret_ref = 0;
27019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27024 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
27025 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
27026 uint64_t ret_ref = 0;
27027 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27028 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27031 int64_t __attribute__((export_name("TS_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) {
27032 LDKPhantomRouteHints arg_conv;
27033 arg_conv.inner = untag_ptr(arg);
27034 arg_conv.is_owned = ptr_is_owned(arg);
27035 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27036 arg_conv.is_owned = false;
27037 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
27041 uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) {
27042 LDKPhantomRouteHints orig_conv;
27043 orig_conv.inner = untag_ptr(orig);
27044 orig_conv.is_owned = ptr_is_owned(orig);
27045 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27046 orig_conv.is_owned = false;
27047 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
27048 uint64_t ret_ref = 0;
27049 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27050 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27054 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) {
27055 void* fee_est_ptr = untag_ptr(fee_est);
27056 CHECK_ACCESS(fee_est_ptr);
27057 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
27058 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
27059 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27060 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
27062 void* chain_monitor_ptr = untag_ptr(chain_monitor);
27063 CHECK_ACCESS(chain_monitor_ptr);
27064 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
27065 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
27066 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27067 LDKWatch_JCalls_cloned(&chain_monitor_conv);
27069 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
27070 CHECK_ACCESS(tx_broadcaster_ptr);
27071 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
27072 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
27073 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27074 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
27076 void* logger_ptr = untag_ptr(logger);
27077 CHECK_ACCESS(logger_ptr);
27078 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
27079 if (logger_conv.free == LDKLogger_JCalls_free) {
27080 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27081 LDKLogger_JCalls_cloned(&logger_conv);
27083 void* keys_manager_ptr = untag_ptr(keys_manager);
27084 CHECK_ACCESS(keys_manager_ptr);
27085 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
27086 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
27087 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27088 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
27090 LDKUserConfig config_conv;
27091 config_conv.inner = untag_ptr(config);
27092 config_conv.is_owned = ptr_is_owned(config);
27093 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
27094 config_conv = UserConfig_clone(&config_conv);
27095 LDKChainParameters params_conv;
27096 params_conv.inner = untag_ptr(params);
27097 params_conv.is_owned = ptr_is_owned(params);
27098 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
27099 params_conv = ChainParameters_clone(¶ms_conv);
27100 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
27101 uint64_t ret_ref = 0;
27102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27107 uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(uint64_t this_arg) {
27108 LDKChannelManager this_arg_conv;
27109 this_arg_conv.inner = untag_ptr(this_arg);
27110 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27112 this_arg_conv.is_owned = false;
27113 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
27114 uint64_t ret_ref = 0;
27115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27120 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) {
27121 LDKChannelManager this_arg_conv;
27122 this_arg_conv.inner = untag_ptr(this_arg);
27123 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27125 this_arg_conv.is_owned = false;
27126 LDKPublicKey their_network_key_ref;
27127 CHECK(their_network_key->arr_len == 33);
27128 memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
27129 LDKUserConfig override_config_conv;
27130 override_config_conv.inner = untag_ptr(override_config);
27131 override_config_conv.is_owned = ptr_is_owned(override_config);
27132 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
27133 override_config_conv = UserConfig_clone(&override_config_conv);
27134 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
27135 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
27136 return tag_ptr(ret_conv, true);
27139 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) {
27140 LDKChannelManager this_arg_conv;
27141 this_arg_conv.inner = untag_ptr(this_arg);
27142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27144 this_arg_conv.is_owned = false;
27145 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
27146 uint64_tArray ret_arr = NULL;
27147 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
27148 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
27149 for (size_t q = 0; q < ret_var.datalen; q++) {
27150 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
27151 uint64_t ret_conv_16_ref = 0;
27152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
27153 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
27154 ret_arr_ptr[q] = ret_conv_16_ref;
27157 FREE(ret_var.data);
27161 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) {
27162 LDKChannelManager this_arg_conv;
27163 this_arg_conv.inner = untag_ptr(this_arg);
27164 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27166 this_arg_conv.is_owned = false;
27167 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
27168 uint64_tArray ret_arr = NULL;
27169 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
27170 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
27171 for (size_t q = 0; q < ret_var.datalen; q++) {
27172 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
27173 uint64_t ret_conv_16_ref = 0;
27174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
27175 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
27176 ret_arr_ptr[q] = ret_conv_16_ref;
27179 FREE(ret_var.data);
27183 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) {
27184 LDKChannelManager this_arg_conv;
27185 this_arg_conv.inner = untag_ptr(this_arg);
27186 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27188 this_arg_conv.is_owned = false;
27189 unsigned char channel_id_arr[32];
27190 CHECK(channel_id->arr_len == 32);
27191 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27192 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27193 LDKPublicKey counterparty_node_id_ref;
27194 CHECK(counterparty_node_id->arr_len == 33);
27195 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27196 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27197 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27198 return tag_ptr(ret_conv, true);
27201 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) {
27202 LDKChannelManager this_arg_conv;
27203 this_arg_conv.inner = untag_ptr(this_arg);
27204 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27206 this_arg_conv.is_owned = false;
27207 unsigned char channel_id_arr[32];
27208 CHECK(channel_id->arr_len == 32);
27209 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27210 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27211 LDKPublicKey counterparty_node_id_ref;
27212 CHECK(counterparty_node_id->arr_len == 33);
27213 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27214 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27215 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
27216 return tag_ptr(ret_conv, true);
27219 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) {
27220 LDKChannelManager this_arg_conv;
27221 this_arg_conv.inner = untag_ptr(this_arg);
27222 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27224 this_arg_conv.is_owned = false;
27225 unsigned char channel_id_arr[32];
27226 CHECK(channel_id->arr_len == 32);
27227 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27228 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27229 LDKPublicKey counterparty_node_id_ref;
27230 CHECK(counterparty_node_id->arr_len == 33);
27231 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27232 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27233 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27234 return tag_ptr(ret_conv, true);
27237 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) {
27238 LDKChannelManager this_arg_conv;
27239 this_arg_conv.inner = untag_ptr(this_arg);
27240 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27242 this_arg_conv.is_owned = false;
27243 unsigned char channel_id_arr[32];
27244 CHECK(channel_id->arr_len == 32);
27245 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
27246 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
27247 LDKPublicKey counterparty_node_id_ref;
27248 CHECK(counterparty_node_id->arr_len == 33);
27249 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27250 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27251 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
27252 return tag_ptr(ret_conv, true);
27255 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) {
27256 LDKChannelManager this_arg_conv;
27257 this_arg_conv.inner = untag_ptr(this_arg);
27258 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27260 this_arg_conv.is_owned = false;
27261 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
27264 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) {
27265 LDKChannelManager this_arg_conv;
27266 this_arg_conv.inner = untag_ptr(this_arg);
27267 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27269 this_arg_conv.is_owned = false;
27270 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
27273 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) {
27274 LDKChannelManager this_arg_conv;
27275 this_arg_conv.inner = untag_ptr(this_arg);
27276 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27278 this_arg_conv.is_owned = false;
27279 LDKRoute route_conv;
27280 route_conv.inner = untag_ptr(route);
27281 route_conv.is_owned = ptr_is_owned(route);
27282 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27283 route_conv.is_owned = false;
27284 LDKThirtyTwoBytes payment_hash_ref;
27285 CHECK(payment_hash->arr_len == 32);
27286 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27287 LDKThirtyTwoBytes payment_secret_ref;
27288 CHECK(payment_secret->arr_len == 32);
27289 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
27290 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
27291 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
27292 return tag_ptr(ret_conv, true);
27295 uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
27296 LDKChannelManager this_arg_conv;
27297 this_arg_conv.inner = untag_ptr(this_arg);
27298 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27300 this_arg_conv.is_owned = false;
27301 LDKRoute route_conv;
27302 route_conv.inner = untag_ptr(route);
27303 route_conv.is_owned = ptr_is_owned(route);
27304 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27305 route_conv.is_owned = false;
27306 LDKThirtyTwoBytes payment_id_ref;
27307 CHECK(payment_id->arr_len == 32);
27308 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
27309 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
27310 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
27311 return tag_ptr(ret_conv, true);
27314 void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
27315 LDKChannelManager this_arg_conv;
27316 this_arg_conv.inner = untag_ptr(this_arg);
27317 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27319 this_arg_conv.is_owned = false;
27320 LDKThirtyTwoBytes payment_id_ref;
27321 CHECK(payment_id->arr_len == 32);
27322 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
27323 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
27326 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) {
27327 LDKChannelManager this_arg_conv;
27328 this_arg_conv.inner = untag_ptr(this_arg);
27329 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27331 this_arg_conv.is_owned = false;
27332 LDKRoute route_conv;
27333 route_conv.inner = untag_ptr(route);
27334 route_conv.is_owned = ptr_is_owned(route);
27335 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
27336 route_conv.is_owned = false;
27337 LDKThirtyTwoBytes payment_preimage_ref;
27338 CHECK(payment_preimage->arr_len == 32);
27339 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
27340 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
27341 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
27342 return tag_ptr(ret_conv, true);
27345 uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) {
27346 LDKChannelManager this_arg_conv;
27347 this_arg_conv.inner = untag_ptr(this_arg);
27348 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27350 this_arg_conv.is_owned = false;
27351 LDKCVec_RouteHopZ hops_constr;
27352 hops_constr.datalen = hops->arr_len;
27353 if (hops_constr.datalen > 0)
27354 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
27356 hops_constr.data = NULL;
27357 uint64_t* hops_vals = hops->elems;
27358 for (size_t k = 0; k < hops_constr.datalen; k++) {
27359 uint64_t hops_conv_10 = hops_vals[k];
27360 LDKRouteHop hops_conv_10_conv;
27361 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
27362 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
27363 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
27364 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
27365 hops_constr.data[k] = hops_conv_10_conv;
27368 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
27369 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
27370 return tag_ptr(ret_conv, true);
27373 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) {
27374 LDKChannelManager this_arg_conv;
27375 this_arg_conv.inner = untag_ptr(this_arg);
27376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27378 this_arg_conv.is_owned = false;
27379 unsigned char temporary_channel_id_arr[32];
27380 CHECK(temporary_channel_id->arr_len == 32);
27381 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27382 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27383 LDKPublicKey counterparty_node_id_ref;
27384 CHECK(counterparty_node_id->arr_len == 33);
27385 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27386 LDKTransaction funding_transaction_ref;
27387 funding_transaction_ref.datalen = funding_transaction->arr_len;
27388 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
27389 memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction);
27390 funding_transaction_ref.data_is_owned = true;
27391 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27392 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
27393 return tag_ptr(ret_conv, true);
27396 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) {
27397 LDKChannelManager this_arg_conv;
27398 this_arg_conv.inner = untag_ptr(this_arg);
27399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27401 this_arg_conv.is_owned = false;
27402 LDKPublicKey counterparty_node_id_ref;
27403 CHECK(counterparty_node_id->arr_len == 33);
27404 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27405 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
27406 channel_ids_constr.datalen = channel_ids->arr_len;
27407 if (channel_ids_constr.datalen > 0)
27408 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
27410 channel_ids_constr.data = NULL;
27411 int8_tArray* channel_ids_vals = (void*) channel_ids->elems;
27412 for (size_t m = 0; m < channel_ids_constr.datalen; m++) {
27413 int8_tArray channel_ids_conv_12 = channel_ids_vals[m];
27414 LDKThirtyTwoBytes channel_ids_conv_12_ref;
27415 CHECK(channel_ids_conv_12->arr_len == 32);
27416 memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12);
27417 channel_ids_constr.data[m] = channel_ids_conv_12_ref;
27420 LDKChannelConfig config_conv;
27421 config_conv.inner = untag_ptr(config);
27422 config_conv.is_owned = ptr_is_owned(config);
27423 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
27424 config_conv.is_owned = false;
27425 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27426 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
27427 return tag_ptr(ret_conv, true);
27430 void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
27431 LDKChannelManager this_arg_conv;
27432 this_arg_conv.inner = untag_ptr(this_arg);
27433 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27435 this_arg_conv.is_owned = false;
27436 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
27439 void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(uint64_t this_arg) {
27440 LDKChannelManager this_arg_conv;
27441 this_arg_conv.inner = untag_ptr(this_arg);
27442 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27444 this_arg_conv.is_owned = false;
27445 ChannelManager_timer_tick_occurred(&this_arg_conv);
27448 void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) {
27449 LDKChannelManager this_arg_conv;
27450 this_arg_conv.inner = untag_ptr(this_arg);
27451 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27453 this_arg_conv.is_owned = false;
27454 unsigned char payment_hash_arr[32];
27455 CHECK(payment_hash->arr_len == 32);
27456 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
27457 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
27458 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
27461 void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
27462 LDKChannelManager this_arg_conv;
27463 this_arg_conv.inner = untag_ptr(this_arg);
27464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27466 this_arg_conv.is_owned = false;
27467 LDKThirtyTwoBytes payment_preimage_ref;
27468 CHECK(payment_preimage->arr_len == 32);
27469 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
27470 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
27473 int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(uint64_t this_arg) {
27474 LDKChannelManager this_arg_conv;
27475 this_arg_conv.inner = untag_ptr(this_arg);
27476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27478 this_arg_conv.is_owned = false;
27479 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27480 memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
27484 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) {
27485 LDKChannelManager this_arg_conv;
27486 this_arg_conv.inner = untag_ptr(this_arg);
27487 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27489 this_arg_conv.is_owned = false;
27490 unsigned char temporary_channel_id_arr[32];
27491 CHECK(temporary_channel_id->arr_len == 32);
27492 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27493 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27494 LDKPublicKey counterparty_node_id_ref;
27495 CHECK(counterparty_node_id->arr_len == 33);
27496 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27497 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27498 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
27499 return tag_ptr(ret_conv, true);
27502 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) {
27503 LDKChannelManager this_arg_conv;
27504 this_arg_conv.inner = untag_ptr(this_arg);
27505 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27507 this_arg_conv.is_owned = false;
27508 unsigned char temporary_channel_id_arr[32];
27509 CHECK(temporary_channel_id->arr_len == 32);
27510 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
27511 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
27512 LDKPublicKey counterparty_node_id_ref;
27513 CHECK(counterparty_node_id->arr_len == 33);
27514 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
27515 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
27516 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
27517 return tag_ptr(ret_conv, true);
27520 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) {
27521 LDKChannelManager this_arg_conv;
27522 this_arg_conv.inner = untag_ptr(this_arg);
27523 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27525 this_arg_conv.is_owned = false;
27526 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27527 CHECK_ACCESS(min_value_msat_ptr);
27528 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27529 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27530 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
27531 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
27532 return tag_ptr(ret_conv, true);
27535 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) {
27536 LDKChannelManager this_arg_conv;
27537 this_arg_conv.inner = untag_ptr(this_arg);
27538 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27540 this_arg_conv.is_owned = false;
27541 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27542 CHECK_ACCESS(min_value_msat_ptr);
27543 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27544 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27545 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
27546 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
27547 return tag_ptr(ret_conv, true);
27550 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) {
27551 LDKChannelManager this_arg_conv;
27552 this_arg_conv.inner = untag_ptr(this_arg);
27553 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27555 this_arg_conv.is_owned = false;
27556 LDKThirtyTwoBytes payment_hash_ref;
27557 CHECK(payment_hash->arr_len == 32);
27558 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27559 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27560 CHECK_ACCESS(min_value_msat_ptr);
27561 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27562 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27563 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
27564 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
27565 return tag_ptr(ret_conv, true);
27568 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) {
27569 LDKChannelManager this_arg_conv;
27570 this_arg_conv.inner = untag_ptr(this_arg);
27571 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27573 this_arg_conv.is_owned = false;
27574 LDKThirtyTwoBytes payment_hash_ref;
27575 CHECK(payment_hash->arr_len == 32);
27576 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27577 void* min_value_msat_ptr = untag_ptr(min_value_msat);
27578 CHECK_ACCESS(min_value_msat_ptr);
27579 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
27580 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
27581 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
27582 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
27583 return tag_ptr(ret_conv, true);
27586 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) {
27587 LDKChannelManager this_arg_conv;
27588 this_arg_conv.inner = untag_ptr(this_arg);
27589 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27591 this_arg_conv.is_owned = false;
27592 LDKThirtyTwoBytes payment_hash_ref;
27593 CHECK(payment_hash->arr_len == 32);
27594 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
27595 LDKThirtyTwoBytes payment_secret_ref;
27596 CHECK(payment_secret->arr_len == 32);
27597 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
27598 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
27599 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
27600 return tag_ptr(ret_conv, true);
27603 int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) {
27604 LDKChannelManager this_arg_conv;
27605 this_arg_conv.inner = untag_ptr(this_arg);
27606 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27608 this_arg_conv.is_owned = false;
27609 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
27613 uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(uint64_t this_arg) {
27614 LDKChannelManager this_arg_conv;
27615 this_arg_conv.inner = untag_ptr(this_arg);
27616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27618 this_arg_conv.is_owned = false;
27619 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
27620 uint64_t ret_ref = 0;
27621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27626 uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
27627 LDKChannelManager this_arg_conv;
27628 this_arg_conv.inner = untag_ptr(this_arg);
27629 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27631 this_arg_conv.is_owned = false;
27632 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
27633 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
27634 return tag_ptr(ret_ret, true);
27637 uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint64_t this_arg) {
27638 LDKChannelManager this_arg_conv;
27639 this_arg_conv.inner = untag_ptr(this_arg);
27640 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27642 this_arg_conv.is_owned = false;
27643 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
27644 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
27645 return tag_ptr(ret_ret, true);
27648 uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint64_t this_arg) {
27649 LDKChannelManager this_arg_conv;
27650 this_arg_conv.inner = untag_ptr(this_arg);
27651 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27653 this_arg_conv.is_owned = false;
27654 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
27655 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
27656 return tag_ptr(ret_ret, true);
27659 uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint64_t this_arg) {
27660 LDKChannelManager this_arg_conv;
27661 this_arg_conv.inner = untag_ptr(this_arg);
27662 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27664 this_arg_conv.is_owned = false;
27665 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
27666 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
27667 return tag_ptr(ret_ret, true);
27670 void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint64_t this_arg) {
27671 LDKChannelManager this_arg_conv;
27672 this_arg_conv.inner = untag_ptr(this_arg);
27673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27675 this_arg_conv.is_owned = false;
27676 ChannelManager_await_persistable_update(&this_arg_conv);
27679 uint64_t __attribute__((export_name("TS_ChannelManager_get_persistable_update_future"))) TS_ChannelManager_get_persistable_update_future(uint64_t this_arg) {
27680 LDKChannelManager this_arg_conv;
27681 this_arg_conv.inner = untag_ptr(this_arg);
27682 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27684 this_arg_conv.is_owned = false;
27685 LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
27686 uint64_t ret_ref = 0;
27687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27692 uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
27693 LDKChannelManager this_arg_conv;
27694 this_arg_conv.inner = untag_ptr(this_arg);
27695 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27697 this_arg_conv.is_owned = false;
27698 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
27699 uint64_t ret_ref = 0;
27700 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27701 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27705 uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
27706 LDKChannelManager this_arg_conv;
27707 this_arg_conv.inner = untag_ptr(this_arg);
27708 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27710 this_arg_conv.is_owned = false;
27711 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
27712 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
27713 return tag_ptr(ret_ret, true);
27716 int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
27717 LDKCounterpartyForwardingInfo obj_conv;
27718 obj_conv.inner = untag_ptr(obj);
27719 obj_conv.is_owned = ptr_is_owned(obj);
27720 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27721 obj_conv.is_owned = false;
27722 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
27723 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
27724 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
27725 CVec_u8Z_free(ret_var);
27729 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
27730 LDKu8slice ser_ref;
27731 ser_ref.datalen = ser->arr_len;
27732 ser_ref.data = ser->elems;
27733 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
27734 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
27736 return tag_ptr(ret_conv, true);
27739 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) {
27740 LDKChannelCounterparty obj_conv;
27741 obj_conv.inner = untag_ptr(obj);
27742 obj_conv.is_owned = ptr_is_owned(obj);
27743 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27744 obj_conv.is_owned = false;
27745 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
27746 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
27747 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
27748 CVec_u8Z_free(ret_var);
27752 uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
27753 LDKu8slice ser_ref;
27754 ser_ref.datalen = ser->arr_len;
27755 ser_ref.data = ser->elems;
27756 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
27757 *ret_conv = ChannelCounterparty_read(ser_ref);
27759 return tag_ptr(ret_conv, true);
27762 int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) {
27763 LDKChannelDetails obj_conv;
27764 obj_conv.inner = untag_ptr(obj);
27765 obj_conv.is_owned = ptr_is_owned(obj);
27766 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27767 obj_conv.is_owned = false;
27768 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
27769 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
27770 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
27771 CVec_u8Z_free(ret_var);
27775 uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
27776 LDKu8slice ser_ref;
27777 ser_ref.datalen = ser->arr_len;
27778 ser_ref.data = ser->elems;
27779 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
27780 *ret_conv = ChannelDetails_read(ser_ref);
27782 return tag_ptr(ret_conv, true);
27785 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) {
27786 LDKPhantomRouteHints obj_conv;
27787 obj_conv.inner = untag_ptr(obj);
27788 obj_conv.is_owned = ptr_is_owned(obj);
27789 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27790 obj_conv.is_owned = false;
27791 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
27792 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
27793 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
27794 CVec_u8Z_free(ret_var);
27798 uint64_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
27799 LDKu8slice ser_ref;
27800 ser_ref.datalen = ser->arr_len;
27801 ser_ref.data = ser->elems;
27802 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
27803 *ret_conv = PhantomRouteHints_read(ser_ref);
27805 return tag_ptr(ret_conv, true);
27808 int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) {
27809 LDKChannelManager obj_conv;
27810 obj_conv.inner = untag_ptr(obj);
27811 obj_conv.is_owned = ptr_is_owned(obj);
27812 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27813 obj_conv.is_owned = false;
27814 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
27815 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
27816 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
27817 CVec_u8Z_free(ret_var);
27821 void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) {
27822 LDKChannelManagerReadArgs this_obj_conv;
27823 this_obj_conv.inner = untag_ptr(this_obj);
27824 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27826 ChannelManagerReadArgs_free(this_obj_conv);
27829 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
27830 LDKChannelManagerReadArgs this_ptr_conv;
27831 this_ptr_conv.inner = untag_ptr(this_ptr);
27832 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27834 this_ptr_conv.is_owned = false;
27835 // WARNING: This object doesn't live past this scope, needs clone!
27836 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
27840 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
27841 LDKChannelManagerReadArgs this_ptr_conv;
27842 this_ptr_conv.inner = untag_ptr(this_ptr);
27843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27845 this_ptr_conv.is_owned = false;
27846 void* val_ptr = untag_ptr(val);
27847 CHECK_ACCESS(val_ptr);
27848 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
27849 if (val_conv.free == LDKKeysInterface_JCalls_free) {
27850 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27851 LDKKeysInterface_JCalls_cloned(&val_conv);
27853 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
27856 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
27857 LDKChannelManagerReadArgs this_ptr_conv;
27858 this_ptr_conv.inner = untag_ptr(this_ptr);
27859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27861 this_ptr_conv.is_owned = false;
27862 // WARNING: This object doesn't live past this scope, needs clone!
27863 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
27867 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) {
27868 LDKChannelManagerReadArgs this_ptr_conv;
27869 this_ptr_conv.inner = untag_ptr(this_ptr);
27870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27872 this_ptr_conv.is_owned = false;
27873 void* val_ptr = untag_ptr(val);
27874 CHECK_ACCESS(val_ptr);
27875 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
27876 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
27877 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27878 LDKFeeEstimator_JCalls_cloned(&val_conv);
27880 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
27883 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) {
27884 LDKChannelManagerReadArgs this_ptr_conv;
27885 this_ptr_conv.inner = untag_ptr(this_ptr);
27886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27888 this_ptr_conv.is_owned = false;
27889 // WARNING: This object doesn't live past this scope, needs clone!
27890 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
27894 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) {
27895 LDKChannelManagerReadArgs this_ptr_conv;
27896 this_ptr_conv.inner = untag_ptr(this_ptr);
27897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27899 this_ptr_conv.is_owned = false;
27900 void* val_ptr = untag_ptr(val);
27901 CHECK_ACCESS(val_ptr);
27902 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
27903 if (val_conv.free == LDKWatch_JCalls_free) {
27904 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27905 LDKWatch_JCalls_cloned(&val_conv);
27907 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
27910 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) {
27911 LDKChannelManagerReadArgs this_ptr_conv;
27912 this_ptr_conv.inner = untag_ptr(this_ptr);
27913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27915 this_ptr_conv.is_owned = false;
27916 // WARNING: This object doesn't live past this scope, needs clone!
27917 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
27921 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) {
27922 LDKChannelManagerReadArgs this_ptr_conv;
27923 this_ptr_conv.inner = untag_ptr(this_ptr);
27924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27926 this_ptr_conv.is_owned = false;
27927 void* val_ptr = untag_ptr(val);
27928 CHECK_ACCESS(val_ptr);
27929 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
27930 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
27931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27932 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
27934 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
27937 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
27938 LDKChannelManagerReadArgs this_ptr_conv;
27939 this_ptr_conv.inner = untag_ptr(this_ptr);
27940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27942 this_ptr_conv.is_owned = false;
27943 // WARNING: This object doesn't live past this scope, needs clone!
27944 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
27948 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) {
27949 LDKChannelManagerReadArgs this_ptr_conv;
27950 this_ptr_conv.inner = untag_ptr(this_ptr);
27951 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27953 this_ptr_conv.is_owned = false;
27954 void* val_ptr = untag_ptr(val);
27955 CHECK_ACCESS(val_ptr);
27956 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
27957 if (val_conv.free == LDKLogger_JCalls_free) {
27958 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27959 LDKLogger_JCalls_cloned(&val_conv);
27961 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
27964 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) {
27965 LDKChannelManagerReadArgs this_ptr_conv;
27966 this_ptr_conv.inner = untag_ptr(this_ptr);
27967 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27969 this_ptr_conv.is_owned = false;
27970 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
27971 uint64_t ret_ref = 0;
27972 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27973 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27977 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) {
27978 LDKChannelManagerReadArgs this_ptr_conv;
27979 this_ptr_conv.inner = untag_ptr(this_ptr);
27980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27982 this_ptr_conv.is_owned = false;
27983 LDKUserConfig val_conv;
27984 val_conv.inner = untag_ptr(val);
27985 val_conv.is_owned = ptr_is_owned(val);
27986 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27987 val_conv = UserConfig_clone(&val_conv);
27988 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
27991 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) {
27992 void* keys_manager_ptr = untag_ptr(keys_manager);
27993 CHECK_ACCESS(keys_manager_ptr);
27994 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
27995 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
27996 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27997 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
27999 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28000 CHECK_ACCESS(fee_estimator_ptr);
28001 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28002 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28003 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28004 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28006 void* chain_monitor_ptr = untag_ptr(chain_monitor);
28007 CHECK_ACCESS(chain_monitor_ptr);
28008 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
28009 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
28010 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28011 LDKWatch_JCalls_cloned(&chain_monitor_conv);
28013 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
28014 CHECK_ACCESS(tx_broadcaster_ptr);
28015 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
28016 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28017 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28018 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
28020 void* logger_ptr = untag_ptr(logger);
28021 CHECK_ACCESS(logger_ptr);
28022 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28023 if (logger_conv.free == LDKLogger_JCalls_free) {
28024 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28025 LDKLogger_JCalls_cloned(&logger_conv);
28027 LDKUserConfig default_config_conv;
28028 default_config_conv.inner = untag_ptr(default_config);
28029 default_config_conv.is_owned = ptr_is_owned(default_config);
28030 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
28031 default_config_conv = UserConfig_clone(&default_config_conv);
28032 LDKCVec_ChannelMonitorZ channel_monitors_constr;
28033 channel_monitors_constr.datalen = channel_monitors->arr_len;
28034 if (channel_monitors_constr.datalen > 0)
28035 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
28037 channel_monitors_constr.data = NULL;
28038 uint64_t* channel_monitors_vals = channel_monitors->elems;
28039 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
28040 uint64_t channel_monitors_conv_16 = channel_monitors_vals[q];
28041 LDKChannelMonitor channel_monitors_conv_16_conv;
28042 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
28043 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
28044 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
28045 channel_monitors_conv_16_conv.is_owned = false;
28046 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
28048 FREE(channel_monitors);
28049 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);
28050 uint64_t ret_ref = 0;
28051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28056 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint64_t arg) {
28057 LDKu8slice ser_ref;
28058 ser_ref.datalen = ser->arr_len;
28059 ser_ref.data = ser->elems;
28060 LDKChannelManagerReadArgs arg_conv;
28061 arg_conv.inner = untag_ptr(arg);
28062 arg_conv.is_owned = ptr_is_owned(arg);
28063 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28064 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
28066 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
28067 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
28069 return tag_ptr(ret_conv, true);
28072 void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) {
28073 LDKExpandedKey this_obj_conv;
28074 this_obj_conv.inner = untag_ptr(this_obj);
28075 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28077 ExpandedKey_free(this_obj_conv);
28080 uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
28081 unsigned char key_material_arr[32];
28082 CHECK(key_material->arr_len == 32);
28083 memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
28084 unsigned char (*key_material_ref)[32] = &key_material_arr;
28085 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
28086 uint64_t ret_ref = 0;
28087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28088 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28092 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) {
28093 LDKExpandedKey keys_conv;
28094 keys_conv.inner = untag_ptr(keys);
28095 keys_conv.is_owned = ptr_is_owned(keys);
28096 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
28097 keys_conv.is_owned = false;
28098 void* min_value_msat_ptr = untag_ptr(min_value_msat);
28099 CHECK_ACCESS(min_value_msat_ptr);
28100 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
28101 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
28102 void* keys_manager_ptr = untag_ptr(keys_manager);
28103 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
28104 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
28105 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
28106 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
28107 return tag_ptr(ret_conv, true);
28110 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) {
28111 LDKExpandedKey keys_conv;
28112 keys_conv.inner = untag_ptr(keys);
28113 keys_conv.is_owned = ptr_is_owned(keys);
28114 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
28115 keys_conv.is_owned = false;
28116 void* min_value_msat_ptr = untag_ptr(min_value_msat);
28117 CHECK_ACCESS(min_value_msat_ptr);
28118 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
28119 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
28120 LDKThirtyTwoBytes payment_hash_ref;
28121 CHECK(payment_hash->arr_len == 32);
28122 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
28123 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
28124 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
28125 return tag_ptr(ret_conv, true);
28128 void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) {
28129 LDKDecodeError this_obj_conv;
28130 this_obj_conv.inner = untag_ptr(this_obj);
28131 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28133 DecodeError_free(this_obj_conv);
28136 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
28137 LDKDecodeError ret_var = DecodeError_clone(arg);
28138 uint64_t ret_ref = 0;
28139 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28140 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28143 int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
28144 LDKDecodeError arg_conv;
28145 arg_conv.inner = untag_ptr(arg);
28146 arg_conv.is_owned = ptr_is_owned(arg);
28147 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28148 arg_conv.is_owned = false;
28149 int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
28153 uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
28154 LDKDecodeError orig_conv;
28155 orig_conv.inner = untag_ptr(orig);
28156 orig_conv.is_owned = ptr_is_owned(orig);
28157 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28158 orig_conv.is_owned = false;
28159 LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
28160 uint64_t ret_ref = 0;
28161 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28162 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28166 void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
28167 LDKInit this_obj_conv;
28168 this_obj_conv.inner = untag_ptr(this_obj);
28169 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28171 Init_free(this_obj_conv);
28174 uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) {
28175 LDKInit this_ptr_conv;
28176 this_ptr_conv.inner = untag_ptr(this_ptr);
28177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28179 this_ptr_conv.is_owned = false;
28180 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
28181 uint64_t ret_ref = 0;
28182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28187 void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) {
28188 LDKInit this_ptr_conv;
28189 this_ptr_conv.inner = untag_ptr(this_ptr);
28190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28192 this_ptr_conv.is_owned = false;
28193 LDKInitFeatures val_conv;
28194 val_conv.inner = untag_ptr(val);
28195 val_conv.is_owned = ptr_is_owned(val);
28196 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28197 val_conv = InitFeatures_clone(&val_conv);
28198 Init_set_features(&this_ptr_conv, val_conv);
28201 uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) {
28202 LDKInit this_ptr_conv;
28203 this_ptr_conv.inner = untag_ptr(this_ptr);
28204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28206 this_ptr_conv.is_owned = false;
28207 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
28208 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
28209 uint64_t ret_ref = tag_ptr(ret_copy, true);
28213 void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) {
28214 LDKInit this_ptr_conv;
28215 this_ptr_conv.inner = untag_ptr(this_ptr);
28216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28218 this_ptr_conv.is_owned = false;
28219 void* val_ptr = untag_ptr(val);
28220 CHECK_ACCESS(val_ptr);
28221 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
28222 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
28223 Init_set_remote_network_address(&this_ptr_conv, val_conv);
28226 uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t remote_network_address_arg) {
28227 LDKInitFeatures features_arg_conv;
28228 features_arg_conv.inner = untag_ptr(features_arg);
28229 features_arg_conv.is_owned = ptr_is_owned(features_arg);
28230 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
28231 features_arg_conv = InitFeatures_clone(&features_arg_conv);
28232 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
28233 CHECK_ACCESS(remote_network_address_arg_ptr);
28234 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
28235 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
28236 uint64_t ret_ref = 0;
28237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28242 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
28243 LDKInit ret_var = Init_clone(arg);
28244 uint64_t ret_ref = 0;
28245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28249 int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) {
28251 arg_conv.inner = untag_ptr(arg);
28252 arg_conv.is_owned = ptr_is_owned(arg);
28253 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28254 arg_conv.is_owned = false;
28255 int64_t ret_conv = Init_clone_ptr(&arg_conv);
28259 uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) {
28261 orig_conv.inner = untag_ptr(orig);
28262 orig_conv.is_owned = ptr_is_owned(orig);
28263 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28264 orig_conv.is_owned = false;
28265 LDKInit ret_var = Init_clone(&orig_conv);
28266 uint64_t ret_ref = 0;
28267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28272 void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
28273 LDKErrorMessage this_obj_conv;
28274 this_obj_conv.inner = untag_ptr(this_obj);
28275 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28277 ErrorMessage_free(this_obj_conv);
28280 int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) {
28281 LDKErrorMessage this_ptr_conv;
28282 this_ptr_conv.inner = untag_ptr(this_ptr);
28283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28285 this_ptr_conv.is_owned = false;
28286 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28287 memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32);
28291 void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28292 LDKErrorMessage this_ptr_conv;
28293 this_ptr_conv.inner = untag_ptr(this_ptr);
28294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28296 this_ptr_conv.is_owned = false;
28297 LDKThirtyTwoBytes val_ref;
28298 CHECK(val->arr_len == 32);
28299 memcpy(val_ref.data, val->elems, 32); FREE(val);
28300 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
28303 jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) {
28304 LDKErrorMessage this_ptr_conv;
28305 this_ptr_conv.inner = untag_ptr(this_ptr);
28306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28308 this_ptr_conv.is_owned = false;
28309 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
28310 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
28315 void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) {
28316 LDKErrorMessage this_ptr_conv;
28317 this_ptr_conv.inner = untag_ptr(this_ptr);
28318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28320 this_ptr_conv.is_owned = false;
28321 LDKStr val_conv = str_ref_to_owned_c(val);
28322 ErrorMessage_set_data(&this_ptr_conv, val_conv);
28325 uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
28326 LDKThirtyTwoBytes channel_id_arg_ref;
28327 CHECK(channel_id_arg->arr_len == 32);
28328 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28329 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
28330 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
28331 uint64_t ret_ref = 0;
28332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28337 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
28338 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
28339 uint64_t ret_ref = 0;
28340 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28341 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28344 int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) {
28345 LDKErrorMessage arg_conv;
28346 arg_conv.inner = untag_ptr(arg);
28347 arg_conv.is_owned = ptr_is_owned(arg);
28348 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28349 arg_conv.is_owned = false;
28350 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
28354 uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) {
28355 LDKErrorMessage orig_conv;
28356 orig_conv.inner = untag_ptr(orig);
28357 orig_conv.is_owned = ptr_is_owned(orig);
28358 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28359 orig_conv.is_owned = false;
28360 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
28361 uint64_t ret_ref = 0;
28362 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28363 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28367 void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
28368 LDKWarningMessage this_obj_conv;
28369 this_obj_conv.inner = untag_ptr(this_obj);
28370 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28372 WarningMessage_free(this_obj_conv);
28375 int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) {
28376 LDKWarningMessage this_ptr_conv;
28377 this_ptr_conv.inner = untag_ptr(this_ptr);
28378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28380 this_ptr_conv.is_owned = false;
28381 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28382 memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32);
28386 void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28387 LDKWarningMessage this_ptr_conv;
28388 this_ptr_conv.inner = untag_ptr(this_ptr);
28389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28391 this_ptr_conv.is_owned = false;
28392 LDKThirtyTwoBytes val_ref;
28393 CHECK(val->arr_len == 32);
28394 memcpy(val_ref.data, val->elems, 32); FREE(val);
28395 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
28398 jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) {
28399 LDKWarningMessage this_ptr_conv;
28400 this_ptr_conv.inner = untag_ptr(this_ptr);
28401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28403 this_ptr_conv.is_owned = false;
28404 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
28405 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
28410 void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) {
28411 LDKWarningMessage this_ptr_conv;
28412 this_ptr_conv.inner = untag_ptr(this_ptr);
28413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28415 this_ptr_conv.is_owned = false;
28416 LDKStr val_conv = str_ref_to_owned_c(val);
28417 WarningMessage_set_data(&this_ptr_conv, val_conv);
28420 uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
28421 LDKThirtyTwoBytes channel_id_arg_ref;
28422 CHECK(channel_id_arg->arr_len == 32);
28423 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28424 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
28425 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
28426 uint64_t ret_ref = 0;
28427 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28428 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28432 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
28433 LDKWarningMessage ret_var = WarningMessage_clone(arg);
28434 uint64_t ret_ref = 0;
28435 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28436 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28439 int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) {
28440 LDKWarningMessage arg_conv;
28441 arg_conv.inner = untag_ptr(arg);
28442 arg_conv.is_owned = ptr_is_owned(arg);
28443 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28444 arg_conv.is_owned = false;
28445 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
28449 uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) {
28450 LDKWarningMessage orig_conv;
28451 orig_conv.inner = untag_ptr(orig);
28452 orig_conv.is_owned = ptr_is_owned(orig);
28453 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28454 orig_conv.is_owned = false;
28455 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
28456 uint64_t ret_ref = 0;
28457 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28458 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28462 void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
28463 LDKPing this_obj_conv;
28464 this_obj_conv.inner = untag_ptr(this_obj);
28465 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28467 Ping_free(this_obj_conv);
28470 int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) {
28471 LDKPing this_ptr_conv;
28472 this_ptr_conv.inner = untag_ptr(this_ptr);
28473 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28475 this_ptr_conv.is_owned = false;
28476 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
28480 void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) {
28481 LDKPing this_ptr_conv;
28482 this_ptr_conv.inner = untag_ptr(this_ptr);
28483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28485 this_ptr_conv.is_owned = false;
28486 Ping_set_ponglen(&this_ptr_conv, val);
28489 int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) {
28490 LDKPing this_ptr_conv;
28491 this_ptr_conv.inner = untag_ptr(this_ptr);
28492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28494 this_ptr_conv.is_owned = false;
28495 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
28499 void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) {
28500 LDKPing this_ptr_conv;
28501 this_ptr_conv.inner = untag_ptr(this_ptr);
28502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28504 this_ptr_conv.is_owned = false;
28505 Ping_set_byteslen(&this_ptr_conv, val);
28508 uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
28509 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
28510 uint64_t ret_ref = 0;
28511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28516 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
28517 LDKPing ret_var = Ping_clone(arg);
28518 uint64_t ret_ref = 0;
28519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28523 int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) {
28525 arg_conv.inner = untag_ptr(arg);
28526 arg_conv.is_owned = ptr_is_owned(arg);
28527 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28528 arg_conv.is_owned = false;
28529 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
28533 uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) {
28535 orig_conv.inner = untag_ptr(orig);
28536 orig_conv.is_owned = ptr_is_owned(orig);
28537 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28538 orig_conv.is_owned = false;
28539 LDKPing ret_var = Ping_clone(&orig_conv);
28540 uint64_t ret_ref = 0;
28541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28546 void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
28547 LDKPong this_obj_conv;
28548 this_obj_conv.inner = untag_ptr(this_obj);
28549 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28551 Pong_free(this_obj_conv);
28554 int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) {
28555 LDKPong this_ptr_conv;
28556 this_ptr_conv.inner = untag_ptr(this_ptr);
28557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28559 this_ptr_conv.is_owned = false;
28560 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
28564 void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) {
28565 LDKPong this_ptr_conv;
28566 this_ptr_conv.inner = untag_ptr(this_ptr);
28567 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28569 this_ptr_conv.is_owned = false;
28570 Pong_set_byteslen(&this_ptr_conv, val);
28573 uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) {
28574 LDKPong ret_var = Pong_new(byteslen_arg);
28575 uint64_t ret_ref = 0;
28576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28581 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
28582 LDKPong ret_var = Pong_clone(arg);
28583 uint64_t ret_ref = 0;
28584 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28585 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28588 int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) {
28590 arg_conv.inner = untag_ptr(arg);
28591 arg_conv.is_owned = ptr_is_owned(arg);
28592 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28593 arg_conv.is_owned = false;
28594 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
28598 uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) {
28600 orig_conv.inner = untag_ptr(orig);
28601 orig_conv.is_owned = ptr_is_owned(orig);
28602 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28603 orig_conv.is_owned = false;
28604 LDKPong ret_var = Pong_clone(&orig_conv);
28605 uint64_t ret_ref = 0;
28606 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28607 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28611 void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
28612 LDKOpenChannel this_obj_conv;
28613 this_obj_conv.inner = untag_ptr(this_obj);
28614 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28616 OpenChannel_free(this_obj_conv);
28619 int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) {
28620 LDKOpenChannel this_ptr_conv;
28621 this_ptr_conv.inner = untag_ptr(this_ptr);
28622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28624 this_ptr_conv.is_owned = false;
28625 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28626 memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32);
28630 void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
28631 LDKOpenChannel this_ptr_conv;
28632 this_ptr_conv.inner = untag_ptr(this_ptr);
28633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28635 this_ptr_conv.is_owned = false;
28636 LDKThirtyTwoBytes val_ref;
28637 CHECK(val->arr_len == 32);
28638 memcpy(val_ref.data, val->elems, 32); FREE(val);
28639 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
28642 int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) {
28643 LDKOpenChannel this_ptr_conv;
28644 this_ptr_conv.inner = untag_ptr(this_ptr);
28645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28647 this_ptr_conv.is_owned = false;
28648 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28649 memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32);
28653 void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
28654 LDKOpenChannel this_ptr_conv;
28655 this_ptr_conv.inner = untag_ptr(this_ptr);
28656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28658 this_ptr_conv.is_owned = false;
28659 LDKThirtyTwoBytes val_ref;
28660 CHECK(val->arr_len == 32);
28661 memcpy(val_ref.data, val->elems, 32); FREE(val);
28662 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
28665 int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) {
28666 LDKOpenChannel this_ptr_conv;
28667 this_ptr_conv.inner = untag_ptr(this_ptr);
28668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28670 this_ptr_conv.is_owned = false;
28671 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
28675 void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) {
28676 LDKOpenChannel this_ptr_conv;
28677 this_ptr_conv.inner = untag_ptr(this_ptr);
28678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28680 this_ptr_conv.is_owned = false;
28681 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
28684 int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) {
28685 LDKOpenChannel this_ptr_conv;
28686 this_ptr_conv.inner = untag_ptr(this_ptr);
28687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28689 this_ptr_conv.is_owned = false;
28690 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
28694 void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) {
28695 LDKOpenChannel this_ptr_conv;
28696 this_ptr_conv.inner = untag_ptr(this_ptr);
28697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28699 this_ptr_conv.is_owned = false;
28700 OpenChannel_set_push_msat(&this_ptr_conv, val);
28703 int64_t __attribute__((export_name("TS_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
28704 LDKOpenChannel this_ptr_conv;
28705 this_ptr_conv.inner = untag_ptr(this_ptr);
28706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28708 this_ptr_conv.is_owned = false;
28709 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
28713 void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
28714 LDKOpenChannel this_ptr_conv;
28715 this_ptr_conv.inner = untag_ptr(this_ptr);
28716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28718 this_ptr_conv.is_owned = false;
28719 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
28722 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) {
28723 LDKOpenChannel 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 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
28732 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) {
28733 LDKOpenChannel this_ptr_conv;
28734 this_ptr_conv.inner = untag_ptr(this_ptr);
28735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28737 this_ptr_conv.is_owned = false;
28738 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
28741 int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
28742 LDKOpenChannel this_ptr_conv;
28743 this_ptr_conv.inner = untag_ptr(this_ptr);
28744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28746 this_ptr_conv.is_owned = false;
28747 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
28751 void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
28752 LDKOpenChannel this_ptr_conv;
28753 this_ptr_conv.inner = untag_ptr(this_ptr);
28754 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28756 this_ptr_conv.is_owned = false;
28757 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
28760 int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
28761 LDKOpenChannel this_ptr_conv;
28762 this_ptr_conv.inner = untag_ptr(this_ptr);
28763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28765 this_ptr_conv.is_owned = false;
28766 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
28770 void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
28771 LDKOpenChannel this_ptr_conv;
28772 this_ptr_conv.inner = untag_ptr(this_ptr);
28773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28775 this_ptr_conv.is_owned = false;
28776 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
28779 int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) {
28780 LDKOpenChannel this_ptr_conv;
28781 this_ptr_conv.inner = untag_ptr(this_ptr);
28782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28784 this_ptr_conv.is_owned = false;
28785 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
28789 void __attribute__((export_name("TS_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
28790 LDKOpenChannel this_ptr_conv;
28791 this_ptr_conv.inner = untag_ptr(this_ptr);
28792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28794 this_ptr_conv.is_owned = false;
28795 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
28798 int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) {
28799 LDKOpenChannel this_ptr_conv;
28800 this_ptr_conv.inner = untag_ptr(this_ptr);
28801 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28803 this_ptr_conv.is_owned = false;
28804 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
28808 void __attribute__((export_name("TS_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
28809 LDKOpenChannel 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 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
28817 int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
28818 LDKOpenChannel this_ptr_conv;
28819 this_ptr_conv.inner = untag_ptr(this_ptr);
28820 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28822 this_ptr_conv.is_owned = false;
28823 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
28827 void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
28828 LDKOpenChannel this_ptr_conv;
28829 this_ptr_conv.inner = untag_ptr(this_ptr);
28830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28832 this_ptr_conv.is_owned = false;
28833 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
28836 int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) {
28837 LDKOpenChannel this_ptr_conv;
28838 this_ptr_conv.inner = untag_ptr(this_ptr);
28839 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28841 this_ptr_conv.is_owned = false;
28842 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28843 memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
28847 void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
28848 LDKOpenChannel this_ptr_conv;
28849 this_ptr_conv.inner = untag_ptr(this_ptr);
28850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28852 this_ptr_conv.is_owned = false;
28853 LDKPublicKey val_ref;
28854 CHECK(val->arr_len == 33);
28855 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28856 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
28859 int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) {
28860 LDKOpenChannel this_ptr_conv;
28861 this_ptr_conv.inner = untag_ptr(this_ptr);
28862 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28864 this_ptr_conv.is_owned = false;
28865 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28866 memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
28870 void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
28871 LDKOpenChannel this_ptr_conv;
28872 this_ptr_conv.inner = untag_ptr(this_ptr);
28873 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28875 this_ptr_conv.is_owned = false;
28876 LDKPublicKey val_ref;
28877 CHECK(val->arr_len == 33);
28878 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28879 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
28882 int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) {
28883 LDKOpenChannel this_ptr_conv;
28884 this_ptr_conv.inner = untag_ptr(this_ptr);
28885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28887 this_ptr_conv.is_owned = false;
28888 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28889 memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
28893 void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
28894 LDKOpenChannel this_ptr_conv;
28895 this_ptr_conv.inner = untag_ptr(this_ptr);
28896 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28897 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28898 this_ptr_conv.is_owned = false;
28899 LDKPublicKey val_ref;
28900 CHECK(val->arr_len == 33);
28901 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28902 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
28905 int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
28906 LDKOpenChannel this_ptr_conv;
28907 this_ptr_conv.inner = untag_ptr(this_ptr);
28908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28910 this_ptr_conv.is_owned = false;
28911 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28912 memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
28916 void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
28917 LDKOpenChannel this_ptr_conv;
28918 this_ptr_conv.inner = untag_ptr(this_ptr);
28919 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28921 this_ptr_conv.is_owned = false;
28922 LDKPublicKey val_ref;
28923 CHECK(val->arr_len == 33);
28924 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28925 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
28928 int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) {
28929 LDKOpenChannel this_ptr_conv;
28930 this_ptr_conv.inner = untag_ptr(this_ptr);
28931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28933 this_ptr_conv.is_owned = false;
28934 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28935 memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
28939 void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
28940 LDKOpenChannel this_ptr_conv;
28941 this_ptr_conv.inner = untag_ptr(this_ptr);
28942 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28944 this_ptr_conv.is_owned = false;
28945 LDKPublicKey val_ref;
28946 CHECK(val->arr_len == 33);
28947 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28948 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
28951 int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) {
28952 LDKOpenChannel this_ptr_conv;
28953 this_ptr_conv.inner = untag_ptr(this_ptr);
28954 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28956 this_ptr_conv.is_owned = false;
28957 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28958 memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28962 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) {
28963 LDKOpenChannel this_ptr_conv;
28964 this_ptr_conv.inner = untag_ptr(this_ptr);
28965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28967 this_ptr_conv.is_owned = false;
28968 LDKPublicKey val_ref;
28969 CHECK(val->arr_len == 33);
28970 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28971 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
28974 int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) {
28975 LDKOpenChannel this_ptr_conv;
28976 this_ptr_conv.inner = untag_ptr(this_ptr);
28977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28979 this_ptr_conv.is_owned = false;
28980 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
28984 void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) {
28985 LDKOpenChannel this_ptr_conv;
28986 this_ptr_conv.inner = untag_ptr(this_ptr);
28987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28989 this_ptr_conv.is_owned = false;
28990 OpenChannel_set_channel_flags(&this_ptr_conv, val);
28993 uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) {
28994 LDKOpenChannel this_ptr_conv;
28995 this_ptr_conv.inner = untag_ptr(this_ptr);
28996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28998 this_ptr_conv.is_owned = false;
28999 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
29000 uint64_t ret_ref = 0;
29001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29006 void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
29007 LDKOpenChannel 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 LDKChannelTypeFeatures val_conv;
29013 val_conv.inner = untag_ptr(val);
29014 val_conv.is_owned = ptr_is_owned(val);
29015 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29016 val_conv = ChannelTypeFeatures_clone(&val_conv);
29017 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
29020 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
29021 LDKOpenChannel ret_var = OpenChannel_clone(arg);
29022 uint64_t ret_ref = 0;
29023 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29024 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29027 int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) {
29028 LDKOpenChannel arg_conv;
29029 arg_conv.inner = untag_ptr(arg);
29030 arg_conv.is_owned = ptr_is_owned(arg);
29031 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29032 arg_conv.is_owned = false;
29033 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
29037 uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) {
29038 LDKOpenChannel orig_conv;
29039 orig_conv.inner = untag_ptr(orig);
29040 orig_conv.is_owned = ptr_is_owned(orig);
29041 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29042 orig_conv.is_owned = false;
29043 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
29044 uint64_t ret_ref = 0;
29045 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29046 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29050 void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
29051 LDKAcceptChannel this_obj_conv;
29052 this_obj_conv.inner = untag_ptr(this_obj);
29053 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29055 AcceptChannel_free(this_obj_conv);
29058 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) {
29059 LDKAcceptChannel this_ptr_conv;
29060 this_ptr_conv.inner = untag_ptr(this_ptr);
29061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29063 this_ptr_conv.is_owned = false;
29064 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29065 memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32);
29069 void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
29070 LDKAcceptChannel this_ptr_conv;
29071 this_ptr_conv.inner = untag_ptr(this_ptr);
29072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29074 this_ptr_conv.is_owned = false;
29075 LDKThirtyTwoBytes val_ref;
29076 CHECK(val->arr_len == 32);
29077 memcpy(val_ref.data, val->elems, 32); FREE(val);
29078 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
29081 int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
29082 LDKAcceptChannel this_ptr_conv;
29083 this_ptr_conv.inner = untag_ptr(this_ptr);
29084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29086 this_ptr_conv.is_owned = false;
29087 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
29091 void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
29092 LDKAcceptChannel this_ptr_conv;
29093 this_ptr_conv.inner = untag_ptr(this_ptr);
29094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29096 this_ptr_conv.is_owned = false;
29097 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
29100 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) {
29101 LDKAcceptChannel this_ptr_conv;
29102 this_ptr_conv.inner = untag_ptr(this_ptr);
29103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29105 this_ptr_conv.is_owned = false;
29106 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
29110 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) {
29111 LDKAcceptChannel this_ptr_conv;
29112 this_ptr_conv.inner = untag_ptr(this_ptr);
29113 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29115 this_ptr_conv.is_owned = false;
29116 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
29119 int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
29120 LDKAcceptChannel this_ptr_conv;
29121 this_ptr_conv.inner = untag_ptr(this_ptr);
29122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29124 this_ptr_conv.is_owned = false;
29125 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
29129 void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
29130 LDKAcceptChannel this_ptr_conv;
29131 this_ptr_conv.inner = untag_ptr(this_ptr);
29132 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29134 this_ptr_conv.is_owned = false;
29135 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
29138 int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
29139 LDKAcceptChannel this_ptr_conv;
29140 this_ptr_conv.inner = untag_ptr(this_ptr);
29141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29143 this_ptr_conv.is_owned = false;
29144 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
29148 void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
29149 LDKAcceptChannel this_ptr_conv;
29150 this_ptr_conv.inner = untag_ptr(this_ptr);
29151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29153 this_ptr_conv.is_owned = false;
29154 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
29157 int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) {
29158 LDKAcceptChannel this_ptr_conv;
29159 this_ptr_conv.inner = untag_ptr(this_ptr);
29160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29162 this_ptr_conv.is_owned = false;
29163 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
29167 void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) {
29168 LDKAcceptChannel this_ptr_conv;
29169 this_ptr_conv.inner = untag_ptr(this_ptr);
29170 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29172 this_ptr_conv.is_owned = false;
29173 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
29176 int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) {
29177 LDKAcceptChannel this_ptr_conv;
29178 this_ptr_conv.inner = untag_ptr(this_ptr);
29179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29181 this_ptr_conv.is_owned = false;
29182 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
29186 void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
29187 LDKAcceptChannel this_ptr_conv;
29188 this_ptr_conv.inner = untag_ptr(this_ptr);
29189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29191 this_ptr_conv.is_owned = false;
29192 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
29195 int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
29196 LDKAcceptChannel this_ptr_conv;
29197 this_ptr_conv.inner = untag_ptr(this_ptr);
29198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29200 this_ptr_conv.is_owned = false;
29201 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
29205 void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
29206 LDKAcceptChannel this_ptr_conv;
29207 this_ptr_conv.inner = untag_ptr(this_ptr);
29208 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29210 this_ptr_conv.is_owned = false;
29211 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
29214 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) {
29215 LDKAcceptChannel this_ptr_conv;
29216 this_ptr_conv.inner = untag_ptr(this_ptr);
29217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29219 this_ptr_conv.is_owned = false;
29220 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29221 memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
29225 void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
29226 LDKAcceptChannel this_ptr_conv;
29227 this_ptr_conv.inner = untag_ptr(this_ptr);
29228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29230 this_ptr_conv.is_owned = false;
29231 LDKPublicKey val_ref;
29232 CHECK(val->arr_len == 33);
29233 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29234 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
29237 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) {
29238 LDKAcceptChannel 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 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29244 memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
29248 void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
29249 LDKAcceptChannel this_ptr_conv;
29250 this_ptr_conv.inner = untag_ptr(this_ptr);
29251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29253 this_ptr_conv.is_owned = false;
29254 LDKPublicKey val_ref;
29255 CHECK(val->arr_len == 33);
29256 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29257 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
29260 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) {
29261 LDKAcceptChannel this_ptr_conv;
29262 this_ptr_conv.inner = untag_ptr(this_ptr);
29263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29265 this_ptr_conv.is_owned = false;
29266 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29267 memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
29271 void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
29272 LDKAcceptChannel this_ptr_conv;
29273 this_ptr_conv.inner = untag_ptr(this_ptr);
29274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29276 this_ptr_conv.is_owned = false;
29277 LDKPublicKey val_ref;
29278 CHECK(val->arr_len == 33);
29279 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29280 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
29283 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
29284 LDKAcceptChannel this_ptr_conv;
29285 this_ptr_conv.inner = untag_ptr(this_ptr);
29286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29288 this_ptr_conv.is_owned = false;
29289 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29290 memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
29294 void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
29295 LDKAcceptChannel 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 LDKPublicKey val_ref;
29301 CHECK(val->arr_len == 33);
29302 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29303 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
29306 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) {
29307 LDKAcceptChannel this_ptr_conv;
29308 this_ptr_conv.inner = untag_ptr(this_ptr);
29309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29311 this_ptr_conv.is_owned = false;
29312 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29313 memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
29317 void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
29318 LDKAcceptChannel this_ptr_conv;
29319 this_ptr_conv.inner = untag_ptr(this_ptr);
29320 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29322 this_ptr_conv.is_owned = false;
29323 LDKPublicKey val_ref;
29324 CHECK(val->arr_len == 33);
29325 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29326 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
29329 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) {
29330 LDKAcceptChannel this_ptr_conv;
29331 this_ptr_conv.inner = untag_ptr(this_ptr);
29332 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29334 this_ptr_conv.is_owned = false;
29335 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29336 memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29340 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) {
29341 LDKAcceptChannel this_ptr_conv;
29342 this_ptr_conv.inner = untag_ptr(this_ptr);
29343 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29345 this_ptr_conv.is_owned = false;
29346 LDKPublicKey val_ref;
29347 CHECK(val->arr_len == 33);
29348 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29349 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
29352 uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) {
29353 LDKAcceptChannel this_ptr_conv;
29354 this_ptr_conv.inner = untag_ptr(this_ptr);
29355 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29357 this_ptr_conv.is_owned = false;
29358 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
29359 uint64_t ret_ref = 0;
29360 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29361 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29365 void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
29366 LDKAcceptChannel this_ptr_conv;
29367 this_ptr_conv.inner = untag_ptr(this_ptr);
29368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29370 this_ptr_conv.is_owned = false;
29371 LDKChannelTypeFeatures val_conv;
29372 val_conv.inner = untag_ptr(val);
29373 val_conv.is_owned = ptr_is_owned(val);
29374 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29375 val_conv = ChannelTypeFeatures_clone(&val_conv);
29376 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
29379 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
29380 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
29381 uint64_t ret_ref = 0;
29382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29386 int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint64_t arg) {
29387 LDKAcceptChannel arg_conv;
29388 arg_conv.inner = untag_ptr(arg);
29389 arg_conv.is_owned = ptr_is_owned(arg);
29390 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29391 arg_conv.is_owned = false;
29392 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
29396 uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChannel_clone(uint64_t orig) {
29397 LDKAcceptChannel orig_conv;
29398 orig_conv.inner = untag_ptr(orig);
29399 orig_conv.is_owned = ptr_is_owned(orig);
29400 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29401 orig_conv.is_owned = false;
29402 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
29403 uint64_t ret_ref = 0;
29404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29409 void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
29410 LDKFundingCreated this_obj_conv;
29411 this_obj_conv.inner = untag_ptr(this_obj);
29412 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29414 FundingCreated_free(this_obj_conv);
29417 int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) {
29418 LDKFundingCreated this_ptr_conv;
29419 this_ptr_conv.inner = untag_ptr(this_ptr);
29420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29422 this_ptr_conv.is_owned = false;
29423 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29424 memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32);
29428 void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
29429 LDKFundingCreated this_ptr_conv;
29430 this_ptr_conv.inner = untag_ptr(this_ptr);
29431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29433 this_ptr_conv.is_owned = false;
29434 LDKThirtyTwoBytes val_ref;
29435 CHECK(val->arr_len == 32);
29436 memcpy(val_ref.data, val->elems, 32); FREE(val);
29437 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
29440 int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) {
29441 LDKFundingCreated this_ptr_conv;
29442 this_ptr_conv.inner = untag_ptr(this_ptr);
29443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29445 this_ptr_conv.is_owned = false;
29446 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29447 memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32);
29451 void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_FundingCreated_set_funding_txid(uint64_t this_ptr, int8_tArray val) {
29452 LDKFundingCreated 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 LDKThirtyTwoBytes val_ref;
29458 CHECK(val->arr_len == 32);
29459 memcpy(val_ref.data, val->elems, 32); FREE(val);
29460 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
29463 int16_t __attribute__((export_name("TS_FundingCreated_get_funding_output_index"))) TS_FundingCreated_get_funding_output_index(uint64_t this_ptr) {
29464 LDKFundingCreated this_ptr_conv;
29465 this_ptr_conv.inner = untag_ptr(this_ptr);
29466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29468 this_ptr_conv.is_owned = false;
29469 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
29473 void __attribute__((export_name("TS_FundingCreated_set_funding_output_index"))) TS_FundingCreated_set_funding_output_index(uint64_t this_ptr, int16_t val) {
29474 LDKFundingCreated 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 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
29482 int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_FundingCreated_get_signature(uint64_t this_ptr) {
29483 LDKFundingCreated this_ptr_conv;
29484 this_ptr_conv.inner = untag_ptr(this_ptr);
29485 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29487 this_ptr_conv.is_owned = false;
29488 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29489 memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
29493 void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_FundingCreated_set_signature(uint64_t this_ptr, int8_tArray val) {
29494 LDKFundingCreated this_ptr_conv;
29495 this_ptr_conv.inner = untag_ptr(this_ptr);
29496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29498 this_ptr_conv.is_owned = false;
29499 LDKSignature val_ref;
29500 CHECK(val->arr_len == 64);
29501 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29502 FundingCreated_set_signature(&this_ptr_conv, val_ref);
29505 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) {
29506 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
29507 CHECK(temporary_channel_id_arg->arr_len == 32);
29508 memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg);
29509 LDKThirtyTwoBytes funding_txid_arg_ref;
29510 CHECK(funding_txid_arg->arr_len == 32);
29511 memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg);
29512 LDKSignature signature_arg_ref;
29513 CHECK(signature_arg->arr_len == 64);
29514 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
29515 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
29516 uint64_t ret_ref = 0;
29517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29522 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
29523 LDKFundingCreated ret_var = FundingCreated_clone(arg);
29524 uint64_t ret_ref = 0;
29525 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29526 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29529 int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint64_t arg) {
29530 LDKFundingCreated arg_conv;
29531 arg_conv.inner = untag_ptr(arg);
29532 arg_conv.is_owned = ptr_is_owned(arg);
29533 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29534 arg_conv.is_owned = false;
29535 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
29539 uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCreated_clone(uint64_t orig) {
29540 LDKFundingCreated orig_conv;
29541 orig_conv.inner = untag_ptr(orig);
29542 orig_conv.is_owned = ptr_is_owned(orig);
29543 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29544 orig_conv.is_owned = false;
29545 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
29546 uint64_t ret_ref = 0;
29547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29552 void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
29553 LDKFundingSigned this_obj_conv;
29554 this_obj_conv.inner = untag_ptr(this_obj);
29555 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29557 FundingSigned_free(this_obj_conv);
29560 int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) {
29561 LDKFundingSigned this_ptr_conv;
29562 this_ptr_conv.inner = untag_ptr(this_ptr);
29563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29565 this_ptr_conv.is_owned = false;
29566 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29567 memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32);
29571 void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29572 LDKFundingSigned this_ptr_conv;
29573 this_ptr_conv.inner = untag_ptr(this_ptr);
29574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29576 this_ptr_conv.is_owned = false;
29577 LDKThirtyTwoBytes val_ref;
29578 CHECK(val->arr_len == 32);
29579 memcpy(val_ref.data, val->elems, 32); FREE(val);
29580 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
29583 int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) {
29584 LDKFundingSigned this_ptr_conv;
29585 this_ptr_conv.inner = untag_ptr(this_ptr);
29586 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29588 this_ptr_conv.is_owned = false;
29589 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29590 memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
29594 void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
29595 LDKFundingSigned this_ptr_conv;
29596 this_ptr_conv.inner = untag_ptr(this_ptr);
29597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29599 this_ptr_conv.is_owned = false;
29600 LDKSignature val_ref;
29601 CHECK(val->arr_len == 64);
29602 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29603 FundingSigned_set_signature(&this_ptr_conv, val_ref);
29606 uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) {
29607 LDKThirtyTwoBytes channel_id_arg_ref;
29608 CHECK(channel_id_arg->arr_len == 32);
29609 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29610 LDKSignature signature_arg_ref;
29611 CHECK(signature_arg->arr_len == 64);
29612 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
29613 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
29614 uint64_t ret_ref = 0;
29615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29620 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
29621 LDKFundingSigned ret_var = FundingSigned_clone(arg);
29622 uint64_t ret_ref = 0;
29623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29627 int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint64_t arg) {
29628 LDKFundingSigned arg_conv;
29629 arg_conv.inner = untag_ptr(arg);
29630 arg_conv.is_owned = ptr_is_owned(arg);
29631 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29632 arg_conv.is_owned = false;
29633 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
29637 uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigned_clone(uint64_t orig) {
29638 LDKFundingSigned orig_conv;
29639 orig_conv.inner = untag_ptr(orig);
29640 orig_conv.is_owned = ptr_is_owned(orig);
29641 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29642 orig_conv.is_owned = false;
29643 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
29644 uint64_t ret_ref = 0;
29645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29650 void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
29651 LDKChannelReady this_obj_conv;
29652 this_obj_conv.inner = untag_ptr(this_obj);
29653 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29655 ChannelReady_free(this_obj_conv);
29658 int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) {
29659 LDKChannelReady 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29665 memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32);
29669 void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29670 LDKChannelReady this_ptr_conv;
29671 this_ptr_conv.inner = untag_ptr(this_ptr);
29672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29674 this_ptr_conv.is_owned = false;
29675 LDKThirtyTwoBytes val_ref;
29676 CHECK(val->arr_len == 32);
29677 memcpy(val_ref.data, val->elems, 32); FREE(val);
29678 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
29681 int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) {
29682 LDKChannelReady this_ptr_conv;
29683 this_ptr_conv.inner = untag_ptr(this_ptr);
29684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29686 this_ptr_conv.is_owned = false;
29687 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29688 memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29692 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) {
29693 LDKChannelReady this_ptr_conv;
29694 this_ptr_conv.inner = untag_ptr(this_ptr);
29695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29697 this_ptr_conv.is_owned = false;
29698 LDKPublicKey val_ref;
29699 CHECK(val->arr_len == 33);
29700 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29701 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
29704 uint64_t __attribute__((export_name("TS_ChannelReady_get_short_channel_id_alias"))) TS_ChannelReady_get_short_channel_id_alias(uint64_t this_ptr) {
29705 LDKChannelReady this_ptr_conv;
29706 this_ptr_conv.inner = untag_ptr(this_ptr);
29707 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29709 this_ptr_conv.is_owned = false;
29710 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
29711 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
29712 uint64_t ret_ref = tag_ptr(ret_copy, true);
29716 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) {
29717 LDKChannelReady this_ptr_conv;
29718 this_ptr_conv.inner = untag_ptr(this_ptr);
29719 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29721 this_ptr_conv.is_owned = false;
29722 void* val_ptr = untag_ptr(val);
29723 CHECK_ACCESS(val_ptr);
29724 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
29725 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
29726 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
29729 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) {
29730 LDKThirtyTwoBytes channel_id_arg_ref;
29731 CHECK(channel_id_arg->arr_len == 32);
29732 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29733 LDKPublicKey next_per_commitment_point_arg_ref;
29734 CHECK(next_per_commitment_point_arg->arr_len == 33);
29735 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
29736 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
29737 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
29738 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
29739 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
29740 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
29741 uint64_t ret_ref = 0;
29742 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29743 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29747 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
29748 LDKChannelReady ret_var = ChannelReady_clone(arg);
29749 uint64_t ret_ref = 0;
29750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29754 int64_t __attribute__((export_name("TS_ChannelReady_clone_ptr"))) TS_ChannelReady_clone_ptr(uint64_t arg) {
29755 LDKChannelReady arg_conv;
29756 arg_conv.inner = untag_ptr(arg);
29757 arg_conv.is_owned = ptr_is_owned(arg);
29758 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29759 arg_conv.is_owned = false;
29760 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
29764 uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_clone(uint64_t orig) {
29765 LDKChannelReady orig_conv;
29766 orig_conv.inner = untag_ptr(orig);
29767 orig_conv.is_owned = ptr_is_owned(orig);
29768 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29769 orig_conv.is_owned = false;
29770 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
29771 uint64_t ret_ref = 0;
29772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29777 void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
29778 LDKShutdown this_obj_conv;
29779 this_obj_conv.inner = untag_ptr(this_obj);
29780 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29782 Shutdown_free(this_obj_conv);
29785 int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) {
29786 LDKShutdown this_ptr_conv;
29787 this_ptr_conv.inner = untag_ptr(this_ptr);
29788 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29790 this_ptr_conv.is_owned = false;
29791 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29792 memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32);
29796 void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29797 LDKShutdown this_ptr_conv;
29798 this_ptr_conv.inner = untag_ptr(this_ptr);
29799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29801 this_ptr_conv.is_owned = false;
29802 LDKThirtyTwoBytes val_ref;
29803 CHECK(val->arr_len == 32);
29804 memcpy(val_ref.data, val->elems, 32); FREE(val);
29805 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
29808 int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) {
29809 LDKShutdown this_ptr_conv;
29810 this_ptr_conv.inner = untag_ptr(this_ptr);
29811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29813 this_ptr_conv.is_owned = false;
29814 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
29815 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
29816 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
29820 void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_set_scriptpubkey(uint64_t this_ptr, int8_tArray val) {
29821 LDKShutdown this_ptr_conv;
29822 this_ptr_conv.inner = untag_ptr(this_ptr);
29823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29825 this_ptr_conv.is_owned = false;
29826 LDKCVec_u8Z val_ref;
29827 val_ref.datalen = val->arr_len;
29828 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
29829 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
29830 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
29833 uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
29834 LDKThirtyTwoBytes channel_id_arg_ref;
29835 CHECK(channel_id_arg->arr_len == 32);
29836 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29837 LDKCVec_u8Z scriptpubkey_arg_ref;
29838 scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len;
29839 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
29840 memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg);
29841 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
29842 uint64_t ret_ref = 0;
29843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29848 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
29849 LDKShutdown ret_var = Shutdown_clone(arg);
29850 uint64_t ret_ref = 0;
29851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29855 int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint64_t arg) {
29856 LDKShutdown arg_conv;
29857 arg_conv.inner = untag_ptr(arg);
29858 arg_conv.is_owned = ptr_is_owned(arg);
29859 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29860 arg_conv.is_owned = false;
29861 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
29865 uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(uint64_t orig) {
29866 LDKShutdown orig_conv;
29867 orig_conv.inner = untag_ptr(orig);
29868 orig_conv.is_owned = ptr_is_owned(orig);
29869 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29870 orig_conv.is_owned = false;
29871 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
29872 uint64_t ret_ref = 0;
29873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29878 void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
29879 LDKClosingSignedFeeRange this_obj_conv;
29880 this_obj_conv.inner = untag_ptr(this_obj);
29881 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29883 ClosingSignedFeeRange_free(this_obj_conv);
29886 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_min_fee_satoshis"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint64_t this_ptr) {
29887 LDKClosingSignedFeeRange this_ptr_conv;
29888 this_ptr_conv.inner = untag_ptr(this_ptr);
29889 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29891 this_ptr_conv.is_owned = false;
29892 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
29896 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_min_fee_satoshis"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint64_t this_ptr, int64_t val) {
29897 LDKClosingSignedFeeRange this_ptr_conv;
29898 this_ptr_conv.inner = untag_ptr(this_ptr);
29899 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29901 this_ptr_conv.is_owned = false;
29902 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
29905 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_max_fee_satoshis"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint64_t this_ptr) {
29906 LDKClosingSignedFeeRange this_ptr_conv;
29907 this_ptr_conv.inner = untag_ptr(this_ptr);
29908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29910 this_ptr_conv.is_owned = false;
29911 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
29915 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
29916 LDKClosingSignedFeeRange this_ptr_conv;
29917 this_ptr_conv.inner = untag_ptr(this_ptr);
29918 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29920 this_ptr_conv.is_owned = false;
29921 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
29924 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
29925 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
29926 uint64_t ret_ref = 0;
29927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29932 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
29933 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
29934 uint64_t ret_ref = 0;
29935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29939 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint64_t arg) {
29940 LDKClosingSignedFeeRange arg_conv;
29941 arg_conv.inner = untag_ptr(arg);
29942 arg_conv.is_owned = ptr_is_owned(arg);
29943 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29944 arg_conv.is_owned = false;
29945 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
29949 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_ClosingSignedFeeRange_clone(uint64_t orig) {
29950 LDKClosingSignedFeeRange orig_conv;
29951 orig_conv.inner = untag_ptr(orig);
29952 orig_conv.is_owned = ptr_is_owned(orig);
29953 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29954 orig_conv.is_owned = false;
29955 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
29956 uint64_t ret_ref = 0;
29957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29962 void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
29963 LDKClosingSigned this_obj_conv;
29964 this_obj_conv.inner = untag_ptr(this_obj);
29965 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29967 ClosingSigned_free(this_obj_conv);
29970 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) {
29971 LDKClosingSigned 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29977 memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32);
29981 void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29982 LDKClosingSigned this_ptr_conv;
29983 this_ptr_conv.inner = untag_ptr(this_ptr);
29984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29986 this_ptr_conv.is_owned = false;
29987 LDKThirtyTwoBytes val_ref;
29988 CHECK(val->arr_len == 32);
29989 memcpy(val_ref.data, val->elems, 32); FREE(val);
29990 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
29993 int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) {
29994 LDKClosingSigned this_ptr_conv;
29995 this_ptr_conv.inner = untag_ptr(this_ptr);
29996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29998 this_ptr_conv.is_owned = false;
29999 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
30003 void __attribute__((export_name("TS_ClosingSigned_set_fee_satoshis"))) TS_ClosingSigned_set_fee_satoshis(uint64_t this_ptr, int64_t val) {
30004 LDKClosingSigned this_ptr_conv;
30005 this_ptr_conv.inner = untag_ptr(this_ptr);
30006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30008 this_ptr_conv.is_owned = false;
30009 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
30012 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_ClosingSigned_get_signature(uint64_t this_ptr) {
30013 LDKClosingSigned this_ptr_conv;
30014 this_ptr_conv.inner = untag_ptr(this_ptr);
30015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30017 this_ptr_conv.is_owned = false;
30018 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30019 memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
30023 void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
30024 LDKClosingSigned this_ptr_conv;
30025 this_ptr_conv.inner = untag_ptr(this_ptr);
30026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30028 this_ptr_conv.is_owned = false;
30029 LDKSignature val_ref;
30030 CHECK(val->arr_len == 64);
30031 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30032 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
30035 uint64_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_ClosingSigned_get_fee_range(uint64_t this_ptr) {
30036 LDKClosingSigned this_ptr_conv;
30037 this_ptr_conv.inner = untag_ptr(this_ptr);
30038 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30040 this_ptr_conv.is_owned = false;
30041 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
30042 uint64_t ret_ref = 0;
30043 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30044 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30048 void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingSigned_set_fee_range(uint64_t this_ptr, uint64_t val) {
30049 LDKClosingSigned this_ptr_conv;
30050 this_ptr_conv.inner = untag_ptr(this_ptr);
30051 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30053 this_ptr_conv.is_owned = false;
30054 LDKClosingSignedFeeRange val_conv;
30055 val_conv.inner = untag_ptr(val);
30056 val_conv.is_owned = ptr_is_owned(val);
30057 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30058 val_conv = ClosingSignedFeeRange_clone(&val_conv);
30059 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
30062 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) {
30063 LDKThirtyTwoBytes channel_id_arg_ref;
30064 CHECK(channel_id_arg->arr_len == 32);
30065 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30066 LDKSignature signature_arg_ref;
30067 CHECK(signature_arg->arr_len == 64);
30068 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30069 LDKClosingSignedFeeRange fee_range_arg_conv;
30070 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
30071 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
30072 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
30073 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
30074 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
30075 uint64_t ret_ref = 0;
30076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30081 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
30082 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
30083 uint64_t ret_ref = 0;
30084 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30085 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30088 int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint64_t arg) {
30089 LDKClosingSigned arg_conv;
30090 arg_conv.inner = untag_ptr(arg);
30091 arg_conv.is_owned = ptr_is_owned(arg);
30092 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30093 arg_conv.is_owned = false;
30094 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
30098 uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigned_clone(uint64_t orig) {
30099 LDKClosingSigned orig_conv;
30100 orig_conv.inner = untag_ptr(orig);
30101 orig_conv.is_owned = ptr_is_owned(orig);
30102 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30103 orig_conv.is_owned = false;
30104 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
30105 uint64_t ret_ref = 0;
30106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30111 void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
30112 LDKUpdateAddHTLC this_obj_conv;
30113 this_obj_conv.inner = untag_ptr(this_obj);
30114 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30116 UpdateAddHTLC_free(this_obj_conv);
30119 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) {
30120 LDKUpdateAddHTLC this_ptr_conv;
30121 this_ptr_conv.inner = untag_ptr(this_ptr);
30122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30124 this_ptr_conv.is_owned = false;
30125 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30126 memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32);
30130 void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30131 LDKUpdateAddHTLC this_ptr_conv;
30132 this_ptr_conv.inner = untag_ptr(this_ptr);
30133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30135 this_ptr_conv.is_owned = false;
30136 LDKThirtyTwoBytes val_ref;
30137 CHECK(val->arr_len == 32);
30138 memcpy(val_ref.data, val->elems, 32); FREE(val);
30139 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
30142 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) {
30143 LDKUpdateAddHTLC this_ptr_conv;
30144 this_ptr_conv.inner = untag_ptr(this_ptr);
30145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30147 this_ptr_conv.is_owned = false;
30148 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
30152 void __attribute__((export_name("TS_UpdateAddHTLC_set_htlc_id"))) TS_UpdateAddHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30153 LDKUpdateAddHTLC this_ptr_conv;
30154 this_ptr_conv.inner = untag_ptr(this_ptr);
30155 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30157 this_ptr_conv.is_owned = false;
30158 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
30161 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_amount_msat"))) TS_UpdateAddHTLC_get_amount_msat(uint64_t this_ptr) {
30162 LDKUpdateAddHTLC this_ptr_conv;
30163 this_ptr_conv.inner = untag_ptr(this_ptr);
30164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30166 this_ptr_conv.is_owned = false;
30167 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
30171 void __attribute__((export_name("TS_UpdateAddHTLC_set_amount_msat"))) TS_UpdateAddHTLC_set_amount_msat(uint64_t this_ptr, int64_t val) {
30172 LDKUpdateAddHTLC this_ptr_conv;
30173 this_ptr_conv.inner = untag_ptr(this_ptr);
30174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30176 this_ptr_conv.is_owned = false;
30177 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
30180 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) TS_UpdateAddHTLC_get_payment_hash(uint64_t this_ptr) {
30181 LDKUpdateAddHTLC this_ptr_conv;
30182 this_ptr_conv.inner = untag_ptr(this_ptr);
30183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30185 this_ptr_conv.is_owned = false;
30186 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30187 memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32);
30191 void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_UpdateAddHTLC_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
30192 LDKUpdateAddHTLC this_ptr_conv;
30193 this_ptr_conv.inner = untag_ptr(this_ptr);
30194 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30196 this_ptr_conv.is_owned = false;
30197 LDKThirtyTwoBytes val_ref;
30198 CHECK(val->arr_len == 32);
30199 memcpy(val_ref.data, val->elems, 32); FREE(val);
30200 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
30203 int32_t __attribute__((export_name("TS_UpdateAddHTLC_get_cltv_expiry"))) TS_UpdateAddHTLC_get_cltv_expiry(uint64_t this_ptr) {
30204 LDKUpdateAddHTLC this_ptr_conv;
30205 this_ptr_conv.inner = untag_ptr(this_ptr);
30206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30208 this_ptr_conv.is_owned = false;
30209 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
30213 void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_UpdateAddHTLC_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
30214 LDKUpdateAddHTLC this_ptr_conv;
30215 this_ptr_conv.inner = untag_ptr(this_ptr);
30216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30218 this_ptr_conv.is_owned = false;
30219 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
30222 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
30223 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
30224 uint64_t ret_ref = 0;
30225 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30226 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30229 int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint64_t arg) {
30230 LDKUpdateAddHTLC arg_conv;
30231 arg_conv.inner = untag_ptr(arg);
30232 arg_conv.is_owned = ptr_is_owned(arg);
30233 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30234 arg_conv.is_owned = false;
30235 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
30239 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTLC_clone(uint64_t orig) {
30240 LDKUpdateAddHTLC orig_conv;
30241 orig_conv.inner = untag_ptr(orig);
30242 orig_conv.is_owned = ptr_is_owned(orig);
30243 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30244 orig_conv.is_owned = false;
30245 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
30246 uint64_t ret_ref = 0;
30247 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30248 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30252 void __attribute__((export_name("TS_OnionMessage_free"))) TS_OnionMessage_free(uint64_t this_obj) {
30253 LDKOnionMessage this_obj_conv;
30254 this_obj_conv.inner = untag_ptr(this_obj);
30255 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30257 OnionMessage_free(this_obj_conv);
30260 int8_tArray __attribute__((export_name("TS_OnionMessage_get_blinding_point"))) TS_OnionMessage_get_blinding_point(uint64_t this_ptr) {
30261 LDKOnionMessage this_ptr_conv;
30262 this_ptr_conv.inner = untag_ptr(this_ptr);
30263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30265 this_ptr_conv.is_owned = false;
30266 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30267 memcpy(ret_arr->elems, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form, 33);
30271 void __attribute__((export_name("TS_OnionMessage_set_blinding_point"))) TS_OnionMessage_set_blinding_point(uint64_t this_ptr, int8_tArray val) {
30272 LDKOnionMessage this_ptr_conv;
30273 this_ptr_conv.inner = untag_ptr(this_ptr);
30274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30276 this_ptr_conv.is_owned = false;
30277 LDKPublicKey val_ref;
30278 CHECK(val->arr_len == 33);
30279 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30280 OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
30283 static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
30284 LDKOnionMessage ret_var = OnionMessage_clone(arg);
30285 uint64_t ret_ref = 0;
30286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30290 int64_t __attribute__((export_name("TS_OnionMessage_clone_ptr"))) TS_OnionMessage_clone_ptr(uint64_t arg) {
30291 LDKOnionMessage arg_conv;
30292 arg_conv.inner = untag_ptr(arg);
30293 arg_conv.is_owned = ptr_is_owned(arg);
30294 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30295 arg_conv.is_owned = false;
30296 int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
30300 uint64_t __attribute__((export_name("TS_OnionMessage_clone"))) TS_OnionMessage_clone(uint64_t orig) {
30301 LDKOnionMessage orig_conv;
30302 orig_conv.inner = untag_ptr(orig);
30303 orig_conv.is_owned = ptr_is_owned(orig);
30304 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30305 orig_conv.is_owned = false;
30306 LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
30307 uint64_t ret_ref = 0;
30308 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30309 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30313 void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
30314 LDKUpdateFulfillHTLC this_obj_conv;
30315 this_obj_conv.inner = untag_ptr(this_obj);
30316 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30318 UpdateFulfillHTLC_free(this_obj_conv);
30321 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) {
30322 LDKUpdateFulfillHTLC this_ptr_conv;
30323 this_ptr_conv.inner = untag_ptr(this_ptr);
30324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30326 this_ptr_conv.is_owned = false;
30327 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30328 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32);
30332 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30333 LDKUpdateFulfillHTLC this_ptr_conv;
30334 this_ptr_conv.inner = untag_ptr(this_ptr);
30335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30337 this_ptr_conv.is_owned = false;
30338 LDKThirtyTwoBytes val_ref;
30339 CHECK(val->arr_len == 32);
30340 memcpy(val_ref.data, val->elems, 32); FREE(val);
30341 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
30344 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) {
30345 LDKUpdateFulfillHTLC this_ptr_conv;
30346 this_ptr_conv.inner = untag_ptr(this_ptr);
30347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30349 this_ptr_conv.is_owned = false;
30350 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
30354 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_htlc_id"))) TS_UpdateFulfillHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30355 LDKUpdateFulfillHTLC this_ptr_conv;
30356 this_ptr_conv.inner = untag_ptr(this_ptr);
30357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30359 this_ptr_conv.is_owned = false;
30360 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
30363 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preimage"))) TS_UpdateFulfillHTLC_get_payment_preimage(uint64_t this_ptr) {
30364 LDKUpdateFulfillHTLC this_ptr_conv;
30365 this_ptr_conv.inner = untag_ptr(this_ptr);
30366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30368 this_ptr_conv.is_owned = false;
30369 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30370 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32);
30374 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) TS_UpdateFulfillHTLC_set_payment_preimage(uint64_t this_ptr, int8_tArray val) {
30375 LDKUpdateFulfillHTLC this_ptr_conv;
30376 this_ptr_conv.inner = untag_ptr(this_ptr);
30377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30379 this_ptr_conv.is_owned = false;
30380 LDKThirtyTwoBytes val_ref;
30381 CHECK(val->arr_len == 32);
30382 memcpy(val_ref.data, val->elems, 32); FREE(val);
30383 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
30386 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) {
30387 LDKThirtyTwoBytes channel_id_arg_ref;
30388 CHECK(channel_id_arg->arr_len == 32);
30389 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30390 LDKThirtyTwoBytes payment_preimage_arg_ref;
30391 CHECK(payment_preimage_arg->arr_len == 32);
30392 memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg);
30393 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
30394 uint64_t ret_ref = 0;
30395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30400 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
30401 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
30402 uint64_t ret_ref = 0;
30403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30407 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint64_t arg) {
30408 LDKUpdateFulfillHTLC arg_conv;
30409 arg_conv.inner = untag_ptr(arg);
30410 arg_conv.is_owned = ptr_is_owned(arg);
30411 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30412 arg_conv.is_owned = false;
30413 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
30417 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFulfillHTLC_clone(uint64_t orig) {
30418 LDKUpdateFulfillHTLC orig_conv;
30419 orig_conv.inner = untag_ptr(orig);
30420 orig_conv.is_owned = ptr_is_owned(orig);
30421 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30422 orig_conv.is_owned = false;
30423 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
30424 uint64_t ret_ref = 0;
30425 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30426 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30430 void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
30431 LDKUpdateFailHTLC this_obj_conv;
30432 this_obj_conv.inner = untag_ptr(this_obj);
30433 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30435 UpdateFailHTLC_free(this_obj_conv);
30438 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) {
30439 LDKUpdateFailHTLC this_ptr_conv;
30440 this_ptr_conv.inner = untag_ptr(this_ptr);
30441 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30443 this_ptr_conv.is_owned = false;
30444 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30445 memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32);
30449 void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30450 LDKUpdateFailHTLC this_ptr_conv;
30451 this_ptr_conv.inner = untag_ptr(this_ptr);
30452 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30454 this_ptr_conv.is_owned = false;
30455 LDKThirtyTwoBytes val_ref;
30456 CHECK(val->arr_len == 32);
30457 memcpy(val_ref.data, val->elems, 32); FREE(val);
30458 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
30461 int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) {
30462 LDKUpdateFailHTLC this_ptr_conv;
30463 this_ptr_conv.inner = untag_ptr(this_ptr);
30464 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30466 this_ptr_conv.is_owned = false;
30467 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
30471 void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFailHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30472 LDKUpdateFailHTLC this_ptr_conv;
30473 this_ptr_conv.inner = untag_ptr(this_ptr);
30474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30476 this_ptr_conv.is_owned = false;
30477 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
30480 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
30481 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
30482 uint64_t ret_ref = 0;
30483 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30484 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30487 int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint64_t arg) {
30488 LDKUpdateFailHTLC arg_conv;
30489 arg_conv.inner = untag_ptr(arg);
30490 arg_conv.is_owned = ptr_is_owned(arg);
30491 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30492 arg_conv.is_owned = false;
30493 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
30497 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailHTLC_clone(uint64_t orig) {
30498 LDKUpdateFailHTLC orig_conv;
30499 orig_conv.inner = untag_ptr(orig);
30500 orig_conv.is_owned = ptr_is_owned(orig);
30501 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30502 orig_conv.is_owned = false;
30503 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
30504 uint64_t ret_ref = 0;
30505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30510 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
30511 LDKUpdateFailMalformedHTLC this_obj_conv;
30512 this_obj_conv.inner = untag_ptr(this_obj);
30513 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30515 UpdateFailMalformedHTLC_free(this_obj_conv);
30518 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) {
30519 LDKUpdateFailMalformedHTLC this_ptr_conv;
30520 this_ptr_conv.inner = untag_ptr(this_ptr);
30521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30523 this_ptr_conv.is_owned = false;
30524 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30525 memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32);
30529 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30530 LDKUpdateFailMalformedHTLC this_ptr_conv;
30531 this_ptr_conv.inner = untag_ptr(this_ptr);
30532 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30534 this_ptr_conv.is_owned = false;
30535 LDKThirtyTwoBytes val_ref;
30536 CHECK(val->arr_len == 32);
30537 memcpy(val_ref.data, val->elems, 32); FREE(val);
30538 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
30541 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) {
30542 LDKUpdateFailMalformedHTLC this_ptr_conv;
30543 this_ptr_conv.inner = untag_ptr(this_ptr);
30544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30546 this_ptr_conv.is_owned = false;
30547 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
30551 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_htlc_id"))) TS_UpdateFailMalformedHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
30552 LDKUpdateFailMalformedHTLC this_ptr_conv;
30553 this_ptr_conv.inner = untag_ptr(this_ptr);
30554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30556 this_ptr_conv.is_owned = false;
30557 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
30560 int16_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_failure_code"))) TS_UpdateFailMalformedHTLC_get_failure_code(uint64_t this_ptr) {
30561 LDKUpdateFailMalformedHTLC this_ptr_conv;
30562 this_ptr_conv.inner = untag_ptr(this_ptr);
30563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30565 this_ptr_conv.is_owned = false;
30566 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
30570 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code"))) TS_UpdateFailMalformedHTLC_set_failure_code(uint64_t this_ptr, int16_t val) {
30571 LDKUpdateFailMalformedHTLC this_ptr_conv;
30572 this_ptr_conv.inner = untag_ptr(this_ptr);
30573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30575 this_ptr_conv.is_owned = false;
30576 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
30579 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
30580 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
30581 uint64_t ret_ref = 0;
30582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30586 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint64_t arg) {
30587 LDKUpdateFailMalformedHTLC arg_conv;
30588 arg_conv.inner = untag_ptr(arg);
30589 arg_conv.is_owned = ptr_is_owned(arg);
30590 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30591 arg_conv.is_owned = false;
30592 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
30596 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_UpdateFailMalformedHTLC_clone(uint64_t orig) {
30597 LDKUpdateFailMalformedHTLC orig_conv;
30598 orig_conv.inner = untag_ptr(orig);
30599 orig_conv.is_owned = ptr_is_owned(orig);
30600 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30601 orig_conv.is_owned = false;
30602 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
30603 uint64_t ret_ref = 0;
30604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30609 void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
30610 LDKCommitmentSigned this_obj_conv;
30611 this_obj_conv.inner = untag_ptr(this_obj);
30612 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30614 CommitmentSigned_free(this_obj_conv);
30617 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) {
30618 LDKCommitmentSigned this_ptr_conv;
30619 this_ptr_conv.inner = untag_ptr(this_ptr);
30620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30622 this_ptr_conv.is_owned = false;
30623 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30624 memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32);
30628 void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30629 LDKCommitmentSigned this_ptr_conv;
30630 this_ptr_conv.inner = untag_ptr(this_ptr);
30631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30633 this_ptr_conv.is_owned = false;
30634 LDKThirtyTwoBytes val_ref;
30635 CHECK(val->arr_len == 32);
30636 memcpy(val_ref.data, val->elems, 32); FREE(val);
30637 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
30640 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) {
30641 LDKCommitmentSigned this_ptr_conv;
30642 this_ptr_conv.inner = untag_ptr(this_ptr);
30643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30645 this_ptr_conv.is_owned = false;
30646 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30647 memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
30651 void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_CommitmentSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
30652 LDKCommitmentSigned this_ptr_conv;
30653 this_ptr_conv.inner = untag_ptr(this_ptr);
30654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30656 this_ptr_conv.is_owned = false;
30657 LDKSignature val_ref;
30658 CHECK(val->arr_len == 64);
30659 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30660 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
30663 ptrArray __attribute__((export_name("TS_CommitmentSigned_get_htlc_signatures"))) TS_CommitmentSigned_get_htlc_signatures(uint64_t this_ptr) {
30664 LDKCommitmentSigned this_ptr_conv;
30665 this_ptr_conv.inner = untag_ptr(this_ptr);
30666 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30668 this_ptr_conv.is_owned = false;
30669 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
30670 ptrArray ret_arr = NULL;
30671 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
30672 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
30673 for (size_t m = 0; m < ret_var.datalen; m++) {
30674 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
30675 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
30676 ret_arr_ptr[m] = ret_conv_12_arr;
30679 FREE(ret_var.data);
30683 void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS_CommitmentSigned_set_htlc_signatures(uint64_t this_ptr, ptrArray val) {
30684 LDKCommitmentSigned this_ptr_conv;
30685 this_ptr_conv.inner = untag_ptr(this_ptr);
30686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30688 this_ptr_conv.is_owned = false;
30689 LDKCVec_SignatureZ val_constr;
30690 val_constr.datalen = val->arr_len;
30691 if (val_constr.datalen > 0)
30692 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
30694 val_constr.data = NULL;
30695 int8_tArray* val_vals = (void*) val->elems;
30696 for (size_t m = 0; m < val_constr.datalen; m++) {
30697 int8_tArray val_conv_12 = val_vals[m];
30698 LDKSignature val_conv_12_ref;
30699 CHECK(val_conv_12->arr_len == 64);
30700 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
30701 val_constr.data[m] = val_conv_12_ref;
30704 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
30707 uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) {
30708 LDKThirtyTwoBytes channel_id_arg_ref;
30709 CHECK(channel_id_arg->arr_len == 32);
30710 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30711 LDKSignature signature_arg_ref;
30712 CHECK(signature_arg->arr_len == 64);
30713 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30714 LDKCVec_SignatureZ htlc_signatures_arg_constr;
30715 htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len;
30716 if (htlc_signatures_arg_constr.datalen > 0)
30717 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
30719 htlc_signatures_arg_constr.data = NULL;
30720 int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
30721 for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
30722 int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
30723 LDKSignature htlc_signatures_arg_conv_12_ref;
30724 CHECK(htlc_signatures_arg_conv_12->arr_len == 64);
30725 memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
30726 htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
30728 FREE(htlc_signatures_arg);
30729 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
30730 uint64_t ret_ref = 0;
30731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30736 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
30737 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
30738 uint64_t ret_ref = 0;
30739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30743 int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint64_t arg) {
30744 LDKCommitmentSigned arg_conv;
30745 arg_conv.inner = untag_ptr(arg);
30746 arg_conv.is_owned = ptr_is_owned(arg);
30747 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30748 arg_conv.is_owned = false;
30749 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
30753 uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_CommitmentSigned_clone(uint64_t orig) {
30754 LDKCommitmentSigned orig_conv;
30755 orig_conv.inner = untag_ptr(orig);
30756 orig_conv.is_owned = ptr_is_owned(orig);
30757 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30758 orig_conv.is_owned = false;
30759 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
30760 uint64_t ret_ref = 0;
30761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30766 void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
30767 LDKRevokeAndACK this_obj_conv;
30768 this_obj_conv.inner = untag_ptr(this_obj);
30769 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30771 RevokeAndACK_free(this_obj_conv);
30774 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) {
30775 LDKRevokeAndACK this_ptr_conv;
30776 this_ptr_conv.inner = untag_ptr(this_ptr);
30777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30779 this_ptr_conv.is_owned = false;
30780 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30781 memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32);
30785 void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30786 LDKRevokeAndACK this_ptr_conv;
30787 this_ptr_conv.inner = untag_ptr(this_ptr);
30788 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30790 this_ptr_conv.is_owned = false;
30791 LDKThirtyTwoBytes val_ref;
30792 CHECK(val->arr_len == 32);
30793 memcpy(val_ref.data, val->elems, 32); FREE(val);
30794 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
30797 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) {
30798 LDKRevokeAndACK this_ptr_conv;
30799 this_ptr_conv.inner = untag_ptr(this_ptr);
30800 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30802 this_ptr_conv.is_owned = false;
30803 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30804 memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32);
30808 void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) TS_RevokeAndACK_set_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
30809 LDKRevokeAndACK this_ptr_conv;
30810 this_ptr_conv.inner = untag_ptr(this_ptr);
30811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30813 this_ptr_conv.is_owned = false;
30814 LDKThirtyTwoBytes val_ref;
30815 CHECK(val->arr_len == 32);
30816 memcpy(val_ref.data, val->elems, 32); FREE(val);
30817 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
30820 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment_point"))) TS_RevokeAndACK_get_next_per_commitment_point(uint64_t this_ptr) {
30821 LDKRevokeAndACK this_ptr_conv;
30822 this_ptr_conv.inner = untag_ptr(this_ptr);
30823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30825 this_ptr_conv.is_owned = false;
30826 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30827 memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
30831 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) {
30832 LDKRevokeAndACK this_ptr_conv;
30833 this_ptr_conv.inner = untag_ptr(this_ptr);
30834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30836 this_ptr_conv.is_owned = false;
30837 LDKPublicKey val_ref;
30838 CHECK(val->arr_len == 33);
30839 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30840 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
30843 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) {
30844 LDKThirtyTwoBytes channel_id_arg_ref;
30845 CHECK(channel_id_arg->arr_len == 32);
30846 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30847 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
30848 CHECK(per_commitment_secret_arg->arr_len == 32);
30849 memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg);
30850 LDKPublicKey next_per_commitment_point_arg_ref;
30851 CHECK(next_per_commitment_point_arg->arr_len == 33);
30852 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
30853 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
30854 uint64_t ret_ref = 0;
30855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30860 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
30861 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
30862 uint64_t ret_ref = 0;
30863 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30864 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30867 int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint64_t arg) {
30868 LDKRevokeAndACK arg_conv;
30869 arg_conv.inner = untag_ptr(arg);
30870 arg_conv.is_owned = ptr_is_owned(arg);
30871 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30872 arg_conv.is_owned = false;
30873 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
30877 uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_clone(uint64_t orig) {
30878 LDKRevokeAndACK orig_conv;
30879 orig_conv.inner = untag_ptr(orig);
30880 orig_conv.is_owned = ptr_is_owned(orig);
30881 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30882 orig_conv.is_owned = false;
30883 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
30884 uint64_t ret_ref = 0;
30885 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30886 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30890 void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
30891 LDKUpdateFee this_obj_conv;
30892 this_obj_conv.inner = untag_ptr(this_obj);
30893 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30895 UpdateFee_free(this_obj_conv);
30898 int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) {
30899 LDKUpdateFee this_ptr_conv;
30900 this_ptr_conv.inner = untag_ptr(this_ptr);
30901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30903 this_ptr_conv.is_owned = false;
30904 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30905 memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32);
30909 void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) {
30910 LDKUpdateFee this_ptr_conv;
30911 this_ptr_conv.inner = untag_ptr(this_ptr);
30912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30914 this_ptr_conv.is_owned = false;
30915 LDKThirtyTwoBytes val_ref;
30916 CHECK(val->arr_len == 32);
30917 memcpy(val_ref.data, val->elems, 32); FREE(val);
30918 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
30921 int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) {
30922 LDKUpdateFee this_ptr_conv;
30923 this_ptr_conv.inner = untag_ptr(this_ptr);
30924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30926 this_ptr_conv.is_owned = false;
30927 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
30931 void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateFee_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
30932 LDKUpdateFee this_ptr_conv;
30933 this_ptr_conv.inner = untag_ptr(this_ptr);
30934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30936 this_ptr_conv.is_owned = false;
30937 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
30940 uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
30941 LDKThirtyTwoBytes channel_id_arg_ref;
30942 CHECK(channel_id_arg->arr_len == 32);
30943 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30944 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
30945 uint64_t ret_ref = 0;
30946 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30947 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30951 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
30952 LDKUpdateFee ret_var = UpdateFee_clone(arg);
30953 uint64_t ret_ref = 0;
30954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30955 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30958 int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint64_t arg) {
30959 LDKUpdateFee arg_conv;
30960 arg_conv.inner = untag_ptr(arg);
30961 arg_conv.is_owned = ptr_is_owned(arg);
30962 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30963 arg_conv.is_owned = false;
30964 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
30968 uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone(uint64_t orig) {
30969 LDKUpdateFee orig_conv;
30970 orig_conv.inner = untag_ptr(orig);
30971 orig_conv.is_owned = ptr_is_owned(orig);
30972 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30973 orig_conv.is_owned = false;
30974 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
30975 uint64_t ret_ref = 0;
30976 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30977 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30981 void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
30982 LDKDataLossProtect this_obj_conv;
30983 this_obj_conv.inner = untag_ptr(this_obj);
30984 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30986 DataLossProtect_free(this_obj_conv);
30989 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) {
30990 LDKDataLossProtect this_ptr_conv;
30991 this_ptr_conv.inner = untag_ptr(this_ptr);
30992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30994 this_ptr_conv.is_owned = false;
30995 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30996 memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32);
31000 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) {
31001 LDKDataLossProtect this_ptr_conv;
31002 this_ptr_conv.inner = untag_ptr(this_ptr);
31003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31005 this_ptr_conv.is_owned = false;
31006 LDKThirtyTwoBytes val_ref;
31007 CHECK(val->arr_len == 32);
31008 memcpy(val_ref.data, val->elems, 32); FREE(val);
31009 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
31012 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) {
31013 LDKDataLossProtect this_ptr_conv;
31014 this_ptr_conv.inner = untag_ptr(this_ptr);
31015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31017 this_ptr_conv.is_owned = false;
31018 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31019 memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
31023 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) {
31024 LDKDataLossProtect this_ptr_conv;
31025 this_ptr_conv.inner = untag_ptr(this_ptr);
31026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31028 this_ptr_conv.is_owned = false;
31029 LDKPublicKey val_ref;
31030 CHECK(val->arr_len == 33);
31031 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31032 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
31035 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) {
31036 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
31037 CHECK(your_last_per_commitment_secret_arg->arr_len == 32);
31038 memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg);
31039 LDKPublicKey my_current_per_commitment_point_arg_ref;
31040 CHECK(my_current_per_commitment_point_arg->arr_len == 33);
31041 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);
31042 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
31043 uint64_t ret_ref = 0;
31044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31049 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
31050 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
31051 uint64_t ret_ref = 0;
31052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31056 int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint64_t arg) {
31057 LDKDataLossProtect arg_conv;
31058 arg_conv.inner = untag_ptr(arg);
31059 arg_conv.is_owned = ptr_is_owned(arg);
31060 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31061 arg_conv.is_owned = false;
31062 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
31066 uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossProtect_clone(uint64_t orig) {
31067 LDKDataLossProtect orig_conv;
31068 orig_conv.inner = untag_ptr(orig);
31069 orig_conv.is_owned = ptr_is_owned(orig);
31070 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31071 orig_conv.is_owned = false;
31072 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
31073 uint64_t ret_ref = 0;
31074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31079 void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
31080 LDKChannelReestablish this_obj_conv;
31081 this_obj_conv.inner = untag_ptr(this_obj);
31082 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31084 ChannelReestablish_free(this_obj_conv);
31087 int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) {
31088 LDKChannelReestablish this_ptr_conv;
31089 this_ptr_conv.inner = untag_ptr(this_ptr);
31090 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31092 this_ptr_conv.is_owned = false;
31093 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31094 memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32);
31098 void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31099 LDKChannelReestablish this_ptr_conv;
31100 this_ptr_conv.inner = untag_ptr(this_ptr);
31101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31103 this_ptr_conv.is_owned = false;
31104 LDKThirtyTwoBytes val_ref;
31105 CHECK(val->arr_len == 32);
31106 memcpy(val_ref.data, val->elems, 32); FREE(val);
31107 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
31110 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) {
31111 LDKChannelReestablish this_ptr_conv;
31112 this_ptr_conv.inner = untag_ptr(this_ptr);
31113 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31115 this_ptr_conv.is_owned = false;
31116 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
31120 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) {
31121 LDKChannelReestablish this_ptr_conv;
31122 this_ptr_conv.inner = untag_ptr(this_ptr);
31123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31125 this_ptr_conv.is_owned = false;
31126 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
31129 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_remote_commitment_number"))) TS_ChannelReestablish_get_next_remote_commitment_number(uint64_t this_ptr) {
31130 LDKChannelReestablish this_ptr_conv;
31131 this_ptr_conv.inner = untag_ptr(this_ptr);
31132 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31134 this_ptr_conv.is_owned = false;
31135 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
31139 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) {
31140 LDKChannelReestablish this_ptr_conv;
31141 this_ptr_conv.inner = untag_ptr(this_ptr);
31142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31144 this_ptr_conv.is_owned = false;
31145 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
31148 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
31149 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
31150 uint64_t ret_ref = 0;
31151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31155 int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint64_t arg) {
31156 LDKChannelReestablish arg_conv;
31157 arg_conv.inner = untag_ptr(arg);
31158 arg_conv.is_owned = ptr_is_owned(arg);
31159 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31160 arg_conv.is_owned = false;
31161 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
31165 uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_ChannelReestablish_clone(uint64_t orig) {
31166 LDKChannelReestablish orig_conv;
31167 orig_conv.inner = untag_ptr(orig);
31168 orig_conv.is_owned = ptr_is_owned(orig);
31169 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31170 orig_conv.is_owned = false;
31171 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
31172 uint64_t ret_ref = 0;
31173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31178 void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
31179 LDKAnnouncementSignatures this_obj_conv;
31180 this_obj_conv.inner = untag_ptr(this_obj);
31181 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31183 AnnouncementSignatures_free(this_obj_conv);
31186 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) {
31187 LDKAnnouncementSignatures this_ptr_conv;
31188 this_ptr_conv.inner = untag_ptr(this_ptr);
31189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31191 this_ptr_conv.is_owned = false;
31192 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31193 memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32);
31197 void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) {
31198 LDKAnnouncementSignatures this_ptr_conv;
31199 this_ptr_conv.inner = untag_ptr(this_ptr);
31200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31202 this_ptr_conv.is_owned = false;
31203 LDKThirtyTwoBytes val_ref;
31204 CHECK(val->arr_len == 32);
31205 memcpy(val_ref.data, val->elems, 32); FREE(val);
31206 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
31209 int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) {
31210 LDKAnnouncementSignatures this_ptr_conv;
31211 this_ptr_conv.inner = untag_ptr(this_ptr);
31212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31214 this_ptr_conv.is_owned = false;
31215 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
31219 void __attribute__((export_name("TS_AnnouncementSignatures_set_short_channel_id"))) TS_AnnouncementSignatures_set_short_channel_id(uint64_t this_ptr, int64_t val) {
31220 LDKAnnouncementSignatures this_ptr_conv;
31221 this_ptr_conv.inner = untag_ptr(this_ptr);
31222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31224 this_ptr_conv.is_owned = false;
31225 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
31228 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_signature"))) TS_AnnouncementSignatures_get_node_signature(uint64_t this_ptr) {
31229 LDKAnnouncementSignatures this_ptr_conv;
31230 this_ptr_conv.inner = untag_ptr(this_ptr);
31231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31233 this_ptr_conv.is_owned = false;
31234 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31235 memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
31239 void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature"))) TS_AnnouncementSignatures_set_node_signature(uint64_t this_ptr, int8_tArray val) {
31240 LDKAnnouncementSignatures this_ptr_conv;
31241 this_ptr_conv.inner = untag_ptr(this_ptr);
31242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31244 this_ptr_conv.is_owned = false;
31245 LDKSignature val_ref;
31246 CHECK(val->arr_len == 64);
31247 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31248 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
31251 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_signature"))) TS_AnnouncementSignatures_get_bitcoin_signature(uint64_t this_ptr) {
31252 LDKAnnouncementSignatures this_ptr_conv;
31253 this_ptr_conv.inner = untag_ptr(this_ptr);
31254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31256 this_ptr_conv.is_owned = false;
31257 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31258 memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
31262 void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signature"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint64_t this_ptr, int8_tArray val) {
31263 LDKAnnouncementSignatures this_ptr_conv;
31264 this_ptr_conv.inner = untag_ptr(this_ptr);
31265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31267 this_ptr_conv.is_owned = false;
31268 LDKSignature val_ref;
31269 CHECK(val->arr_len == 64);
31270 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31271 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
31274 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) {
31275 LDKThirtyTwoBytes channel_id_arg_ref;
31276 CHECK(channel_id_arg->arr_len == 32);
31277 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
31278 LDKSignature node_signature_arg_ref;
31279 CHECK(node_signature_arg->arr_len == 64);
31280 memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg);
31281 LDKSignature bitcoin_signature_arg_ref;
31282 CHECK(bitcoin_signature_arg->arr_len == 64);
31283 memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg);
31284 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
31285 uint64_t ret_ref = 0;
31286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31291 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
31292 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
31293 uint64_t ret_ref = 0;
31294 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31295 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31298 int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint64_t arg) {
31299 LDKAnnouncementSignatures arg_conv;
31300 arg_conv.inner = untag_ptr(arg);
31301 arg_conv.is_owned = ptr_is_owned(arg);
31302 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31303 arg_conv.is_owned = false;
31304 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
31308 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_AnnouncementSignatures_clone(uint64_t orig) {
31309 LDKAnnouncementSignatures orig_conv;
31310 orig_conv.inner = untag_ptr(orig);
31311 orig_conv.is_owned = ptr_is_owned(orig);
31312 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31313 orig_conv.is_owned = false;
31314 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
31315 uint64_t ret_ref = 0;
31316 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31317 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31321 void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
31322 if (!ptr_is_owned(this_ptr)) return;
31323 void* this_ptr_ptr = untag_ptr(this_ptr);
31324 CHECK_ACCESS(this_ptr_ptr);
31325 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
31326 FREE(untag_ptr(this_ptr));
31327 NetAddress_free(this_ptr_conv);
31330 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
31331 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31332 *ret_copy = NetAddress_clone(arg);
31333 uint64_t ret_ref = tag_ptr(ret_copy, true);
31336 int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint64_t arg) {
31337 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
31338 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
31342 uint64_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clone(uint64_t orig) {
31343 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
31344 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31345 *ret_copy = NetAddress_clone(orig_conv);
31346 uint64_t ret_ref = tag_ptr(ret_copy, true);
31350 uint64_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
31351 LDKFourBytes addr_ref;
31352 CHECK(addr->arr_len == 4);
31353 memcpy(addr_ref.data, addr->elems, 4); FREE(addr);
31354 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31355 *ret_copy = NetAddress_ipv4(addr_ref, port);
31356 uint64_t ret_ref = tag_ptr(ret_copy, true);
31360 uint64_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
31361 LDKSixteenBytes addr_ref;
31362 CHECK(addr->arr_len == 16);
31363 memcpy(addr_ref.data, addr->elems, 16); FREE(addr);
31364 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31365 *ret_copy = NetAddress_ipv6(addr_ref, port);
31366 uint64_t ret_ref = tag_ptr(ret_copy, true);
31370 uint64_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) {
31371 LDKTwelveBytes a_ref;
31372 CHECK(a->arr_len == 12);
31373 memcpy(a_ref.data, a->elems, 12); FREE(a);
31374 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31375 *ret_copy = NetAddress_onion_v2(a_ref);
31376 uint64_t ret_ref = tag_ptr(ret_copy, true);
31380 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) {
31381 LDKThirtyTwoBytes ed25519_pubkey_ref;
31382 CHECK(ed25519_pubkey->arr_len == 32);
31383 memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey);
31384 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31385 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
31386 uint64_t ret_ref = tag_ptr(ret_copy, true);
31390 uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_hostname(uint64_t hostname, int16_t port) {
31391 LDKHostname hostname_conv;
31392 hostname_conv.inner = untag_ptr(hostname);
31393 hostname_conv.is_owned = ptr_is_owned(hostname);
31394 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
31395 hostname_conv = Hostname_clone(&hostname_conv);
31396 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31397 *ret_copy = NetAddress_hostname(hostname_conv, port);
31398 uint64_t ret_ref = tag_ptr(ret_copy, true);
31402 int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
31403 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
31404 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
31405 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
31406 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
31407 CVec_u8Z_free(ret_var);
31411 uint64_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
31412 LDKu8slice ser_ref;
31413 ser_ref.datalen = ser->arr_len;
31414 ser_ref.data = ser->elems;
31415 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
31416 *ret_conv = NetAddress_read(ser_ref);
31418 return tag_ptr(ret_conv, true);
31421 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
31422 LDKUnsignedNodeAnnouncement this_obj_conv;
31423 this_obj_conv.inner = untag_ptr(this_obj);
31424 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31426 UnsignedNodeAnnouncement_free(this_obj_conv);
31429 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features"))) TS_UnsignedNodeAnnouncement_get_features(uint64_t this_ptr) {
31430 LDKUnsignedNodeAnnouncement this_ptr_conv;
31431 this_ptr_conv.inner = untag_ptr(this_ptr);
31432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31434 this_ptr_conv.is_owned = false;
31435 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
31436 uint64_t ret_ref = 0;
31437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31442 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_features"))) TS_UnsignedNodeAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
31443 LDKUnsignedNodeAnnouncement this_ptr_conv;
31444 this_ptr_conv.inner = untag_ptr(this_ptr);
31445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31447 this_ptr_conv.is_owned = false;
31448 LDKNodeFeatures val_conv;
31449 val_conv.inner = untag_ptr(val);
31450 val_conv.is_owned = ptr_is_owned(val);
31451 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31452 val_conv = NodeFeatures_clone(&val_conv);
31453 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
31456 int32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_timestamp"))) TS_UnsignedNodeAnnouncement_get_timestamp(uint64_t this_ptr) {
31457 LDKUnsignedNodeAnnouncement this_ptr_conv;
31458 this_ptr_conv.inner = untag_ptr(this_ptr);
31459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31461 this_ptr_conv.is_owned = false;
31462 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
31466 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_timestamp"))) TS_UnsignedNodeAnnouncement_set_timestamp(uint64_t this_ptr, int32_t val) {
31467 LDKUnsignedNodeAnnouncement this_ptr_conv;
31468 this_ptr_conv.inner = untag_ptr(this_ptr);
31469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31471 this_ptr_conv.is_owned = false;
31472 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
31475 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
31476 LDKUnsignedNodeAnnouncement this_ptr_conv;
31477 this_ptr_conv.inner = untag_ptr(this_ptr);
31478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31480 this_ptr_conv.is_owned = false;
31481 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31482 memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
31486 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
31487 LDKUnsignedNodeAnnouncement this_ptr_conv;
31488 this_ptr_conv.inner = untag_ptr(this_ptr);
31489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31491 this_ptr_conv.is_owned = false;
31492 LDKPublicKey val_ref;
31493 CHECK(val->arr_len == 33);
31494 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31495 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
31498 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
31499 LDKUnsignedNodeAnnouncement this_ptr_conv;
31500 this_ptr_conv.inner = untag_ptr(this_ptr);
31501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31503 this_ptr_conv.is_owned = false;
31504 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
31505 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3);
31509 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_UnsignedNodeAnnouncement_set_rgb(uint64_t this_ptr, int8_tArray val) {
31510 LDKUnsignedNodeAnnouncement this_ptr_conv;
31511 this_ptr_conv.inner = untag_ptr(this_ptr);
31512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31514 this_ptr_conv.is_owned = false;
31515 LDKThreeBytes val_ref;
31516 CHECK(val->arr_len == 3);
31517 memcpy(val_ref.data, val->elems, 3); FREE(val);
31518 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
31521 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) {
31522 LDKUnsignedNodeAnnouncement this_ptr_conv;
31523 this_ptr_conv.inner = untag_ptr(this_ptr);
31524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31526 this_ptr_conv.is_owned = false;
31527 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31528 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32);
31532 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) {
31533 LDKUnsignedNodeAnnouncement this_ptr_conv;
31534 this_ptr_conv.inner = untag_ptr(this_ptr);
31535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31537 this_ptr_conv.is_owned = false;
31538 LDKThirtyTwoBytes val_ref;
31539 CHECK(val->arr_len == 32);
31540 memcpy(val_ref.data, val->elems, 32); FREE(val);
31541 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
31544 uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) {
31545 LDKUnsignedNodeAnnouncement this_ptr_conv;
31546 this_ptr_conv.inner = untag_ptr(this_ptr);
31547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31549 this_ptr_conv.is_owned = false;
31550 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
31551 uint64_tArray ret_arr = NULL;
31552 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
31553 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
31554 for (size_t m = 0; m < ret_var.datalen; m++) {
31555 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
31556 *ret_conv_12_copy = ret_var.data[m];
31557 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
31558 ret_arr_ptr[m] = ret_conv_12_ref;
31561 FREE(ret_var.data);
31565 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) TS_UnsignedNodeAnnouncement_set_addresses(uint64_t this_ptr, uint64_tArray val) {
31566 LDKUnsignedNodeAnnouncement this_ptr_conv;
31567 this_ptr_conv.inner = untag_ptr(this_ptr);
31568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31570 this_ptr_conv.is_owned = false;
31571 LDKCVec_NetAddressZ val_constr;
31572 val_constr.datalen = val->arr_len;
31573 if (val_constr.datalen > 0)
31574 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
31576 val_constr.data = NULL;
31577 uint64_t* val_vals = val->elems;
31578 for (size_t m = 0; m < val_constr.datalen; m++) {
31579 uint64_t val_conv_12 = val_vals[m];
31580 void* val_conv_12_ptr = untag_ptr(val_conv_12);
31581 CHECK_ACCESS(val_conv_12_ptr);
31582 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
31583 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
31584 val_constr.data[m] = val_conv_12_conv;
31587 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
31590 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
31591 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
31592 uint64_t ret_ref = 0;
31593 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31594 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31597 int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint64_t arg) {
31598 LDKUnsignedNodeAnnouncement arg_conv;
31599 arg_conv.inner = untag_ptr(arg);
31600 arg_conv.is_owned = ptr_is_owned(arg);
31601 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31602 arg_conv.is_owned = false;
31603 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
31607 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_UnsignedNodeAnnouncement_clone(uint64_t orig) {
31608 LDKUnsignedNodeAnnouncement orig_conv;
31609 orig_conv.inner = untag_ptr(orig);
31610 orig_conv.is_owned = ptr_is_owned(orig);
31611 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31612 orig_conv.is_owned = false;
31613 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
31614 uint64_t ret_ref = 0;
31615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31620 void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
31621 LDKNodeAnnouncement this_obj_conv;
31622 this_obj_conv.inner = untag_ptr(this_obj);
31623 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31625 NodeAnnouncement_free(this_obj_conv);
31628 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) TS_NodeAnnouncement_get_signature(uint64_t this_ptr) {
31629 LDKNodeAnnouncement this_ptr_conv;
31630 this_ptr_conv.inner = untag_ptr(this_ptr);
31631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31633 this_ptr_conv.is_owned = false;
31634 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31635 memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
31639 void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeAnnouncement_set_signature(uint64_t this_ptr, int8_tArray val) {
31640 LDKNodeAnnouncement this_ptr_conv;
31641 this_ptr_conv.inner = untag_ptr(this_ptr);
31642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31644 this_ptr_conv.is_owned = false;
31645 LDKSignature val_ref;
31646 CHECK(val->arr_len == 64);
31647 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31648 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
31651 uint64_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_NodeAnnouncement_get_contents(uint64_t this_ptr) {
31652 LDKNodeAnnouncement this_ptr_conv;
31653 this_ptr_conv.inner = untag_ptr(this_ptr);
31654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31656 this_ptr_conv.is_owned = false;
31657 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
31658 uint64_t ret_ref = 0;
31659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31664 void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
31665 LDKNodeAnnouncement this_ptr_conv;
31666 this_ptr_conv.inner = untag_ptr(this_ptr);
31667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31669 this_ptr_conv.is_owned = false;
31670 LDKUnsignedNodeAnnouncement val_conv;
31671 val_conv.inner = untag_ptr(val);
31672 val_conv.is_owned = ptr_is_owned(val);
31673 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31674 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
31675 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
31678 uint64_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint64_t contents_arg) {
31679 LDKSignature signature_arg_ref;
31680 CHECK(signature_arg->arr_len == 64);
31681 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
31682 LDKUnsignedNodeAnnouncement contents_arg_conv;
31683 contents_arg_conv.inner = untag_ptr(contents_arg);
31684 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
31685 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
31686 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
31687 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
31688 uint64_t ret_ref = 0;
31689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31694 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
31695 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
31696 uint64_t ret_ref = 0;
31697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31701 int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint64_t arg) {
31702 LDKNodeAnnouncement arg_conv;
31703 arg_conv.inner = untag_ptr(arg);
31704 arg_conv.is_owned = ptr_is_owned(arg);
31705 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31706 arg_conv.is_owned = false;
31707 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
31711 uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnouncement_clone(uint64_t orig) {
31712 LDKNodeAnnouncement orig_conv;
31713 orig_conv.inner = untag_ptr(orig);
31714 orig_conv.is_owned = ptr_is_owned(orig);
31715 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31716 orig_conv.is_owned = false;
31717 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
31718 uint64_t ret_ref = 0;
31719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31724 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
31725 LDKUnsignedChannelAnnouncement this_obj_conv;
31726 this_obj_conv.inner = untag_ptr(this_obj);
31727 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31729 UnsignedChannelAnnouncement_free(this_obj_conv);
31732 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_features"))) TS_UnsignedChannelAnnouncement_get_features(uint64_t this_ptr) {
31733 LDKUnsignedChannelAnnouncement this_ptr_conv;
31734 this_ptr_conv.inner = untag_ptr(this_ptr);
31735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31737 this_ptr_conv.is_owned = false;
31738 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
31739 uint64_t ret_ref = 0;
31740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31745 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_features"))) TS_UnsignedChannelAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
31746 LDKUnsignedChannelAnnouncement this_ptr_conv;
31747 this_ptr_conv.inner = untag_ptr(this_ptr);
31748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31750 this_ptr_conv.is_owned = false;
31751 LDKChannelFeatures val_conv;
31752 val_conv.inner = untag_ptr(val);
31753 val_conv.is_owned = ptr_is_owned(val);
31754 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31755 val_conv = ChannelFeatures_clone(&val_conv);
31756 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
31759 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chain_hash"))) TS_UnsignedChannelAnnouncement_get_chain_hash(uint64_t this_ptr) {
31760 LDKUnsignedChannelAnnouncement this_ptr_conv;
31761 this_ptr_conv.inner = untag_ptr(this_ptr);
31762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31764 this_ptr_conv.is_owned = false;
31765 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31766 memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32);
31770 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash"))) TS_UnsignedChannelAnnouncement_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31771 LDKUnsignedChannelAnnouncement this_ptr_conv;
31772 this_ptr_conv.inner = untag_ptr(this_ptr);
31773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31775 this_ptr_conv.is_owned = false;
31776 LDKThirtyTwoBytes val_ref;
31777 CHECK(val->arr_len == 32);
31778 memcpy(val_ref.data, val->elems, 32); FREE(val);
31779 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
31782 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_short_channel_id"))) TS_UnsignedChannelAnnouncement_get_short_channel_id(uint64_t this_ptr) {
31783 LDKUnsignedChannelAnnouncement this_ptr_conv;
31784 this_ptr_conv.inner = untag_ptr(this_ptr);
31785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31787 this_ptr_conv.is_owned = false;
31788 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
31792 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_short_channel_id"))) TS_UnsignedChannelAnnouncement_set_short_channel_id(uint64_t this_ptr, int64_t val) {
31793 LDKUnsignedChannelAnnouncement this_ptr_conv;
31794 this_ptr_conv.inner = untag_ptr(this_ptr);
31795 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31797 this_ptr_conv.is_owned = false;
31798 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
31801 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
31802 LDKUnsignedChannelAnnouncement this_ptr_conv;
31803 this_ptr_conv.inner = untag_ptr(this_ptr);
31804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31806 this_ptr_conv.is_owned = false;
31807 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31808 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
31812 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
31813 LDKUnsignedChannelAnnouncement this_ptr_conv;
31814 this_ptr_conv.inner = untag_ptr(this_ptr);
31815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31817 this_ptr_conv.is_owned = false;
31818 LDKPublicKey val_ref;
31819 CHECK(val->arr_len == 33);
31820 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31821 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
31824 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
31825 LDKUnsignedChannelAnnouncement this_ptr_conv;
31826 this_ptr_conv.inner = untag_ptr(this_ptr);
31827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31829 this_ptr_conv.is_owned = false;
31830 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31831 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
31835 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
31836 LDKUnsignedChannelAnnouncement this_ptr_conv;
31837 this_ptr_conv.inner = untag_ptr(this_ptr);
31838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31840 this_ptr_conv.is_owned = false;
31841 LDKPublicKey val_ref;
31842 CHECK(val->arr_len == 33);
31843 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31844 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
31847 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
31848 LDKUnsignedChannelAnnouncement this_ptr_conv;
31849 this_ptr_conv.inner = untag_ptr(this_ptr);
31850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31852 this_ptr_conv.is_owned = false;
31853 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31854 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
31858 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
31859 LDKUnsignedChannelAnnouncement this_ptr_conv;
31860 this_ptr_conv.inner = untag_ptr(this_ptr);
31861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31863 this_ptr_conv.is_owned = false;
31864 LDKPublicKey val_ref;
31865 CHECK(val->arr_len == 33);
31866 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31867 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
31870 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
31871 LDKUnsignedChannelAnnouncement this_ptr_conv;
31872 this_ptr_conv.inner = untag_ptr(this_ptr);
31873 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31875 this_ptr_conv.is_owned = false;
31876 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
31877 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
31881 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
31882 LDKUnsignedChannelAnnouncement this_ptr_conv;
31883 this_ptr_conv.inner = untag_ptr(this_ptr);
31884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31886 this_ptr_conv.is_owned = false;
31887 LDKPublicKey val_ref;
31888 CHECK(val->arr_len == 33);
31889 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
31890 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
31893 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
31894 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
31895 uint64_t ret_ref = 0;
31896 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31897 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31900 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint64_t arg) {
31901 LDKUnsignedChannelAnnouncement arg_conv;
31902 arg_conv.inner = untag_ptr(arg);
31903 arg_conv.is_owned = ptr_is_owned(arg);
31904 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31905 arg_conv.is_owned = false;
31906 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
31910 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) TS_UnsignedChannelAnnouncement_clone(uint64_t orig) {
31911 LDKUnsignedChannelAnnouncement orig_conv;
31912 orig_conv.inner = untag_ptr(orig);
31913 orig_conv.is_owned = ptr_is_owned(orig);
31914 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31915 orig_conv.is_owned = false;
31916 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
31917 uint64_t ret_ref = 0;
31918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31923 void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
31924 LDKChannelAnnouncement this_obj_conv;
31925 this_obj_conv.inner = untag_ptr(this_obj);
31926 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31928 ChannelAnnouncement_free(this_obj_conv);
31931 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_1"))) TS_ChannelAnnouncement_get_node_signature_1(uint64_t this_ptr) {
31932 LDKChannelAnnouncement this_ptr_conv;
31933 this_ptr_conv.inner = untag_ptr(this_ptr);
31934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31936 this_ptr_conv.is_owned = false;
31937 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31938 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
31942 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1"))) TS_ChannelAnnouncement_set_node_signature_1(uint64_t this_ptr, int8_tArray val) {
31943 LDKChannelAnnouncement this_ptr_conv;
31944 this_ptr_conv.inner = untag_ptr(this_ptr);
31945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31947 this_ptr_conv.is_owned = false;
31948 LDKSignature val_ref;
31949 CHECK(val->arr_len == 64);
31950 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31951 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
31954 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_2"))) TS_ChannelAnnouncement_get_node_signature_2(uint64_t this_ptr) {
31955 LDKChannelAnnouncement this_ptr_conv;
31956 this_ptr_conv.inner = untag_ptr(this_ptr);
31957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31959 this_ptr_conv.is_owned = false;
31960 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31961 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
31965 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2"))) TS_ChannelAnnouncement_set_node_signature_2(uint64_t this_ptr, int8_tArray val) {
31966 LDKChannelAnnouncement 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 LDKSignature val_ref;
31972 CHECK(val->arr_len == 64);
31973 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31974 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
31977 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_1"))) TS_ChannelAnnouncement_get_bitcoin_signature_1(uint64_t this_ptr) {
31978 LDKChannelAnnouncement this_ptr_conv;
31979 this_ptr_conv.inner = untag_ptr(this_ptr);
31980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31982 this_ptr_conv.is_owned = false;
31983 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31984 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
31988 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint64_t this_ptr, int8_tArray val) {
31989 LDKChannelAnnouncement 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 LDKSignature val_ref;
31995 CHECK(val->arr_len == 64);
31996 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31997 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
32000 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_2"))) TS_ChannelAnnouncement_get_bitcoin_signature_2(uint64_t this_ptr) {
32001 LDKChannelAnnouncement this_ptr_conv;
32002 this_ptr_conv.inner = untag_ptr(this_ptr);
32003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32005 this_ptr_conv.is_owned = false;
32006 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32007 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
32011 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint64_t this_ptr, int8_tArray val) {
32012 LDKChannelAnnouncement this_ptr_conv;
32013 this_ptr_conv.inner = untag_ptr(this_ptr);
32014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32016 this_ptr_conv.is_owned = false;
32017 LDKSignature val_ref;
32018 CHECK(val->arr_len == 64);
32019 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32020 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
32023 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS_ChannelAnnouncement_get_contents(uint64_t this_ptr) {
32024 LDKChannelAnnouncement this_ptr_conv;
32025 this_ptr_conv.inner = untag_ptr(this_ptr);
32026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32028 this_ptr_conv.is_owned = false;
32029 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
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);
32036 void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_ChannelAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
32037 LDKChannelAnnouncement this_ptr_conv;
32038 this_ptr_conv.inner = untag_ptr(this_ptr);
32039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32041 this_ptr_conv.is_owned = false;
32042 LDKUnsignedChannelAnnouncement val_conv;
32043 val_conv.inner = untag_ptr(val);
32044 val_conv.is_owned = ptr_is_owned(val);
32045 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32046 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
32047 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
32050 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) {
32051 LDKSignature node_signature_1_arg_ref;
32052 CHECK(node_signature_1_arg->arr_len == 64);
32053 memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg);
32054 LDKSignature node_signature_2_arg_ref;
32055 CHECK(node_signature_2_arg->arr_len == 64);
32056 memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg);
32057 LDKSignature bitcoin_signature_1_arg_ref;
32058 CHECK(bitcoin_signature_1_arg->arr_len == 64);
32059 memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg);
32060 LDKSignature bitcoin_signature_2_arg_ref;
32061 CHECK(bitcoin_signature_2_arg->arr_len == 64);
32062 memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg);
32063 LDKUnsignedChannelAnnouncement contents_arg_conv;
32064 contents_arg_conv.inner = untag_ptr(contents_arg);
32065 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
32066 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
32067 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
32068 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);
32069 uint64_t ret_ref = 0;
32070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32075 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
32076 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
32077 uint64_t ret_ref = 0;
32078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32082 int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint64_t arg) {
32083 LDKChannelAnnouncement arg_conv;
32084 arg_conv.inner = untag_ptr(arg);
32085 arg_conv.is_owned = ptr_is_owned(arg);
32086 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32087 arg_conv.is_owned = false;
32088 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
32092 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_ChannelAnnouncement_clone(uint64_t orig) {
32093 LDKChannelAnnouncement orig_conv;
32094 orig_conv.inner = untag_ptr(orig);
32095 orig_conv.is_owned = ptr_is_owned(orig);
32096 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32097 orig_conv.is_owned = false;
32098 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
32099 uint64_t ret_ref = 0;
32100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32105 void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
32106 LDKUnsignedChannelUpdate this_obj_conv;
32107 this_obj_conv.inner = untag_ptr(this_obj);
32108 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32110 UnsignedChannelUpdate_free(this_obj_conv);
32113 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) {
32114 LDKUnsignedChannelUpdate this_ptr_conv;
32115 this_ptr_conv.inner = untag_ptr(this_ptr);
32116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32118 this_ptr_conv.is_owned = false;
32119 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32120 memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32);
32124 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32125 LDKUnsignedChannelUpdate this_ptr_conv;
32126 this_ptr_conv.inner = untag_ptr(this_ptr);
32127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32129 this_ptr_conv.is_owned = false;
32130 LDKThirtyTwoBytes val_ref;
32131 CHECK(val->arr_len == 32);
32132 memcpy(val_ref.data, val->elems, 32); FREE(val);
32133 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
32136 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) {
32137 LDKUnsignedChannelUpdate this_ptr_conv;
32138 this_ptr_conv.inner = untag_ptr(this_ptr);
32139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32141 this_ptr_conv.is_owned = false;
32142 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
32146 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) {
32147 LDKUnsignedChannelUpdate this_ptr_conv;
32148 this_ptr_conv.inner = untag_ptr(this_ptr);
32149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32151 this_ptr_conv.is_owned = false;
32152 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
32155 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) {
32156 LDKUnsignedChannelUpdate this_ptr_conv;
32157 this_ptr_conv.inner = untag_ptr(this_ptr);
32158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32160 this_ptr_conv.is_owned = false;
32161 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
32165 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) {
32166 LDKUnsignedChannelUpdate this_ptr_conv;
32167 this_ptr_conv.inner = untag_ptr(this_ptr);
32168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32170 this_ptr_conv.is_owned = false;
32171 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
32174 int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) {
32175 LDKUnsignedChannelUpdate this_ptr_conv;
32176 this_ptr_conv.inner = untag_ptr(this_ptr);
32177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32179 this_ptr_conv.is_owned = false;
32180 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
32184 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) {
32185 LDKUnsignedChannelUpdate this_ptr_conv;
32186 this_ptr_conv.inner = untag_ptr(this_ptr);
32187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32189 this_ptr_conv.is_owned = false;
32190 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
32193 int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) {
32194 LDKUnsignedChannelUpdate this_ptr_conv;
32195 this_ptr_conv.inner = untag_ptr(this_ptr);
32196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32198 this_ptr_conv.is_owned = false;
32199 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
32203 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
32204 LDKUnsignedChannelUpdate this_ptr_conv;
32205 this_ptr_conv.inner = untag_ptr(this_ptr);
32206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32208 this_ptr_conv.is_owned = false;
32209 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
32212 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) {
32213 LDKUnsignedChannelUpdate this_ptr_conv;
32214 this_ptr_conv.inner = untag_ptr(this_ptr);
32215 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32217 this_ptr_conv.is_owned = false;
32218 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
32222 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
32223 LDKUnsignedChannelUpdate this_ptr_conv;
32224 this_ptr_conv.inner = untag_ptr(this_ptr);
32225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32227 this_ptr_conv.is_owned = false;
32228 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
32231 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) {
32232 LDKUnsignedChannelUpdate this_ptr_conv;
32233 this_ptr_conv.inner = untag_ptr(this_ptr);
32234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32236 this_ptr_conv.is_owned = false;
32237 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
32241 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
32242 LDKUnsignedChannelUpdate this_ptr_conv;
32243 this_ptr_conv.inner = untag_ptr(this_ptr);
32244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32246 this_ptr_conv.is_owned = false;
32247 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
32250 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) {
32251 LDKUnsignedChannelUpdate this_ptr_conv;
32252 this_ptr_conv.inner = untag_ptr(this_ptr);
32253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32255 this_ptr_conv.is_owned = false;
32256 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
32260 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
32261 LDKUnsignedChannelUpdate this_ptr_conv;
32262 this_ptr_conv.inner = untag_ptr(this_ptr);
32263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32265 this_ptr_conv.is_owned = false;
32266 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
32269 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) {
32270 LDKUnsignedChannelUpdate this_ptr_conv;
32271 this_ptr_conv.inner = untag_ptr(this_ptr);
32272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32274 this_ptr_conv.is_owned = false;
32275 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
32279 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
32280 LDKUnsignedChannelUpdate this_ptr_conv;
32281 this_ptr_conv.inner = untag_ptr(this_ptr);
32282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32284 this_ptr_conv.is_owned = false;
32285 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
32288 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) {
32289 LDKUnsignedChannelUpdate this_ptr_conv;
32290 this_ptr_conv.inner = untag_ptr(this_ptr);
32291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32293 this_ptr_conv.is_owned = false;
32294 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
32295 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32296 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32297 CVec_u8Z_free(ret_var);
32301 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) {
32302 LDKUnsignedChannelUpdate this_ptr_conv;
32303 this_ptr_conv.inner = untag_ptr(this_ptr);
32304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32306 this_ptr_conv.is_owned = false;
32307 LDKCVec_u8Z val_ref;
32308 val_ref.datalen = val->arr_len;
32309 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
32310 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
32311 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
32314 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) {
32315 LDKThirtyTwoBytes chain_hash_arg_ref;
32316 CHECK(chain_hash_arg->arr_len == 32);
32317 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
32318 LDKCVec_u8Z excess_data_arg_ref;
32319 excess_data_arg_ref.datalen = excess_data_arg->arr_len;
32320 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
32321 memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg);
32322 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);
32323 uint64_t ret_ref = 0;
32324 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32325 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32329 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
32330 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
32331 uint64_t ret_ref = 0;
32332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32336 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) {
32337 LDKUnsignedChannelUpdate arg_conv;
32338 arg_conv.inner = untag_ptr(arg);
32339 arg_conv.is_owned = ptr_is_owned(arg);
32340 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32341 arg_conv.is_owned = false;
32342 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
32346 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) {
32347 LDKUnsignedChannelUpdate orig_conv;
32348 orig_conv.inner = untag_ptr(orig);
32349 orig_conv.is_owned = ptr_is_owned(orig);
32350 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32351 orig_conv.is_owned = false;
32352 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
32353 uint64_t ret_ref = 0;
32354 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32355 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32359 void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
32360 LDKChannelUpdate this_obj_conv;
32361 this_obj_conv.inner = untag_ptr(this_obj);
32362 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32364 ChannelUpdate_free(this_obj_conv);
32367 int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) {
32368 LDKChannelUpdate this_ptr_conv;
32369 this_ptr_conv.inner = untag_ptr(this_ptr);
32370 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32372 this_ptr_conv.is_owned = false;
32373 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
32374 memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
32378 void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) {
32379 LDKChannelUpdate this_ptr_conv;
32380 this_ptr_conv.inner = untag_ptr(this_ptr);
32381 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32383 this_ptr_conv.is_owned = false;
32384 LDKSignature val_ref;
32385 CHECK(val->arr_len == 64);
32386 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
32387 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
32390 uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) {
32391 LDKChannelUpdate this_ptr_conv;
32392 this_ptr_conv.inner = untag_ptr(this_ptr);
32393 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32395 this_ptr_conv.is_owned = false;
32396 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
32397 uint64_t ret_ref = 0;
32398 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32399 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32403 void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) {
32404 LDKChannelUpdate this_ptr_conv;
32405 this_ptr_conv.inner = untag_ptr(this_ptr);
32406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32408 this_ptr_conv.is_owned = false;
32409 LDKUnsignedChannelUpdate val_conv;
32410 val_conv.inner = untag_ptr(val);
32411 val_conv.is_owned = ptr_is_owned(val);
32412 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32413 val_conv = UnsignedChannelUpdate_clone(&val_conv);
32414 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
32417 uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) {
32418 LDKSignature signature_arg_ref;
32419 CHECK(signature_arg->arr_len == 64);
32420 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
32421 LDKUnsignedChannelUpdate contents_arg_conv;
32422 contents_arg_conv.inner = untag_ptr(contents_arg);
32423 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
32424 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
32425 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
32426 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
32427 uint64_t ret_ref = 0;
32428 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32429 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32433 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
32434 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
32435 uint64_t ret_ref = 0;
32436 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32437 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32440 int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) {
32441 LDKChannelUpdate arg_conv;
32442 arg_conv.inner = untag_ptr(arg);
32443 arg_conv.is_owned = ptr_is_owned(arg);
32444 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32445 arg_conv.is_owned = false;
32446 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
32450 uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) {
32451 LDKChannelUpdate orig_conv;
32452 orig_conv.inner = untag_ptr(orig);
32453 orig_conv.is_owned = ptr_is_owned(orig);
32454 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32455 orig_conv.is_owned = false;
32456 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
32457 uint64_t ret_ref = 0;
32458 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32459 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32463 void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
32464 LDKQueryChannelRange this_obj_conv;
32465 this_obj_conv.inner = untag_ptr(this_obj);
32466 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32468 QueryChannelRange_free(this_obj_conv);
32471 int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) {
32472 LDKQueryChannelRange this_ptr_conv;
32473 this_ptr_conv.inner = untag_ptr(this_ptr);
32474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32476 this_ptr_conv.is_owned = false;
32477 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32478 memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32);
32482 void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32483 LDKQueryChannelRange this_ptr_conv;
32484 this_ptr_conv.inner = untag_ptr(this_ptr);
32485 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32487 this_ptr_conv.is_owned = false;
32488 LDKThirtyTwoBytes val_ref;
32489 CHECK(val->arr_len == 32);
32490 memcpy(val_ref.data, val->elems, 32); FREE(val);
32491 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
32494 int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) {
32495 LDKQueryChannelRange this_ptr_conv;
32496 this_ptr_conv.inner = untag_ptr(this_ptr);
32497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32499 this_ptr_conv.is_owned = false;
32500 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
32504 void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
32505 LDKQueryChannelRange this_ptr_conv;
32506 this_ptr_conv.inner = untag_ptr(this_ptr);
32507 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32508 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32509 this_ptr_conv.is_owned = false;
32510 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
32513 int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) {
32514 LDKQueryChannelRange this_ptr_conv;
32515 this_ptr_conv.inner = untag_ptr(this_ptr);
32516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32518 this_ptr_conv.is_owned = false;
32519 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
32523 void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
32524 LDKQueryChannelRange this_ptr_conv;
32525 this_ptr_conv.inner = untag_ptr(this_ptr);
32526 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32528 this_ptr_conv.is_owned = false;
32529 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
32532 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) {
32533 LDKThirtyTwoBytes chain_hash_arg_ref;
32534 CHECK(chain_hash_arg->arr_len == 32);
32535 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
32536 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
32537 uint64_t ret_ref = 0;
32538 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32539 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32543 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
32544 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
32545 uint64_t ret_ref = 0;
32546 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32547 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32550 int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) {
32551 LDKQueryChannelRange arg_conv;
32552 arg_conv.inner = untag_ptr(arg);
32553 arg_conv.is_owned = ptr_is_owned(arg);
32554 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32555 arg_conv.is_owned = false;
32556 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
32560 uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) {
32561 LDKQueryChannelRange orig_conv;
32562 orig_conv.inner = untag_ptr(orig);
32563 orig_conv.is_owned = ptr_is_owned(orig);
32564 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32565 orig_conv.is_owned = false;
32566 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
32567 uint64_t ret_ref = 0;
32568 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32569 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32573 void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
32574 LDKReplyChannelRange this_obj_conv;
32575 this_obj_conv.inner = untag_ptr(this_obj);
32576 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32578 ReplyChannelRange_free(this_obj_conv);
32581 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) {
32582 LDKReplyChannelRange 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32588 memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32);
32592 void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32593 LDKReplyChannelRange this_ptr_conv;
32594 this_ptr_conv.inner = untag_ptr(this_ptr);
32595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32597 this_ptr_conv.is_owned = false;
32598 LDKThirtyTwoBytes val_ref;
32599 CHECK(val->arr_len == 32);
32600 memcpy(val_ref.data, val->elems, 32); FREE(val);
32601 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
32604 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) {
32605 LDKReplyChannelRange this_ptr_conv;
32606 this_ptr_conv.inner = untag_ptr(this_ptr);
32607 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32609 this_ptr_conv.is_owned = false;
32610 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
32614 void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
32615 LDKReplyChannelRange this_ptr_conv;
32616 this_ptr_conv.inner = untag_ptr(this_ptr);
32617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32619 this_ptr_conv.is_owned = false;
32620 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
32623 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) {
32624 LDKReplyChannelRange this_ptr_conv;
32625 this_ptr_conv.inner = untag_ptr(this_ptr);
32626 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32628 this_ptr_conv.is_owned = false;
32629 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
32633 void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
32634 LDKReplyChannelRange this_ptr_conv;
32635 this_ptr_conv.inner = untag_ptr(this_ptr);
32636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32638 this_ptr_conv.is_owned = false;
32639 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
32642 jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) {
32643 LDKReplyChannelRange this_ptr_conv;
32644 this_ptr_conv.inner = untag_ptr(this_ptr);
32645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32647 this_ptr_conv.is_owned = false;
32648 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
32652 void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) {
32653 LDKReplyChannelRange this_ptr_conv;
32654 this_ptr_conv.inner = untag_ptr(this_ptr);
32655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32657 this_ptr_conv.is_owned = false;
32658 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
32661 int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) {
32662 LDKReplyChannelRange this_ptr_conv;
32663 this_ptr_conv.inner = untag_ptr(this_ptr);
32664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32666 this_ptr_conv.is_owned = false;
32667 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
32668 int64_tArray ret_arr = NULL;
32669 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
32670 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
32671 for (size_t i = 0; i < ret_var.datalen; i++) {
32672 int64_t ret_conv_8_conv = ret_var.data[i];
32673 ret_arr_ptr[i] = ret_conv_8_conv;
32676 FREE(ret_var.data);
32680 void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
32681 LDKReplyChannelRange this_ptr_conv;
32682 this_ptr_conv.inner = untag_ptr(this_ptr);
32683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32685 this_ptr_conv.is_owned = false;
32686 LDKCVec_u64Z val_constr;
32687 val_constr.datalen = val->arr_len;
32688 if (val_constr.datalen > 0)
32689 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
32691 val_constr.data = NULL;
32692 int64_t* val_vals = val->elems;
32693 for (size_t i = 0; i < val_constr.datalen; i++) {
32694 int64_t val_conv_8 = val_vals[i];
32695 val_constr.data[i] = val_conv_8;
32698 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
32701 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) {
32702 LDKThirtyTwoBytes chain_hash_arg_ref;
32703 CHECK(chain_hash_arg->arr_len == 32);
32704 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
32705 LDKCVec_u64Z short_channel_ids_arg_constr;
32706 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
32707 if (short_channel_ids_arg_constr.datalen > 0)
32708 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
32710 short_channel_ids_arg_constr.data = NULL;
32711 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
32712 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
32713 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
32714 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
32716 FREE(short_channel_ids_arg);
32717 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
32718 uint64_t ret_ref = 0;
32719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32724 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
32725 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
32726 uint64_t ret_ref = 0;
32727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32731 int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) {
32732 LDKReplyChannelRange arg_conv;
32733 arg_conv.inner = untag_ptr(arg);
32734 arg_conv.is_owned = ptr_is_owned(arg);
32735 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32736 arg_conv.is_owned = false;
32737 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
32741 uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) {
32742 LDKReplyChannelRange orig_conv;
32743 orig_conv.inner = untag_ptr(orig);
32744 orig_conv.is_owned = ptr_is_owned(orig);
32745 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32746 orig_conv.is_owned = false;
32747 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
32748 uint64_t ret_ref = 0;
32749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32754 void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
32755 LDKQueryShortChannelIds this_obj_conv;
32756 this_obj_conv.inner = untag_ptr(this_obj);
32757 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32759 QueryShortChannelIds_free(this_obj_conv);
32762 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) {
32763 LDKQueryShortChannelIds this_ptr_conv;
32764 this_ptr_conv.inner = untag_ptr(this_ptr);
32765 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32766 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32767 this_ptr_conv.is_owned = false;
32768 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32769 memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32);
32773 void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32774 LDKQueryShortChannelIds this_ptr_conv;
32775 this_ptr_conv.inner = untag_ptr(this_ptr);
32776 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32778 this_ptr_conv.is_owned = false;
32779 LDKThirtyTwoBytes val_ref;
32780 CHECK(val->arr_len == 32);
32781 memcpy(val_ref.data, val->elems, 32); FREE(val);
32782 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
32785 int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) {
32786 LDKQueryShortChannelIds this_ptr_conv;
32787 this_ptr_conv.inner = untag_ptr(this_ptr);
32788 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32790 this_ptr_conv.is_owned = false;
32791 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
32792 int64_tArray ret_arr = NULL;
32793 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
32794 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
32795 for (size_t i = 0; i < ret_var.datalen; i++) {
32796 int64_t ret_conv_8_conv = ret_var.data[i];
32797 ret_arr_ptr[i] = ret_conv_8_conv;
32800 FREE(ret_var.data);
32804 void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
32805 LDKQueryShortChannelIds 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 LDKCVec_u64Z val_constr;
32811 val_constr.datalen = val->arr_len;
32812 if (val_constr.datalen > 0)
32813 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
32815 val_constr.data = NULL;
32816 int64_t* val_vals = val->elems;
32817 for (size_t i = 0; i < val_constr.datalen; i++) {
32818 int64_t val_conv_8 = val_vals[i];
32819 val_constr.data[i] = val_conv_8;
32822 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
32825 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
32826 LDKThirtyTwoBytes chain_hash_arg_ref;
32827 CHECK(chain_hash_arg->arr_len == 32);
32828 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
32829 LDKCVec_u64Z short_channel_ids_arg_constr;
32830 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
32831 if (short_channel_ids_arg_constr.datalen > 0)
32832 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
32834 short_channel_ids_arg_constr.data = NULL;
32835 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
32836 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
32837 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
32838 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
32840 FREE(short_channel_ids_arg);
32841 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
32842 uint64_t ret_ref = 0;
32843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32848 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
32849 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
32850 uint64_t ret_ref = 0;
32851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32855 int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) {
32856 LDKQueryShortChannelIds arg_conv;
32857 arg_conv.inner = untag_ptr(arg);
32858 arg_conv.is_owned = ptr_is_owned(arg);
32859 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32860 arg_conv.is_owned = false;
32861 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
32865 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) {
32866 LDKQueryShortChannelIds orig_conv;
32867 orig_conv.inner = untag_ptr(orig);
32868 orig_conv.is_owned = ptr_is_owned(orig);
32869 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32870 orig_conv.is_owned = false;
32871 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
32872 uint64_t ret_ref = 0;
32873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32878 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
32879 LDKReplyShortChannelIdsEnd this_obj_conv;
32880 this_obj_conv.inner = untag_ptr(this_obj);
32881 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32883 ReplyShortChannelIdsEnd_free(this_obj_conv);
32886 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) {
32887 LDKReplyShortChannelIdsEnd this_ptr_conv;
32888 this_ptr_conv.inner = untag_ptr(this_ptr);
32889 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32891 this_ptr_conv.is_owned = false;
32892 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32893 memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32);
32897 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32898 LDKReplyShortChannelIdsEnd this_ptr_conv;
32899 this_ptr_conv.inner = untag_ptr(this_ptr);
32900 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32902 this_ptr_conv.is_owned = false;
32903 LDKThirtyTwoBytes val_ref;
32904 CHECK(val->arr_len == 32);
32905 memcpy(val_ref.data, val->elems, 32); FREE(val);
32906 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
32909 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) {
32910 LDKReplyShortChannelIdsEnd this_ptr_conv;
32911 this_ptr_conv.inner = untag_ptr(this_ptr);
32912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32914 this_ptr_conv.is_owned = false;
32915 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
32919 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) {
32920 LDKReplyShortChannelIdsEnd this_ptr_conv;
32921 this_ptr_conv.inner = untag_ptr(this_ptr);
32922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32924 this_ptr_conv.is_owned = false;
32925 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
32928 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) {
32929 LDKThirtyTwoBytes chain_hash_arg_ref;
32930 CHECK(chain_hash_arg->arr_len == 32);
32931 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
32932 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
32933 uint64_t ret_ref = 0;
32934 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32935 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32939 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
32940 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
32941 uint64_t ret_ref = 0;
32942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32946 int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) {
32947 LDKReplyShortChannelIdsEnd arg_conv;
32948 arg_conv.inner = untag_ptr(arg);
32949 arg_conv.is_owned = ptr_is_owned(arg);
32950 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32951 arg_conv.is_owned = false;
32952 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
32956 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) {
32957 LDKReplyShortChannelIdsEnd orig_conv;
32958 orig_conv.inner = untag_ptr(orig);
32959 orig_conv.is_owned = ptr_is_owned(orig);
32960 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32961 orig_conv.is_owned = false;
32962 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
32963 uint64_t ret_ref = 0;
32964 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32965 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32969 void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
32970 LDKGossipTimestampFilter this_obj_conv;
32971 this_obj_conv.inner = untag_ptr(this_obj);
32972 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32974 GossipTimestampFilter_free(this_obj_conv);
32977 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) {
32978 LDKGossipTimestampFilter this_ptr_conv;
32979 this_ptr_conv.inner = untag_ptr(this_ptr);
32980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32982 this_ptr_conv.is_owned = false;
32983 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
32984 memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32);
32988 void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
32989 LDKGossipTimestampFilter this_ptr_conv;
32990 this_ptr_conv.inner = untag_ptr(this_ptr);
32991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32993 this_ptr_conv.is_owned = false;
32994 LDKThirtyTwoBytes val_ref;
32995 CHECK(val->arr_len == 32);
32996 memcpy(val_ref.data, val->elems, 32); FREE(val);
32997 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
33000 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) {
33001 LDKGossipTimestampFilter this_ptr_conv;
33002 this_ptr_conv.inner = untag_ptr(this_ptr);
33003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33005 this_ptr_conv.is_owned = false;
33006 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
33010 void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) {
33011 LDKGossipTimestampFilter this_ptr_conv;
33012 this_ptr_conv.inner = untag_ptr(this_ptr);
33013 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33015 this_ptr_conv.is_owned = false;
33016 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
33019 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) {
33020 LDKGossipTimestampFilter this_ptr_conv;
33021 this_ptr_conv.inner = untag_ptr(this_ptr);
33022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33024 this_ptr_conv.is_owned = false;
33025 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
33029 void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) {
33030 LDKGossipTimestampFilter this_ptr_conv;
33031 this_ptr_conv.inner = untag_ptr(this_ptr);
33032 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33034 this_ptr_conv.is_owned = false;
33035 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
33038 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) {
33039 LDKThirtyTwoBytes chain_hash_arg_ref;
33040 CHECK(chain_hash_arg->arr_len == 32);
33041 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
33042 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
33043 uint64_t ret_ref = 0;
33044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33049 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
33050 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
33051 uint64_t ret_ref = 0;
33052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33056 int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) {
33057 LDKGossipTimestampFilter arg_conv;
33058 arg_conv.inner = untag_ptr(arg);
33059 arg_conv.is_owned = ptr_is_owned(arg);
33060 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33061 arg_conv.is_owned = false;
33062 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
33066 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) {
33067 LDKGossipTimestampFilter orig_conv;
33068 orig_conv.inner = untag_ptr(orig);
33069 orig_conv.is_owned = ptr_is_owned(orig);
33070 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33071 orig_conv.is_owned = false;
33072 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
33073 uint64_t ret_ref = 0;
33074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33079 void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
33080 if (!ptr_is_owned(this_ptr)) return;
33081 void* this_ptr_ptr = untag_ptr(this_ptr);
33082 CHECK_ACCESS(this_ptr_ptr);
33083 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
33084 FREE(untag_ptr(this_ptr));
33085 ErrorAction_free(this_ptr_conv);
33088 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
33089 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33090 *ret_copy = ErrorAction_clone(arg);
33091 uint64_t ret_ref = tag_ptr(ret_copy, true);
33094 int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) {
33095 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
33096 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
33100 uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) {
33101 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
33102 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33103 *ret_copy = ErrorAction_clone(orig_conv);
33104 uint64_t ret_ref = tag_ptr(ret_copy, true);
33108 uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) {
33109 LDKErrorMessage msg_conv;
33110 msg_conv.inner = untag_ptr(msg);
33111 msg_conv.is_owned = ptr_is_owned(msg);
33112 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
33113 msg_conv = ErrorMessage_clone(&msg_conv);
33114 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33115 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
33116 uint64_t ret_ref = tag_ptr(ret_copy, true);
33120 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() {
33121 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33122 *ret_copy = ErrorAction_ignore_error();
33123 uint64_t ret_ref = tag_ptr(ret_copy, true);
33127 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
33128 LDKLevel a_conv = LDKLevel_from_js(a);
33129 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33130 *ret_copy = ErrorAction_ignore_and_log(a_conv);
33131 uint64_t ret_ref = tag_ptr(ret_copy, true);
33135 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() {
33136 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33137 *ret_copy = ErrorAction_ignore_duplicate_gossip();
33138 uint64_t ret_ref = tag_ptr(ret_copy, true);
33142 uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) {
33143 LDKErrorMessage msg_conv;
33144 msg_conv.inner = untag_ptr(msg);
33145 msg_conv.is_owned = ptr_is_owned(msg);
33146 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
33147 msg_conv = ErrorMessage_clone(&msg_conv);
33148 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33149 *ret_copy = ErrorAction_send_error_message(msg_conv);
33150 uint64_t ret_ref = tag_ptr(ret_copy, true);
33154 uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) {
33155 LDKWarningMessage msg_conv;
33156 msg_conv.inner = untag_ptr(msg);
33157 msg_conv.is_owned = ptr_is_owned(msg);
33158 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
33159 msg_conv = WarningMessage_clone(&msg_conv);
33160 LDKLevel log_level_conv = LDKLevel_from_js(log_level);
33161 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33162 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
33163 uint64_t ret_ref = tag_ptr(ret_copy, true);
33167 void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) {
33168 LDKLightningError this_obj_conv;
33169 this_obj_conv.inner = untag_ptr(this_obj);
33170 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33172 LightningError_free(this_obj_conv);
33175 jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) {
33176 LDKLightningError this_ptr_conv;
33177 this_ptr_conv.inner = untag_ptr(this_ptr);
33178 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33180 this_ptr_conv.is_owned = false;
33181 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
33182 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
33187 void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) {
33188 LDKLightningError this_ptr_conv;
33189 this_ptr_conv.inner = untag_ptr(this_ptr);
33190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33192 this_ptr_conv.is_owned = false;
33193 LDKStr val_conv = str_ref_to_owned_c(val);
33194 LightningError_set_err(&this_ptr_conv, val_conv);
33197 uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) {
33198 LDKLightningError this_ptr_conv;
33199 this_ptr_conv.inner = untag_ptr(this_ptr);
33200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33202 this_ptr_conv.is_owned = false;
33203 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
33204 *ret_copy = LightningError_get_action(&this_ptr_conv);
33205 uint64_t ret_ref = tag_ptr(ret_copy, true);
33209 void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) {
33210 LDKLightningError this_ptr_conv;
33211 this_ptr_conv.inner = untag_ptr(this_ptr);
33212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33214 this_ptr_conv.is_owned = false;
33215 void* val_ptr = untag_ptr(val);
33216 CHECK_ACCESS(val_ptr);
33217 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
33218 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
33219 LightningError_set_action(&this_ptr_conv, val_conv);
33222 uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) {
33223 LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
33224 void* action_arg_ptr = untag_ptr(action_arg);
33225 CHECK_ACCESS(action_arg_ptr);
33226 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
33227 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
33228 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
33229 uint64_t ret_ref = 0;
33230 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33231 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33235 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
33236 LDKLightningError ret_var = LightningError_clone(arg);
33237 uint64_t ret_ref = 0;
33238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33242 int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) {
33243 LDKLightningError arg_conv;
33244 arg_conv.inner = untag_ptr(arg);
33245 arg_conv.is_owned = ptr_is_owned(arg);
33246 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33247 arg_conv.is_owned = false;
33248 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
33252 uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) {
33253 LDKLightningError orig_conv;
33254 orig_conv.inner = untag_ptr(orig);
33255 orig_conv.is_owned = ptr_is_owned(orig);
33256 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33257 orig_conv.is_owned = false;
33258 LDKLightningError ret_var = LightningError_clone(&orig_conv);
33259 uint64_t ret_ref = 0;
33260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33265 void __attribute__((export_name("TS_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) {
33266 LDKCommitmentUpdate this_obj_conv;
33267 this_obj_conv.inner = untag_ptr(this_obj);
33268 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33270 CommitmentUpdate_free(this_obj_conv);
33273 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) {
33274 LDKCommitmentUpdate this_ptr_conv;
33275 this_ptr_conv.inner = untag_ptr(this_ptr);
33276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33278 this_ptr_conv.is_owned = false;
33279 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
33280 uint64_tArray ret_arr = NULL;
33281 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
33282 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
33283 for (size_t p = 0; p < ret_var.datalen; p++) {
33284 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
33285 uint64_t ret_conv_15_ref = 0;
33286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
33287 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
33288 ret_arr_ptr[p] = ret_conv_15_ref;
33291 FREE(ret_var.data);
33295 void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) {
33296 LDKCommitmentUpdate this_ptr_conv;
33297 this_ptr_conv.inner = untag_ptr(this_ptr);
33298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33300 this_ptr_conv.is_owned = false;
33301 LDKCVec_UpdateAddHTLCZ val_constr;
33302 val_constr.datalen = val->arr_len;
33303 if (val_constr.datalen > 0)
33304 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
33306 val_constr.data = NULL;
33307 uint64_t* val_vals = val->elems;
33308 for (size_t p = 0; p < val_constr.datalen; p++) {
33309 uint64_t val_conv_15 = val_vals[p];
33310 LDKUpdateAddHTLC val_conv_15_conv;
33311 val_conv_15_conv.inner = untag_ptr(val_conv_15);
33312 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
33313 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
33314 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
33315 val_constr.data[p] = val_conv_15_conv;
33318 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
33321 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) {
33322 LDKCommitmentUpdate this_ptr_conv;
33323 this_ptr_conv.inner = untag_ptr(this_ptr);
33324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33326 this_ptr_conv.is_owned = false;
33327 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
33328 uint64_tArray ret_arr = NULL;
33329 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
33330 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
33331 for (size_t t = 0; t < ret_var.datalen; t++) {
33332 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
33333 uint64_t ret_conv_19_ref = 0;
33334 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
33335 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
33336 ret_arr_ptr[t] = ret_conv_19_ref;
33339 FREE(ret_var.data);
33343 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) {
33344 LDKCommitmentUpdate 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 LDKCVec_UpdateFulfillHTLCZ val_constr;
33350 val_constr.datalen = val->arr_len;
33351 if (val_constr.datalen > 0)
33352 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
33354 val_constr.data = NULL;
33355 uint64_t* val_vals = val->elems;
33356 for (size_t t = 0; t < val_constr.datalen; t++) {
33357 uint64_t val_conv_19 = val_vals[t];
33358 LDKUpdateFulfillHTLC val_conv_19_conv;
33359 val_conv_19_conv.inner = untag_ptr(val_conv_19);
33360 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
33361 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
33362 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
33363 val_constr.data[t] = val_conv_19_conv;
33366 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
33369 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) {
33370 LDKCommitmentUpdate this_ptr_conv;
33371 this_ptr_conv.inner = untag_ptr(this_ptr);
33372 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33374 this_ptr_conv.is_owned = false;
33375 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
33376 uint64_tArray ret_arr = NULL;
33377 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
33378 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
33379 for (size_t q = 0; q < ret_var.datalen; q++) {
33380 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
33381 uint64_t ret_conv_16_ref = 0;
33382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33383 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33384 ret_arr_ptr[q] = ret_conv_16_ref;
33387 FREE(ret_var.data);
33391 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) {
33392 LDKCommitmentUpdate this_ptr_conv;
33393 this_ptr_conv.inner = untag_ptr(this_ptr);
33394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33396 this_ptr_conv.is_owned = false;
33397 LDKCVec_UpdateFailHTLCZ val_constr;
33398 val_constr.datalen = val->arr_len;
33399 if (val_constr.datalen > 0)
33400 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
33402 val_constr.data = NULL;
33403 uint64_t* val_vals = val->elems;
33404 for (size_t q = 0; q < val_constr.datalen; q++) {
33405 uint64_t val_conv_16 = val_vals[q];
33406 LDKUpdateFailHTLC val_conv_16_conv;
33407 val_conv_16_conv.inner = untag_ptr(val_conv_16);
33408 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
33409 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
33410 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
33411 val_constr.data[q] = val_conv_16_conv;
33414 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
33417 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) {
33418 LDKCommitmentUpdate this_ptr_conv;
33419 this_ptr_conv.inner = untag_ptr(this_ptr);
33420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33422 this_ptr_conv.is_owned = false;
33423 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
33424 uint64_tArray ret_arr = NULL;
33425 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
33426 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
33427 for (size_t z = 0; z < ret_var.datalen; z++) {
33428 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
33429 uint64_t ret_conv_25_ref = 0;
33430 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
33431 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
33432 ret_arr_ptr[z] = ret_conv_25_ref;
33435 FREE(ret_var.data);
33439 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) {
33440 LDKCommitmentUpdate this_ptr_conv;
33441 this_ptr_conv.inner = untag_ptr(this_ptr);
33442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33444 this_ptr_conv.is_owned = false;
33445 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
33446 val_constr.datalen = val->arr_len;
33447 if (val_constr.datalen > 0)
33448 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
33450 val_constr.data = NULL;
33451 uint64_t* val_vals = val->elems;
33452 for (size_t z = 0; z < val_constr.datalen; z++) {
33453 uint64_t val_conv_25 = val_vals[z];
33454 LDKUpdateFailMalformedHTLC val_conv_25_conv;
33455 val_conv_25_conv.inner = untag_ptr(val_conv_25);
33456 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
33457 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
33458 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
33459 val_constr.data[z] = val_conv_25_conv;
33462 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
33465 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) {
33466 LDKCommitmentUpdate this_ptr_conv;
33467 this_ptr_conv.inner = untag_ptr(this_ptr);
33468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33470 this_ptr_conv.is_owned = false;
33471 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
33472 uint64_t ret_ref = 0;
33473 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33474 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33478 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) {
33479 LDKCommitmentUpdate 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 LDKUpdateFee val_conv;
33485 val_conv.inner = untag_ptr(val);
33486 val_conv.is_owned = ptr_is_owned(val);
33487 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33488 val_conv = UpdateFee_clone(&val_conv);
33489 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
33492 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) {
33493 LDKCommitmentUpdate this_ptr_conv;
33494 this_ptr_conv.inner = untag_ptr(this_ptr);
33495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33497 this_ptr_conv.is_owned = false;
33498 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
33499 uint64_t ret_ref = 0;
33500 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33501 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33505 void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) {
33506 LDKCommitmentUpdate this_ptr_conv;
33507 this_ptr_conv.inner = untag_ptr(this_ptr);
33508 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33510 this_ptr_conv.is_owned = false;
33511 LDKCommitmentSigned val_conv;
33512 val_conv.inner = untag_ptr(val);
33513 val_conv.is_owned = ptr_is_owned(val);
33514 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33515 val_conv = CommitmentSigned_clone(&val_conv);
33516 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
33519 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) {
33520 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
33521 update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len;
33522 if (update_add_htlcs_arg_constr.datalen > 0)
33523 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
33525 update_add_htlcs_arg_constr.data = NULL;
33526 uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
33527 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
33528 uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
33529 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
33530 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
33531 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
33532 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
33533 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
33534 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
33536 FREE(update_add_htlcs_arg);
33537 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
33538 update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
33539 if (update_fulfill_htlcs_arg_constr.datalen > 0)
33540 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
33542 update_fulfill_htlcs_arg_constr.data = NULL;
33543 uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
33544 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
33545 uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
33546 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
33547 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
33548 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
33549 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
33550 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
33551 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
33553 FREE(update_fulfill_htlcs_arg);
33554 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
33555 update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
33556 if (update_fail_htlcs_arg_constr.datalen > 0)
33557 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
33559 update_fail_htlcs_arg_constr.data = NULL;
33560 uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
33561 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
33562 uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
33563 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
33564 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
33565 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
33566 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
33567 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
33568 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
33570 FREE(update_fail_htlcs_arg);
33571 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
33572 update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
33573 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
33574 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
33576 update_fail_malformed_htlcs_arg_constr.data = NULL;
33577 uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
33578 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
33579 uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
33580 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
33581 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
33582 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
33583 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
33584 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
33585 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
33587 FREE(update_fail_malformed_htlcs_arg);
33588 LDKUpdateFee update_fee_arg_conv;
33589 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
33590 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
33591 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
33592 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
33593 LDKCommitmentSigned commitment_signed_arg_conv;
33594 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
33595 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
33596 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
33597 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
33598 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);
33599 uint64_t ret_ref = 0;
33600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33605 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
33606 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
33607 uint64_t ret_ref = 0;
33608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33612 int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) {
33613 LDKCommitmentUpdate arg_conv;
33614 arg_conv.inner = untag_ptr(arg);
33615 arg_conv.is_owned = ptr_is_owned(arg);
33616 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33617 arg_conv.is_owned = false;
33618 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
33622 uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) {
33623 LDKCommitmentUpdate orig_conv;
33624 orig_conv.inner = untag_ptr(orig);
33625 orig_conv.is_owned = ptr_is_owned(orig);
33626 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33627 orig_conv.is_owned = false;
33628 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
33629 uint64_t ret_ref = 0;
33630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33635 void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
33636 if (!ptr_is_owned(this_ptr)) return;
33637 void* this_ptr_ptr = untag_ptr(this_ptr);
33638 CHECK_ACCESS(this_ptr_ptr);
33639 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
33640 FREE(untag_ptr(this_ptr));
33641 ChannelMessageHandler_free(this_ptr_conv);
33644 void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint64_t this_ptr) {
33645 if (!ptr_is_owned(this_ptr)) return;
33646 void* this_ptr_ptr = untag_ptr(this_ptr);
33647 CHECK_ACCESS(this_ptr_ptr);
33648 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
33649 FREE(untag_ptr(this_ptr));
33650 RoutingMessageHandler_free(this_ptr_conv);
33653 void __attribute__((export_name("TS_OnionMessageHandler_free"))) TS_OnionMessageHandler_free(uint64_t this_ptr) {
33654 if (!ptr_is_owned(this_ptr)) return;
33655 void* this_ptr_ptr = untag_ptr(this_ptr);
33656 CHECK_ACCESS(this_ptr_ptr);
33657 LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
33658 FREE(untag_ptr(this_ptr));
33659 OnionMessageHandler_free(this_ptr_conv);
33662 int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
33663 LDKAcceptChannel obj_conv;
33664 obj_conv.inner = untag_ptr(obj);
33665 obj_conv.is_owned = ptr_is_owned(obj);
33666 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33667 obj_conv.is_owned = false;
33668 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
33669 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33670 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33671 CVec_u8Z_free(ret_var);
33675 uint64_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
33676 LDKu8slice ser_ref;
33677 ser_ref.datalen = ser->arr_len;
33678 ser_ref.data = ser->elems;
33679 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
33680 *ret_conv = AcceptChannel_read(ser_ref);
33682 return tag_ptr(ret_conv, true);
33685 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) {
33686 LDKAnnouncementSignatures obj_conv;
33687 obj_conv.inner = untag_ptr(obj);
33688 obj_conv.is_owned = ptr_is_owned(obj);
33689 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33690 obj_conv.is_owned = false;
33691 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
33692 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33693 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33694 CVec_u8Z_free(ret_var);
33698 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
33699 LDKu8slice ser_ref;
33700 ser_ref.datalen = ser->arr_len;
33701 ser_ref.data = ser->elems;
33702 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
33703 *ret_conv = AnnouncementSignatures_read(ser_ref);
33705 return tag_ptr(ret_conv, true);
33708 int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) {
33709 LDKChannelReestablish obj_conv;
33710 obj_conv.inner = untag_ptr(obj);
33711 obj_conv.is_owned = ptr_is_owned(obj);
33712 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33713 obj_conv.is_owned = false;
33714 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
33715 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33716 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33717 CVec_u8Z_free(ret_var);
33721 uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
33722 LDKu8slice ser_ref;
33723 ser_ref.datalen = ser->arr_len;
33724 ser_ref.data = ser->elems;
33725 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
33726 *ret_conv = ChannelReestablish_read(ser_ref);
33728 return tag_ptr(ret_conv, true);
33731 int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) {
33732 LDKClosingSigned obj_conv;
33733 obj_conv.inner = untag_ptr(obj);
33734 obj_conv.is_owned = ptr_is_owned(obj);
33735 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33736 obj_conv.is_owned = false;
33737 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
33738 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33739 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33740 CVec_u8Z_free(ret_var);
33744 uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
33745 LDKu8slice ser_ref;
33746 ser_ref.datalen = ser->arr_len;
33747 ser_ref.data = ser->elems;
33748 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
33749 *ret_conv = ClosingSigned_read(ser_ref);
33751 return tag_ptr(ret_conv, true);
33754 int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) {
33755 LDKClosingSignedFeeRange obj_conv;
33756 obj_conv.inner = untag_ptr(obj);
33757 obj_conv.is_owned = ptr_is_owned(obj);
33758 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33759 obj_conv.is_owned = false;
33760 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
33761 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33762 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33763 CVec_u8Z_free(ret_var);
33767 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
33768 LDKu8slice ser_ref;
33769 ser_ref.datalen = ser->arr_len;
33770 ser_ref.data = ser->elems;
33771 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
33772 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
33774 return tag_ptr(ret_conv, true);
33777 int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) {
33778 LDKCommitmentSigned obj_conv;
33779 obj_conv.inner = untag_ptr(obj);
33780 obj_conv.is_owned = ptr_is_owned(obj);
33781 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33782 obj_conv.is_owned = false;
33783 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
33784 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33785 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33786 CVec_u8Z_free(ret_var);
33790 uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
33791 LDKu8slice ser_ref;
33792 ser_ref.datalen = ser->arr_len;
33793 ser_ref.data = ser->elems;
33794 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
33795 *ret_conv = CommitmentSigned_read(ser_ref);
33797 return tag_ptr(ret_conv, true);
33800 int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) {
33801 LDKFundingCreated obj_conv;
33802 obj_conv.inner = untag_ptr(obj);
33803 obj_conv.is_owned = ptr_is_owned(obj);
33804 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33805 obj_conv.is_owned = false;
33806 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
33807 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33808 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33809 CVec_u8Z_free(ret_var);
33813 uint64_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
33814 LDKu8slice ser_ref;
33815 ser_ref.datalen = ser->arr_len;
33816 ser_ref.data = ser->elems;
33817 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
33818 *ret_conv = FundingCreated_read(ser_ref);
33820 return tag_ptr(ret_conv, true);
33823 int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) {
33824 LDKFundingSigned obj_conv;
33825 obj_conv.inner = untag_ptr(obj);
33826 obj_conv.is_owned = ptr_is_owned(obj);
33827 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33828 obj_conv.is_owned = false;
33829 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
33830 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33831 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33832 CVec_u8Z_free(ret_var);
33836 uint64_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
33837 LDKu8slice ser_ref;
33838 ser_ref.datalen = ser->arr_len;
33839 ser_ref.data = ser->elems;
33840 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
33841 *ret_conv = FundingSigned_read(ser_ref);
33843 return tag_ptr(ret_conv, true);
33846 int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) {
33847 LDKChannelReady obj_conv;
33848 obj_conv.inner = untag_ptr(obj);
33849 obj_conv.is_owned = ptr_is_owned(obj);
33850 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33851 obj_conv.is_owned = false;
33852 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
33853 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33854 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33855 CVec_u8Z_free(ret_var);
33859 uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
33860 LDKu8slice ser_ref;
33861 ser_ref.datalen = ser->arr_len;
33862 ser_ref.data = ser->elems;
33863 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
33864 *ret_conv = ChannelReady_read(ser_ref);
33866 return tag_ptr(ret_conv, true);
33869 int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) {
33871 obj_conv.inner = untag_ptr(obj);
33872 obj_conv.is_owned = ptr_is_owned(obj);
33873 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33874 obj_conv.is_owned = false;
33875 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
33876 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33877 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33878 CVec_u8Z_free(ret_var);
33882 uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
33883 LDKu8slice ser_ref;
33884 ser_ref.datalen = ser->arr_len;
33885 ser_ref.data = ser->elems;
33886 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
33887 *ret_conv = Init_read(ser_ref);
33889 return tag_ptr(ret_conv, true);
33892 int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) {
33893 LDKOpenChannel obj_conv;
33894 obj_conv.inner = untag_ptr(obj);
33895 obj_conv.is_owned = ptr_is_owned(obj);
33896 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33897 obj_conv.is_owned = false;
33898 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
33899 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33900 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33901 CVec_u8Z_free(ret_var);
33905 uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
33906 LDKu8slice ser_ref;
33907 ser_ref.datalen = ser->arr_len;
33908 ser_ref.data = ser->elems;
33909 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
33910 *ret_conv = OpenChannel_read(ser_ref);
33912 return tag_ptr(ret_conv, true);
33915 int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) {
33916 LDKRevokeAndACK obj_conv;
33917 obj_conv.inner = untag_ptr(obj);
33918 obj_conv.is_owned = ptr_is_owned(obj);
33919 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33920 obj_conv.is_owned = false;
33921 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
33922 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33923 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33924 CVec_u8Z_free(ret_var);
33928 uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
33929 LDKu8slice ser_ref;
33930 ser_ref.datalen = ser->arr_len;
33931 ser_ref.data = ser->elems;
33932 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
33933 *ret_conv = RevokeAndACK_read(ser_ref);
33935 return tag_ptr(ret_conv, true);
33938 int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) {
33939 LDKShutdown obj_conv;
33940 obj_conv.inner = untag_ptr(obj);
33941 obj_conv.is_owned = ptr_is_owned(obj);
33942 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33943 obj_conv.is_owned = false;
33944 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
33945 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33946 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33947 CVec_u8Z_free(ret_var);
33951 uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
33952 LDKu8slice ser_ref;
33953 ser_ref.datalen = ser->arr_len;
33954 ser_ref.data = ser->elems;
33955 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
33956 *ret_conv = Shutdown_read(ser_ref);
33958 return tag_ptr(ret_conv, true);
33961 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) {
33962 LDKUpdateFailHTLC obj_conv;
33963 obj_conv.inner = untag_ptr(obj);
33964 obj_conv.is_owned = ptr_is_owned(obj);
33965 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33966 obj_conv.is_owned = false;
33967 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
33968 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33969 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33970 CVec_u8Z_free(ret_var);
33974 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
33975 LDKu8slice ser_ref;
33976 ser_ref.datalen = ser->arr_len;
33977 ser_ref.data = ser->elems;
33978 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
33979 *ret_conv = UpdateFailHTLC_read(ser_ref);
33981 return tag_ptr(ret_conv, true);
33984 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) {
33985 LDKUpdateFailMalformedHTLC obj_conv;
33986 obj_conv.inner = untag_ptr(obj);
33987 obj_conv.is_owned = ptr_is_owned(obj);
33988 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33989 obj_conv.is_owned = false;
33990 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
33991 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33992 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33993 CVec_u8Z_free(ret_var);
33997 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
33998 LDKu8slice ser_ref;
33999 ser_ref.datalen = ser->arr_len;
34000 ser_ref.data = ser->elems;
34001 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
34002 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
34004 return tag_ptr(ret_conv, true);
34007 int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) {
34008 LDKUpdateFee obj_conv;
34009 obj_conv.inner = untag_ptr(obj);
34010 obj_conv.is_owned = ptr_is_owned(obj);
34011 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34012 obj_conv.is_owned = false;
34013 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
34014 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34015 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34016 CVec_u8Z_free(ret_var);
34020 uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
34021 LDKu8slice ser_ref;
34022 ser_ref.datalen = ser->arr_len;
34023 ser_ref.data = ser->elems;
34024 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
34025 *ret_conv = UpdateFee_read(ser_ref);
34027 return tag_ptr(ret_conv, true);
34030 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) {
34031 LDKUpdateFulfillHTLC obj_conv;
34032 obj_conv.inner = untag_ptr(obj);
34033 obj_conv.is_owned = ptr_is_owned(obj);
34034 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34035 obj_conv.is_owned = false;
34036 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
34037 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34038 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34039 CVec_u8Z_free(ret_var);
34043 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
34044 LDKu8slice ser_ref;
34045 ser_ref.datalen = ser->arr_len;
34046 ser_ref.data = ser->elems;
34047 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
34048 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
34050 return tag_ptr(ret_conv, true);
34053 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) {
34054 LDKUpdateAddHTLC obj_conv;
34055 obj_conv.inner = untag_ptr(obj);
34056 obj_conv.is_owned = ptr_is_owned(obj);
34057 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34058 obj_conv.is_owned = false;
34059 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
34060 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34061 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34062 CVec_u8Z_free(ret_var);
34066 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
34067 LDKu8slice ser_ref;
34068 ser_ref.datalen = ser->arr_len;
34069 ser_ref.data = ser->elems;
34070 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
34071 *ret_conv = UpdateAddHTLC_read(ser_ref);
34073 return tag_ptr(ret_conv, true);
34076 uint64_t __attribute__((export_name("TS_OnionMessage_read"))) TS_OnionMessage_read(int8_tArray ser) {
34077 LDKu8slice ser_ref;
34078 ser_ref.datalen = ser->arr_len;
34079 ser_ref.data = ser->elems;
34080 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
34081 *ret_conv = OnionMessage_read(ser_ref);
34083 return tag_ptr(ret_conv, true);
34086 int8_tArray __attribute__((export_name("TS_OnionMessage_write"))) TS_OnionMessage_write(uint64_t obj) {
34087 LDKOnionMessage obj_conv;
34088 obj_conv.inner = untag_ptr(obj);
34089 obj_conv.is_owned = ptr_is_owned(obj);
34090 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34091 obj_conv.is_owned = false;
34092 LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
34093 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34094 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34095 CVec_u8Z_free(ret_var);
34099 int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
34101 obj_conv.inner = untag_ptr(obj);
34102 obj_conv.is_owned = ptr_is_owned(obj);
34103 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34104 obj_conv.is_owned = false;
34105 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
34106 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34107 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34108 CVec_u8Z_free(ret_var);
34112 uint64_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
34113 LDKu8slice ser_ref;
34114 ser_ref.datalen = ser->arr_len;
34115 ser_ref.data = ser->elems;
34116 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
34117 *ret_conv = Ping_read(ser_ref);
34119 return tag_ptr(ret_conv, true);
34122 int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) {
34124 obj_conv.inner = untag_ptr(obj);
34125 obj_conv.is_owned = ptr_is_owned(obj);
34126 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34127 obj_conv.is_owned = false;
34128 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
34129 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34130 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34131 CVec_u8Z_free(ret_var);
34135 uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
34136 LDKu8slice ser_ref;
34137 ser_ref.datalen = ser->arr_len;
34138 ser_ref.data = ser->elems;
34139 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
34140 *ret_conv = Pong_read(ser_ref);
34142 return tag_ptr(ret_conv, true);
34145 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) {
34146 LDKUnsignedChannelAnnouncement obj_conv;
34147 obj_conv.inner = untag_ptr(obj);
34148 obj_conv.is_owned = ptr_is_owned(obj);
34149 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34150 obj_conv.is_owned = false;
34151 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
34152 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34153 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34154 CVec_u8Z_free(ret_var);
34158 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
34159 LDKu8slice ser_ref;
34160 ser_ref.datalen = ser->arr_len;
34161 ser_ref.data = ser->elems;
34162 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
34163 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
34165 return tag_ptr(ret_conv, true);
34168 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) {
34169 LDKChannelAnnouncement obj_conv;
34170 obj_conv.inner = untag_ptr(obj);
34171 obj_conv.is_owned = ptr_is_owned(obj);
34172 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34173 obj_conv.is_owned = false;
34174 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
34175 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34176 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34177 CVec_u8Z_free(ret_var);
34181 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
34182 LDKu8slice ser_ref;
34183 ser_ref.datalen = ser->arr_len;
34184 ser_ref.data = ser->elems;
34185 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
34186 *ret_conv = ChannelAnnouncement_read(ser_ref);
34188 return tag_ptr(ret_conv, true);
34191 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) {
34192 LDKUnsignedChannelUpdate obj_conv;
34193 obj_conv.inner = untag_ptr(obj);
34194 obj_conv.is_owned = ptr_is_owned(obj);
34195 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34196 obj_conv.is_owned = false;
34197 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
34198 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34199 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34200 CVec_u8Z_free(ret_var);
34204 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
34205 LDKu8slice ser_ref;
34206 ser_ref.datalen = ser->arr_len;
34207 ser_ref.data = ser->elems;
34208 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
34209 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
34211 return tag_ptr(ret_conv, true);
34214 int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) {
34215 LDKChannelUpdate obj_conv;
34216 obj_conv.inner = untag_ptr(obj);
34217 obj_conv.is_owned = ptr_is_owned(obj);
34218 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34219 obj_conv.is_owned = false;
34220 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
34221 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34222 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34223 CVec_u8Z_free(ret_var);
34227 uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
34228 LDKu8slice ser_ref;
34229 ser_ref.datalen = ser->arr_len;
34230 ser_ref.data = ser->elems;
34231 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
34232 *ret_conv = ChannelUpdate_read(ser_ref);
34234 return tag_ptr(ret_conv, true);
34237 int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) {
34238 LDKErrorMessage obj_conv;
34239 obj_conv.inner = untag_ptr(obj);
34240 obj_conv.is_owned = ptr_is_owned(obj);
34241 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34242 obj_conv.is_owned = false;
34243 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
34244 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34245 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34246 CVec_u8Z_free(ret_var);
34250 uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
34251 LDKu8slice ser_ref;
34252 ser_ref.datalen = ser->arr_len;
34253 ser_ref.data = ser->elems;
34254 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
34255 *ret_conv = ErrorMessage_read(ser_ref);
34257 return tag_ptr(ret_conv, true);
34260 int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) {
34261 LDKWarningMessage obj_conv;
34262 obj_conv.inner = untag_ptr(obj);
34263 obj_conv.is_owned = ptr_is_owned(obj);
34264 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34265 obj_conv.is_owned = false;
34266 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
34267 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34268 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34269 CVec_u8Z_free(ret_var);
34273 uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
34274 LDKu8slice ser_ref;
34275 ser_ref.datalen = ser->arr_len;
34276 ser_ref.data = ser->elems;
34277 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
34278 *ret_conv = WarningMessage_read(ser_ref);
34280 return tag_ptr(ret_conv, true);
34283 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) {
34284 LDKUnsignedNodeAnnouncement obj_conv;
34285 obj_conv.inner = untag_ptr(obj);
34286 obj_conv.is_owned = ptr_is_owned(obj);
34287 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34288 obj_conv.is_owned = false;
34289 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
34290 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34291 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34292 CVec_u8Z_free(ret_var);
34296 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
34297 LDKu8slice ser_ref;
34298 ser_ref.datalen = ser->arr_len;
34299 ser_ref.data = ser->elems;
34300 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
34301 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
34303 return tag_ptr(ret_conv, true);
34306 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) {
34307 LDKNodeAnnouncement obj_conv;
34308 obj_conv.inner = untag_ptr(obj);
34309 obj_conv.is_owned = ptr_is_owned(obj);
34310 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34311 obj_conv.is_owned = false;
34312 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
34313 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34314 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34315 CVec_u8Z_free(ret_var);
34319 uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
34320 LDKu8slice ser_ref;
34321 ser_ref.datalen = ser->arr_len;
34322 ser_ref.data = ser->elems;
34323 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
34324 *ret_conv = NodeAnnouncement_read(ser_ref);
34326 return tag_ptr(ret_conv, true);
34329 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
34330 LDKu8slice ser_ref;
34331 ser_ref.datalen = ser->arr_len;
34332 ser_ref.data = ser->elems;
34333 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
34334 *ret_conv = QueryShortChannelIds_read(ser_ref);
34336 return tag_ptr(ret_conv, true);
34339 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) {
34340 LDKQueryShortChannelIds obj_conv;
34341 obj_conv.inner = untag_ptr(obj);
34342 obj_conv.is_owned = ptr_is_owned(obj);
34343 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34344 obj_conv.is_owned = false;
34345 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
34346 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34347 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34348 CVec_u8Z_free(ret_var);
34352 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) {
34353 LDKReplyShortChannelIdsEnd obj_conv;
34354 obj_conv.inner = untag_ptr(obj);
34355 obj_conv.is_owned = ptr_is_owned(obj);
34356 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34357 obj_conv.is_owned = false;
34358 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
34359 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34360 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34361 CVec_u8Z_free(ret_var);
34365 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
34366 LDKu8slice ser_ref;
34367 ser_ref.datalen = ser->arr_len;
34368 ser_ref.data = ser->elems;
34369 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
34370 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
34372 return tag_ptr(ret_conv, true);
34375 int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) {
34376 LDKQueryChannelRange this_arg_conv;
34377 this_arg_conv.inner = untag_ptr(this_arg);
34378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34380 this_arg_conv.is_owned = false;
34381 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
34385 int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) {
34386 LDKQueryChannelRange obj_conv;
34387 obj_conv.inner = untag_ptr(obj);
34388 obj_conv.is_owned = ptr_is_owned(obj);
34389 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34390 obj_conv.is_owned = false;
34391 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
34392 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34393 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34394 CVec_u8Z_free(ret_var);
34398 uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
34399 LDKu8slice ser_ref;
34400 ser_ref.datalen = ser->arr_len;
34401 ser_ref.data = ser->elems;
34402 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
34403 *ret_conv = QueryChannelRange_read(ser_ref);
34405 return tag_ptr(ret_conv, true);
34408 uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
34409 LDKu8slice ser_ref;
34410 ser_ref.datalen = ser->arr_len;
34411 ser_ref.data = ser->elems;
34412 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
34413 *ret_conv = ReplyChannelRange_read(ser_ref);
34415 return tag_ptr(ret_conv, true);
34418 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) {
34419 LDKReplyChannelRange obj_conv;
34420 obj_conv.inner = untag_ptr(obj);
34421 obj_conv.is_owned = ptr_is_owned(obj);
34422 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34423 obj_conv.is_owned = false;
34424 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
34425 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34426 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34427 CVec_u8Z_free(ret_var);
34431 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) {
34432 LDKGossipTimestampFilter obj_conv;
34433 obj_conv.inner = untag_ptr(obj);
34434 obj_conv.is_owned = ptr_is_owned(obj);
34435 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34436 obj_conv.is_owned = false;
34437 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
34438 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34439 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34440 CVec_u8Z_free(ret_var);
34444 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
34445 LDKu8slice ser_ref;
34446 ser_ref.datalen = ser->arr_len;
34447 ser_ref.data = ser->elems;
34448 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
34449 *ret_conv = GossipTimestampFilter_read(ser_ref);
34451 return tag_ptr(ret_conv, true);
34454 void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint64_t this_ptr) {
34455 if (!ptr_is_owned(this_ptr)) return;
34456 void* this_ptr_ptr = untag_ptr(this_ptr);
34457 CHECK_ACCESS(this_ptr_ptr);
34458 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
34459 FREE(untag_ptr(this_ptr));
34460 CustomMessageHandler_free(this_ptr_conv);
34463 void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) {
34464 LDKIgnoringMessageHandler this_obj_conv;
34465 this_obj_conv.inner = untag_ptr(this_obj);
34466 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34468 IgnoringMessageHandler_free(this_obj_conv);
34471 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() {
34472 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
34473 uint64_t ret_ref = 0;
34474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34479 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
34480 LDKIgnoringMessageHandler this_arg_conv;
34481 this_arg_conv.inner = untag_ptr(this_arg);
34482 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34484 this_arg_conv.is_owned = false;
34485 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
34486 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
34487 return tag_ptr(ret_ret, true);
34490 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint64_t this_arg) {
34491 LDKIgnoringMessageHandler this_arg_conv;
34492 this_arg_conv.inner = untag_ptr(this_arg);
34493 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34495 this_arg_conv.is_owned = false;
34496 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
34497 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
34498 return tag_ptr(ret_ret, true);
34501 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageProvider"))) TS_IgnoringMessageHandler_as_OnionMessageProvider(uint64_t this_arg) {
34502 LDKIgnoringMessageHandler this_arg_conv;
34503 this_arg_conv.inner = untag_ptr(this_arg);
34504 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34506 this_arg_conv.is_owned = false;
34507 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
34508 *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
34509 return tag_ptr(ret_ret, true);
34512 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageHandler"))) TS_IgnoringMessageHandler_as_OnionMessageHandler(uint64_t this_arg) {
34513 LDKIgnoringMessageHandler this_arg_conv;
34514 this_arg_conv.inner = untag_ptr(this_arg);
34515 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34517 this_arg_conv.is_owned = false;
34518 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
34519 *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
34520 return tag_ptr(ret_ret, true);
34523 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
34524 LDKIgnoringMessageHandler this_arg_conv;
34525 this_arg_conv.inner = untag_ptr(this_arg);
34526 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34528 this_arg_conv.is_owned = false;
34529 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
34530 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
34531 return tag_ptr(ret_ret, true);
34534 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) {
34535 LDKIgnoringMessageHandler this_arg_conv;
34536 this_arg_conv.inner = untag_ptr(this_arg);
34537 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34539 this_arg_conv.is_owned = false;
34540 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
34541 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
34542 return tag_ptr(ret_ret, true);
34545 void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) {
34546 LDKErroringMessageHandler this_obj_conv;
34547 this_obj_conv.inner = untag_ptr(this_obj);
34548 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34550 ErroringMessageHandler_free(this_obj_conv);
34553 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() {
34554 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
34555 uint64_t ret_ref = 0;
34556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34561 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
34562 LDKErroringMessageHandler this_arg_conv;
34563 this_arg_conv.inner = untag_ptr(this_arg);
34564 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34566 this_arg_conv.is_owned = false;
34567 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
34568 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
34569 return tag_ptr(ret_ret, true);
34572 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) {
34573 LDKErroringMessageHandler this_arg_conv;
34574 this_arg_conv.inner = untag_ptr(this_arg);
34575 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34577 this_arg_conv.is_owned = false;
34578 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
34579 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
34580 return tag_ptr(ret_ret, true);
34583 void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) {
34584 LDKMessageHandler this_obj_conv;
34585 this_obj_conv.inner = untag_ptr(this_obj);
34586 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34588 MessageHandler_free(this_obj_conv);
34591 uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_handler(uint64_t this_ptr) {
34592 LDKMessageHandler this_ptr_conv;
34593 this_ptr_conv.inner = untag_ptr(this_ptr);
34594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34596 this_ptr_conv.is_owned = false;
34597 // WARNING: This object doesn't live past this scope, needs clone!
34598 uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
34602 void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_handler(uint64_t this_ptr, uint64_t val) {
34603 LDKMessageHandler this_ptr_conv;
34604 this_ptr_conv.inner = untag_ptr(this_ptr);
34605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34607 this_ptr_conv.is_owned = false;
34608 void* val_ptr = untag_ptr(val);
34609 CHECK_ACCESS(val_ptr);
34610 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
34611 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
34612 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34613 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
34615 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
34618 uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_handler(uint64_t this_ptr) {
34619 LDKMessageHandler this_ptr_conv;
34620 this_ptr_conv.inner = untag_ptr(this_ptr);
34621 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34623 this_ptr_conv.is_owned = false;
34624 // WARNING: This object doesn't live past this scope, needs clone!
34625 uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
34629 void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_handler(uint64_t this_ptr, uint64_t val) {
34630 LDKMessageHandler this_ptr_conv;
34631 this_ptr_conv.inner = untag_ptr(this_ptr);
34632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34634 this_ptr_conv.is_owned = false;
34635 void* val_ptr = untag_ptr(val);
34636 CHECK_ACCESS(val_ptr);
34637 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
34638 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
34639 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34640 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
34642 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
34645 uint64_t __attribute__((export_name("TS_MessageHandler_get_onion_message_handler"))) TS_MessageHandler_get_onion_message_handler(uint64_t this_ptr) {
34646 LDKMessageHandler this_ptr_conv;
34647 this_ptr_conv.inner = untag_ptr(this_ptr);
34648 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34650 this_ptr_conv.is_owned = false;
34651 // WARNING: This object doesn't live past this scope, needs clone!
34652 uint64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
34656 void __attribute__((export_name("TS_MessageHandler_set_onion_message_handler"))) TS_MessageHandler_set_onion_message_handler(uint64_t this_ptr, uint64_t val) {
34657 LDKMessageHandler this_ptr_conv;
34658 this_ptr_conv.inner = untag_ptr(this_ptr);
34659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34661 this_ptr_conv.is_owned = false;
34662 void* val_ptr = untag_ptr(val);
34663 CHECK_ACCESS(val_ptr);
34664 LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
34665 if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
34666 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34667 LDKOnionMessageHandler_JCalls_cloned(&val_conv);
34669 MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
34672 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) {
34673 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
34674 CHECK_ACCESS(chan_handler_arg_ptr);
34675 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
34676 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
34677 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34678 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
34680 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
34681 CHECK_ACCESS(route_handler_arg_ptr);
34682 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
34683 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
34684 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34685 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
34687 void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
34688 CHECK_ACCESS(onion_message_handler_arg_ptr);
34689 LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
34690 if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
34691 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34692 LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
34694 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
34695 uint64_t ret_ref = 0;
34696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34701 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
34702 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
34703 *ret_ret = SocketDescriptor_clone(arg);
34704 return tag_ptr(ret_ret, true);
34706 int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) {
34707 void* arg_ptr = untag_ptr(arg);
34708 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
34709 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
34710 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
34714 uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) {
34715 void* orig_ptr = untag_ptr(orig);
34716 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
34717 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
34718 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
34719 *ret_ret = SocketDescriptor_clone(orig_conv);
34720 return tag_ptr(ret_ret, true);
34723 void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint64_t this_ptr) {
34724 if (!ptr_is_owned(this_ptr)) return;
34725 void* this_ptr_ptr = untag_ptr(this_ptr);
34726 CHECK_ACCESS(this_ptr_ptr);
34727 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
34728 FREE(untag_ptr(this_ptr));
34729 SocketDescriptor_free(this_ptr_conv);
34732 void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) {
34733 LDKPeerHandleError this_obj_conv;
34734 this_obj_conv.inner = untag_ptr(this_obj);
34735 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34737 PeerHandleError_free(this_obj_conv);
34740 jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
34741 LDKPeerHandleError this_ptr_conv;
34742 this_ptr_conv.inner = untag_ptr(this_ptr);
34743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34745 this_ptr_conv.is_owned = false;
34746 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
34750 void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
34751 LDKPeerHandleError this_ptr_conv;
34752 this_ptr_conv.inner = untag_ptr(this_ptr);
34753 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34755 this_ptr_conv.is_owned = false;
34756 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
34759 uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
34760 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
34761 uint64_t ret_ref = 0;
34762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34767 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
34768 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
34769 uint64_t ret_ref = 0;
34770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34774 int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) {
34775 LDKPeerHandleError arg_conv;
34776 arg_conv.inner = untag_ptr(arg);
34777 arg_conv.is_owned = ptr_is_owned(arg);
34778 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34779 arg_conv.is_owned = false;
34780 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
34784 uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) {
34785 LDKPeerHandleError orig_conv;
34786 orig_conv.inner = untag_ptr(orig);
34787 orig_conv.is_owned = ptr_is_owned(orig);
34788 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34789 orig_conv.is_owned = false;
34790 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
34791 uint64_t ret_ref = 0;
34792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34797 void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) {
34798 LDKPeerManager this_obj_conv;
34799 this_obj_conv.inner = untag_ptr(this_obj);
34800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34802 PeerManager_free(this_obj_conv);
34805 uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int64_t current_time, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) {
34806 LDKMessageHandler message_handler_conv;
34807 message_handler_conv.inner = untag_ptr(message_handler);
34808 message_handler_conv.is_owned = ptr_is_owned(message_handler);
34809 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
34810 // WARNING: we need a move here but no clone is available for LDKMessageHandler
34812 LDKSecretKey our_node_secret_ref;
34813 CHECK(our_node_secret->arr_len == 32);
34814 memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
34815 unsigned char ephemeral_random_data_arr[32];
34816 CHECK(ephemeral_random_data->arr_len == 32);
34817 memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
34818 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
34819 void* logger_ptr = untag_ptr(logger);
34820 CHECK_ACCESS(logger_ptr);
34821 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
34822 if (logger_conv.free == LDKLogger_JCalls_free) {
34823 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34824 LDKLogger_JCalls_cloned(&logger_conv);
34826 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
34827 CHECK_ACCESS(custom_message_handler_ptr);
34828 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
34829 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
34830 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34831 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
34833 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
34834 uint64_t ret_ref = 0;
34835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34840 ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
34841 LDKPeerManager this_arg_conv;
34842 this_arg_conv.inner = untag_ptr(this_arg);
34843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34845 this_arg_conv.is_owned = false;
34846 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
34847 ptrArray ret_arr = NULL;
34848 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
34849 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
34850 for (size_t m = 0; m < ret_var.datalen; m++) {
34851 int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
34852 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
34853 ret_arr_ptr[m] = ret_conv_12_arr;
34856 FREE(ret_var.data);
34860 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) {
34861 LDKPeerManager this_arg_conv;
34862 this_arg_conv.inner = untag_ptr(this_arg);
34863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34865 this_arg_conv.is_owned = false;
34866 LDKPublicKey their_node_id_ref;
34867 CHECK(their_node_id->arr_len == 33);
34868 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
34869 void* descriptor_ptr = untag_ptr(descriptor);
34870 CHECK_ACCESS(descriptor_ptr);
34871 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
34872 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
34873 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34874 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
34876 void* remote_network_address_ptr = untag_ptr(remote_network_address);
34877 CHECK_ACCESS(remote_network_address_ptr);
34878 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
34879 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
34880 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
34881 return tag_ptr(ret_conv, true);
34884 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) {
34885 LDKPeerManager this_arg_conv;
34886 this_arg_conv.inner = untag_ptr(this_arg);
34887 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34889 this_arg_conv.is_owned = false;
34890 void* descriptor_ptr = untag_ptr(descriptor);
34891 CHECK_ACCESS(descriptor_ptr);
34892 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
34893 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
34894 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34895 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
34897 void* remote_network_address_ptr = untag_ptr(remote_network_address);
34898 CHECK_ACCESS(remote_network_address_ptr);
34899 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
34900 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
34901 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
34902 return tag_ptr(ret_conv, true);
34905 uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) {
34906 LDKPeerManager this_arg_conv;
34907 this_arg_conv.inner = untag_ptr(this_arg);
34908 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34910 this_arg_conv.is_owned = false;
34911 void* descriptor_ptr = untag_ptr(descriptor);
34912 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
34913 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
34914 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
34915 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
34916 return tag_ptr(ret_conv, true);
34919 uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) {
34920 LDKPeerManager this_arg_conv;
34921 this_arg_conv.inner = untag_ptr(this_arg);
34922 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34924 this_arg_conv.is_owned = false;
34925 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
34926 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
34927 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
34928 LDKu8slice data_ref;
34929 data_ref.datalen = data->arr_len;
34930 data_ref.data = data->elems;
34931 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
34932 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
34934 return tag_ptr(ret_conv, true);
34937 void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) {
34938 LDKPeerManager this_arg_conv;
34939 this_arg_conv.inner = untag_ptr(this_arg);
34940 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34942 this_arg_conv.is_owned = false;
34943 PeerManager_process_events(&this_arg_conv);
34946 void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) {
34947 LDKPeerManager this_arg_conv;
34948 this_arg_conv.inner = untag_ptr(this_arg);
34949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34951 this_arg_conv.is_owned = false;
34952 void* descriptor_ptr = untag_ptr(descriptor);
34953 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
34954 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
34955 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
34958 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) {
34959 LDKPeerManager this_arg_conv;
34960 this_arg_conv.inner = untag_ptr(this_arg);
34961 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34963 this_arg_conv.is_owned = false;
34964 LDKPublicKey node_id_ref;
34965 CHECK(node_id->arr_len == 33);
34966 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
34967 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
34970 void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
34971 LDKPeerManager this_arg_conv;
34972 this_arg_conv.inner = untag_ptr(this_arg);
34973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34975 this_arg_conv.is_owned = false;
34976 PeerManager_disconnect_all_peers(&this_arg_conv);
34979 void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(uint64_t this_arg) {
34980 LDKPeerManager this_arg_conv;
34981 this_arg_conv.inner = untag_ptr(this_arg);
34982 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34984 this_arg_conv.is_owned = false;
34985 PeerManager_timer_tick_occurred(&this_arg_conv);
34988 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) {
34989 LDKPeerManager this_arg_conv;
34990 this_arg_conv.inner = untag_ptr(this_arg);
34991 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34993 this_arg_conv.is_owned = false;
34994 LDKThreeBytes rgb_ref;
34995 CHECK(rgb->arr_len == 3);
34996 memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
34997 LDKThirtyTwoBytes alias_ref;
34998 CHECK(alias->arr_len == 32);
34999 memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
35000 LDKCVec_NetAddressZ addresses_constr;
35001 addresses_constr.datalen = addresses->arr_len;
35002 if (addresses_constr.datalen > 0)
35003 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
35005 addresses_constr.data = NULL;
35006 uint64_t* addresses_vals = addresses->elems;
35007 for (size_t m = 0; m < addresses_constr.datalen; m++) {
35008 uint64_t addresses_conv_12 = addresses_vals[m];
35009 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
35010 CHECK_ACCESS(addresses_conv_12_ptr);
35011 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
35012 addresses_constr.data[m] = addresses_conv_12_conv;
35015 PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
35018 int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
35019 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
35023 int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
35024 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
35028 int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
35029 unsigned char commitment_seed_arr[32];
35030 CHECK(commitment_seed->arr_len == 32);
35031 memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
35032 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
35033 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35034 memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
35038 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) {
35039 LDKCVec_u8Z to_holder_script_ref;
35040 to_holder_script_ref.datalen = to_holder_script->arr_len;
35041 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
35042 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
35043 LDKCVec_u8Z to_counterparty_script_ref;
35044 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
35045 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
35046 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
35047 LDKOutPoint funding_outpoint_conv;
35048 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35049 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35050 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35051 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35052 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);
35053 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35054 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35055 Transaction_free(ret_var);
35059 void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) {
35060 LDKCounterpartyCommitmentSecrets this_obj_conv;
35061 this_obj_conv.inner = untag_ptr(this_obj);
35062 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35064 CounterpartyCommitmentSecrets_free(this_obj_conv);
35067 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
35068 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
35069 uint64_t ret_ref = 0;
35070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35074 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) {
35075 LDKCounterpartyCommitmentSecrets arg_conv;
35076 arg_conv.inner = untag_ptr(arg);
35077 arg_conv.is_owned = ptr_is_owned(arg);
35078 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35079 arg_conv.is_owned = false;
35080 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
35084 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) {
35085 LDKCounterpartyCommitmentSecrets orig_conv;
35086 orig_conv.inner = untag_ptr(orig);
35087 orig_conv.is_owned = ptr_is_owned(orig);
35088 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35089 orig_conv.is_owned = false;
35090 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
35091 uint64_t ret_ref = 0;
35092 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35093 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35097 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() {
35098 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
35099 uint64_t ret_ref = 0;
35100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35105 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) {
35106 LDKCounterpartyCommitmentSecrets this_arg_conv;
35107 this_arg_conv.inner = untag_ptr(this_arg);
35108 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35110 this_arg_conv.is_owned = false;
35111 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
35115 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) {
35116 LDKCounterpartyCommitmentSecrets this_arg_conv;
35117 this_arg_conv.inner = untag_ptr(this_arg);
35118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35120 this_arg_conv.is_owned = false;
35121 LDKThirtyTwoBytes secret_ref;
35122 CHECK(secret->arr_len == 32);
35123 memcpy(secret_ref.data, secret->elems, 32); FREE(secret);
35124 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
35125 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
35126 return tag_ptr(ret_conv, true);
35129 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) {
35130 LDKCounterpartyCommitmentSecrets this_arg_conv;
35131 this_arg_conv.inner = untag_ptr(this_arg);
35132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35134 this_arg_conv.is_owned = false;
35135 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35136 memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32);
35140 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) {
35141 LDKCounterpartyCommitmentSecrets obj_conv;
35142 obj_conv.inner = untag_ptr(obj);
35143 obj_conv.is_owned = ptr_is_owned(obj);
35144 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35145 obj_conv.is_owned = false;
35146 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
35147 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35148 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35149 CVec_u8Z_free(ret_var);
35153 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
35154 LDKu8slice ser_ref;
35155 ser_ref.datalen = ser->arr_len;
35156 ser_ref.data = ser->elems;
35157 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
35158 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
35160 return tag_ptr(ret_conv, true);
35163 uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
35164 LDKPublicKey per_commitment_point_ref;
35165 CHECK(per_commitment_point->arr_len == 33);
35166 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
35167 unsigned char base_secret_arr[32];
35168 CHECK(base_secret->arr_len == 32);
35169 memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
35170 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
35171 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
35172 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
35173 return tag_ptr(ret_conv, true);
35176 uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
35177 LDKPublicKey per_commitment_point_ref;
35178 CHECK(per_commitment_point->arr_len == 33);
35179 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
35180 LDKPublicKey base_point_ref;
35181 CHECK(base_point->arr_len == 33);
35182 memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
35183 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
35184 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
35185 return tag_ptr(ret_conv, true);
35188 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) {
35189 unsigned char per_commitment_secret_arr[32];
35190 CHECK(per_commitment_secret->arr_len == 32);
35191 memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
35192 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
35193 unsigned char countersignatory_revocation_base_secret_arr[32];
35194 CHECK(countersignatory_revocation_base_secret->arr_len == 32);
35195 memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
35196 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
35197 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
35198 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
35199 return tag_ptr(ret_conv, true);
35202 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) {
35203 LDKPublicKey per_commitment_point_ref;
35204 CHECK(per_commitment_point->arr_len == 33);
35205 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
35206 LDKPublicKey countersignatory_revocation_base_point_ref;
35207 CHECK(countersignatory_revocation_base_point->arr_len == 33);
35208 memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
35209 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
35210 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
35211 return tag_ptr(ret_conv, true);
35214 void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
35215 LDKTxCreationKeys this_obj_conv;
35216 this_obj_conv.inner = untag_ptr(this_obj);
35217 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35219 TxCreationKeys_free(this_obj_conv);
35222 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) {
35223 LDKTxCreationKeys this_ptr_conv;
35224 this_ptr_conv.inner = untag_ptr(this_ptr);
35225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35227 this_ptr_conv.is_owned = false;
35228 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35229 memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
35233 void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
35234 LDKTxCreationKeys this_ptr_conv;
35235 this_ptr_conv.inner = untag_ptr(this_ptr);
35236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35238 this_ptr_conv.is_owned = false;
35239 LDKPublicKey val_ref;
35240 CHECK(val->arr_len == 33);
35241 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35242 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
35245 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) {
35246 LDKTxCreationKeys this_ptr_conv;
35247 this_ptr_conv.inner = untag_ptr(this_ptr);
35248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35250 this_ptr_conv.is_owned = false;
35251 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35252 memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
35256 void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) {
35257 LDKTxCreationKeys this_ptr_conv;
35258 this_ptr_conv.inner = untag_ptr(this_ptr);
35259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35261 this_ptr_conv.is_owned = false;
35262 LDKPublicKey val_ref;
35263 CHECK(val->arr_len == 33);
35264 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35265 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
35268 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) {
35269 LDKTxCreationKeys this_ptr_conv;
35270 this_ptr_conv.inner = untag_ptr(this_ptr);
35271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35273 this_ptr_conv.is_owned = false;
35274 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35275 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
35279 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) {
35280 LDKTxCreationKeys this_ptr_conv;
35281 this_ptr_conv.inner = untag_ptr(this_ptr);
35282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35284 this_ptr_conv.is_owned = false;
35285 LDKPublicKey val_ref;
35286 CHECK(val->arr_len == 33);
35287 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35288 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
35291 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) {
35292 LDKTxCreationKeys this_ptr_conv;
35293 this_ptr_conv.inner = untag_ptr(this_ptr);
35294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35296 this_ptr_conv.is_owned = false;
35297 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35298 memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
35302 void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) {
35303 LDKTxCreationKeys this_ptr_conv;
35304 this_ptr_conv.inner = untag_ptr(this_ptr);
35305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35307 this_ptr_conv.is_owned = false;
35308 LDKPublicKey val_ref;
35309 CHECK(val->arr_len == 33);
35310 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35311 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
35314 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) {
35315 LDKTxCreationKeys this_ptr_conv;
35316 this_ptr_conv.inner = untag_ptr(this_ptr);
35317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35319 this_ptr_conv.is_owned = false;
35320 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35321 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
35325 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) {
35326 LDKTxCreationKeys this_ptr_conv;
35327 this_ptr_conv.inner = untag_ptr(this_ptr);
35328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35330 this_ptr_conv.is_owned = false;
35331 LDKPublicKey val_ref;
35332 CHECK(val->arr_len == 33);
35333 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35334 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
35337 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) {
35338 LDKPublicKey per_commitment_point_arg_ref;
35339 CHECK(per_commitment_point_arg->arr_len == 33);
35340 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
35341 LDKPublicKey revocation_key_arg_ref;
35342 CHECK(revocation_key_arg->arr_len == 33);
35343 memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg);
35344 LDKPublicKey broadcaster_htlc_key_arg_ref;
35345 CHECK(broadcaster_htlc_key_arg->arr_len == 33);
35346 memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg);
35347 LDKPublicKey countersignatory_htlc_key_arg_ref;
35348 CHECK(countersignatory_htlc_key_arg->arr_len == 33);
35349 memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg);
35350 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
35351 CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33);
35352 memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg);
35353 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);
35354 uint64_t ret_ref = 0;
35355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35360 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
35361 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
35362 uint64_t ret_ref = 0;
35363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35367 int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) {
35368 LDKTxCreationKeys arg_conv;
35369 arg_conv.inner = untag_ptr(arg);
35370 arg_conv.is_owned = ptr_is_owned(arg);
35371 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35372 arg_conv.is_owned = false;
35373 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
35377 uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) {
35378 LDKTxCreationKeys orig_conv;
35379 orig_conv.inner = untag_ptr(orig);
35380 orig_conv.is_owned = ptr_is_owned(orig);
35381 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35382 orig_conv.is_owned = false;
35383 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
35384 uint64_t ret_ref = 0;
35385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35390 int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) {
35391 LDKTxCreationKeys obj_conv;
35392 obj_conv.inner = untag_ptr(obj);
35393 obj_conv.is_owned = ptr_is_owned(obj);
35394 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35395 obj_conv.is_owned = false;
35396 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
35397 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35398 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35399 CVec_u8Z_free(ret_var);
35403 uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
35404 LDKu8slice ser_ref;
35405 ser_ref.datalen = ser->arr_len;
35406 ser_ref.data = ser->elems;
35407 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
35408 *ret_conv = TxCreationKeys_read(ser_ref);
35410 return tag_ptr(ret_conv, true);
35413 void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) {
35414 LDKChannelPublicKeys this_obj_conv;
35415 this_obj_conv.inner = untag_ptr(this_obj);
35416 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35418 ChannelPublicKeys_free(this_obj_conv);
35421 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) {
35422 LDKChannelPublicKeys this_ptr_conv;
35423 this_ptr_conv.inner = untag_ptr(this_ptr);
35424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35426 this_ptr_conv.is_owned = false;
35427 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35428 memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
35432 void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
35433 LDKChannelPublicKeys this_ptr_conv;
35434 this_ptr_conv.inner = untag_ptr(this_ptr);
35435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35437 this_ptr_conv.is_owned = false;
35438 LDKPublicKey val_ref;
35439 CHECK(val->arr_len == 33);
35440 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35441 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
35444 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) {
35445 LDKChannelPublicKeys this_ptr_conv;
35446 this_ptr_conv.inner = untag_ptr(this_ptr);
35447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35449 this_ptr_conv.is_owned = false;
35450 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35451 memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
35455 void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
35456 LDKChannelPublicKeys this_ptr_conv;
35457 this_ptr_conv.inner = untag_ptr(this_ptr);
35458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35460 this_ptr_conv.is_owned = false;
35461 LDKPublicKey val_ref;
35462 CHECK(val->arr_len == 33);
35463 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35464 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
35467 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) {
35468 LDKChannelPublicKeys this_ptr_conv;
35469 this_ptr_conv.inner = untag_ptr(this_ptr);
35470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35472 this_ptr_conv.is_owned = false;
35473 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35474 memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
35478 void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) {
35479 LDKChannelPublicKeys this_ptr_conv;
35480 this_ptr_conv.inner = untag_ptr(this_ptr);
35481 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35483 this_ptr_conv.is_owned = false;
35484 LDKPublicKey val_ref;
35485 CHECK(val->arr_len == 33);
35486 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35487 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
35490 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) {
35491 LDKChannelPublicKeys this_ptr_conv;
35492 this_ptr_conv.inner = untag_ptr(this_ptr);
35493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35495 this_ptr_conv.is_owned = false;
35496 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35497 memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
35501 void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
35502 LDKChannelPublicKeys this_ptr_conv;
35503 this_ptr_conv.inner = untag_ptr(this_ptr);
35504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35506 this_ptr_conv.is_owned = false;
35507 LDKPublicKey val_ref;
35508 CHECK(val->arr_len == 33);
35509 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35510 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
35513 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) {
35514 LDKChannelPublicKeys this_ptr_conv;
35515 this_ptr_conv.inner = untag_ptr(this_ptr);
35516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35518 this_ptr_conv.is_owned = false;
35519 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
35520 memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
35524 void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
35525 LDKChannelPublicKeys this_ptr_conv;
35526 this_ptr_conv.inner = untag_ptr(this_ptr);
35527 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35529 this_ptr_conv.is_owned = false;
35530 LDKPublicKey val_ref;
35531 CHECK(val->arr_len == 33);
35532 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
35533 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
35536 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) {
35537 LDKPublicKey funding_pubkey_arg_ref;
35538 CHECK(funding_pubkey_arg->arr_len == 33);
35539 memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg);
35540 LDKPublicKey revocation_basepoint_arg_ref;
35541 CHECK(revocation_basepoint_arg->arr_len == 33);
35542 memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg);
35543 LDKPublicKey payment_point_arg_ref;
35544 CHECK(payment_point_arg->arr_len == 33);
35545 memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg);
35546 LDKPublicKey delayed_payment_basepoint_arg_ref;
35547 CHECK(delayed_payment_basepoint_arg->arr_len == 33);
35548 memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg);
35549 LDKPublicKey htlc_basepoint_arg_ref;
35550 CHECK(htlc_basepoint_arg->arr_len == 33);
35551 memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg);
35552 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);
35553 uint64_t ret_ref = 0;
35554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35559 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
35560 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
35561 uint64_t ret_ref = 0;
35562 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35563 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35566 int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) {
35567 LDKChannelPublicKeys arg_conv;
35568 arg_conv.inner = untag_ptr(arg);
35569 arg_conv.is_owned = ptr_is_owned(arg);
35570 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35571 arg_conv.is_owned = false;
35572 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
35576 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) {
35577 LDKChannelPublicKeys orig_conv;
35578 orig_conv.inner = untag_ptr(orig);
35579 orig_conv.is_owned = ptr_is_owned(orig);
35580 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35581 orig_conv.is_owned = false;
35582 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
35583 uint64_t ret_ref = 0;
35584 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35585 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35589 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
35590 LDKChannelPublicKeys obj_conv;
35591 obj_conv.inner = untag_ptr(obj);
35592 obj_conv.is_owned = ptr_is_owned(obj);
35593 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35594 obj_conv.is_owned = false;
35595 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
35596 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35597 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35598 CVec_u8Z_free(ret_var);
35602 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
35603 LDKu8slice ser_ref;
35604 ser_ref.datalen = ser->arr_len;
35605 ser_ref.data = ser->elems;
35606 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
35607 *ret_conv = ChannelPublicKeys_read(ser_ref);
35609 return tag_ptr(ret_conv, true);
35612 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) {
35613 LDKPublicKey per_commitment_point_ref;
35614 CHECK(per_commitment_point->arr_len == 33);
35615 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
35616 LDKPublicKey broadcaster_delayed_payment_base_ref;
35617 CHECK(broadcaster_delayed_payment_base->arr_len == 33);
35618 memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base);
35619 LDKPublicKey broadcaster_htlc_base_ref;
35620 CHECK(broadcaster_htlc_base->arr_len == 33);
35621 memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base);
35622 LDKPublicKey countersignatory_revocation_base_ref;
35623 CHECK(countersignatory_revocation_base->arr_len == 33);
35624 memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base);
35625 LDKPublicKey countersignatory_htlc_base_ref;
35626 CHECK(countersignatory_htlc_base->arr_len == 33);
35627 memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
35628 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
35629 *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);
35630 return tag_ptr(ret_conv, true);
35633 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) {
35634 LDKPublicKey per_commitment_point_ref;
35635 CHECK(per_commitment_point->arr_len == 33);
35636 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
35637 LDKChannelPublicKeys broadcaster_keys_conv;
35638 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
35639 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
35640 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
35641 broadcaster_keys_conv.is_owned = false;
35642 LDKChannelPublicKeys countersignatory_keys_conv;
35643 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
35644 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
35645 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
35646 countersignatory_keys_conv.is_owned = false;
35647 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
35648 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
35649 return tag_ptr(ret_conv, true);
35652 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) {
35653 LDKPublicKey revocation_key_ref;
35654 CHECK(revocation_key->arr_len == 33);
35655 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
35656 LDKPublicKey broadcaster_delayed_payment_key_ref;
35657 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
35658 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
35659 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
35660 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35661 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35662 CVec_u8Z_free(ret_var);
35666 void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) {
35667 LDKHTLCOutputInCommitment this_obj_conv;
35668 this_obj_conv.inner = untag_ptr(this_obj);
35669 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35671 HTLCOutputInCommitment_free(this_obj_conv);
35674 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) {
35675 LDKHTLCOutputInCommitment this_ptr_conv;
35676 this_ptr_conv.inner = untag_ptr(this_ptr);
35677 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35679 this_ptr_conv.is_owned = false;
35680 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
35684 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) {
35685 LDKHTLCOutputInCommitment this_ptr_conv;
35686 this_ptr_conv.inner = untag_ptr(this_ptr);
35687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35689 this_ptr_conv.is_owned = false;
35690 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
35693 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) {
35694 LDKHTLCOutputInCommitment this_ptr_conv;
35695 this_ptr_conv.inner = untag_ptr(this_ptr);
35696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35698 this_ptr_conv.is_owned = false;
35699 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
35703 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) {
35704 LDKHTLCOutputInCommitment this_ptr_conv;
35705 this_ptr_conv.inner = untag_ptr(this_ptr);
35706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35708 this_ptr_conv.is_owned = false;
35709 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
35712 int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) {
35713 LDKHTLCOutputInCommitment this_ptr_conv;
35714 this_ptr_conv.inner = untag_ptr(this_ptr);
35715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35717 this_ptr_conv.is_owned = false;
35718 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
35722 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
35723 LDKHTLCOutputInCommitment this_ptr_conv;
35724 this_ptr_conv.inner = untag_ptr(this_ptr);
35725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35727 this_ptr_conv.is_owned = false;
35728 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
35731 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) {
35732 LDKHTLCOutputInCommitment this_ptr_conv;
35733 this_ptr_conv.inner = untag_ptr(this_ptr);
35734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35736 this_ptr_conv.is_owned = false;
35737 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35738 memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32);
35742 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
35743 LDKHTLCOutputInCommitment this_ptr_conv;
35744 this_ptr_conv.inner = untag_ptr(this_ptr);
35745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35747 this_ptr_conv.is_owned = false;
35748 LDKThirtyTwoBytes val_ref;
35749 CHECK(val->arr_len == 32);
35750 memcpy(val_ref.data, val->elems, 32); FREE(val);
35751 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
35754 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) {
35755 LDKHTLCOutputInCommitment this_ptr_conv;
35756 this_ptr_conv.inner = untag_ptr(this_ptr);
35757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35759 this_ptr_conv.is_owned = false;
35760 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
35761 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
35762 uint64_t ret_ref = tag_ptr(ret_copy, true);
35766 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) {
35767 LDKHTLCOutputInCommitment this_ptr_conv;
35768 this_ptr_conv.inner = untag_ptr(this_ptr);
35769 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35771 this_ptr_conv.is_owned = false;
35772 void* val_ptr = untag_ptr(val);
35773 CHECK_ACCESS(val_ptr);
35774 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
35775 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
35776 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
35779 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) {
35780 LDKThirtyTwoBytes payment_hash_arg_ref;
35781 CHECK(payment_hash_arg->arr_len == 32);
35782 memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg);
35783 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
35784 CHECK_ACCESS(transaction_output_index_arg_ptr);
35785 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
35786 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
35787 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
35788 uint64_t ret_ref = 0;
35789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35794 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
35795 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
35796 uint64_t ret_ref = 0;
35797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35801 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) {
35802 LDKHTLCOutputInCommitment arg_conv;
35803 arg_conv.inner = untag_ptr(arg);
35804 arg_conv.is_owned = ptr_is_owned(arg);
35805 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35806 arg_conv.is_owned = false;
35807 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
35811 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) {
35812 LDKHTLCOutputInCommitment orig_conv;
35813 orig_conv.inner = untag_ptr(orig);
35814 orig_conv.is_owned = ptr_is_owned(orig);
35815 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35816 orig_conv.is_owned = false;
35817 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
35818 uint64_t ret_ref = 0;
35819 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35820 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35824 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
35825 LDKHTLCOutputInCommitment obj_conv;
35826 obj_conv.inner = untag_ptr(obj);
35827 obj_conv.is_owned = ptr_is_owned(obj);
35828 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35829 obj_conv.is_owned = false;
35830 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
35831 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35832 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35833 CVec_u8Z_free(ret_var);
35837 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
35838 LDKu8slice ser_ref;
35839 ser_ref.datalen = ser->arr_len;
35840 ser_ref.data = ser->elems;
35841 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
35842 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
35844 return tag_ptr(ret_conv, true);
35847 int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) {
35848 LDKHTLCOutputInCommitment htlc_conv;
35849 htlc_conv.inner = untag_ptr(htlc);
35850 htlc_conv.is_owned = ptr_is_owned(htlc);
35851 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
35852 htlc_conv.is_owned = false;
35853 LDKTxCreationKeys keys_conv;
35854 keys_conv.inner = untag_ptr(keys);
35855 keys_conv.is_owned = ptr_is_owned(keys);
35856 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
35857 keys_conv.is_owned = false;
35858 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
35859 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35860 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35861 CVec_u8Z_free(ret_var);
35865 int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
35866 LDKPublicKey broadcaster_ref;
35867 CHECK(broadcaster->arr_len == 33);
35868 memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster);
35869 LDKPublicKey countersignatory_ref;
35870 CHECK(countersignatory->arr_len == 33);
35871 memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory);
35872 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
35873 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35874 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35875 CVec_u8Z_free(ret_var);
35879 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) {
35880 unsigned char commitment_txid_arr[32];
35881 CHECK(commitment_txid->arr_len == 32);
35882 memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
35883 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
35884 LDKHTLCOutputInCommitment htlc_conv;
35885 htlc_conv.inner = untag_ptr(htlc);
35886 htlc_conv.is_owned = ptr_is_owned(htlc);
35887 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
35888 htlc_conv.is_owned = false;
35889 LDKPublicKey broadcaster_delayed_payment_key_ref;
35890 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
35891 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
35892 LDKPublicKey revocation_key_ref;
35893 CHECK(revocation_key->arr_len == 33);
35894 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
35895 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);
35896 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35897 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35898 Transaction_free(ret_var);
35902 int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
35903 LDKPublicKey funding_pubkey_ref;
35904 CHECK(funding_pubkey->arr_len == 33);
35905 memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey);
35906 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
35907 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35908 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35909 CVec_u8Z_free(ret_var);
35913 void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
35914 LDKChannelTransactionParameters this_obj_conv;
35915 this_obj_conv.inner = untag_ptr(this_obj);
35916 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35918 ChannelTransactionParameters_free(this_obj_conv);
35921 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint64_t this_ptr) {
35922 LDKChannelTransactionParameters this_ptr_conv;
35923 this_ptr_conv.inner = untag_ptr(this_ptr);
35924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35926 this_ptr_conv.is_owned = false;
35927 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
35928 uint64_t ret_ref = 0;
35929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35934 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_t val) {
35935 LDKChannelTransactionParameters this_ptr_conv;
35936 this_ptr_conv.inner = untag_ptr(this_ptr);
35937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35939 this_ptr_conv.is_owned = false;
35940 LDKChannelPublicKeys val_conv;
35941 val_conv.inner = untag_ptr(val);
35942 val_conv.is_owned = ptr_is_owned(val);
35943 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35944 val_conv = ChannelPublicKeys_clone(&val_conv);
35945 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
35948 int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(uint64_t this_ptr) {
35949 LDKChannelTransactionParameters this_ptr_conv;
35950 this_ptr_conv.inner = untag_ptr(this_ptr);
35951 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35953 this_ptr_conv.is_owned = false;
35954 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
35958 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) {
35959 LDKChannelTransactionParameters this_ptr_conv;
35960 this_ptr_conv.inner = untag_ptr(this_ptr);
35961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35963 this_ptr_conv.is_owned = false;
35964 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
35967 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(uint64_t this_ptr) {
35968 LDKChannelTransactionParameters this_ptr_conv;
35969 this_ptr_conv.inner = untag_ptr(this_ptr);
35970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35972 this_ptr_conv.is_owned = false;
35973 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
35977 void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean val) {
35978 LDKChannelTransactionParameters this_ptr_conv;
35979 this_ptr_conv.inner = untag_ptr(this_ptr);
35980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35982 this_ptr_conv.is_owned = false;
35983 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
35986 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(uint64_t this_ptr) {
35987 LDKChannelTransactionParameters this_ptr_conv;
35988 this_ptr_conv.inner = untag_ptr(this_ptr);
35989 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35991 this_ptr_conv.is_owned = false;
35992 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
35993 uint64_t ret_ref = 0;
35994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35999 void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_t val) {
36000 LDKChannelTransactionParameters this_ptr_conv;
36001 this_ptr_conv.inner = untag_ptr(this_ptr);
36002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36004 this_ptr_conv.is_owned = false;
36005 LDKCounterpartyChannelTransactionParameters val_conv;
36006 val_conv.inner = untag_ptr(val);
36007 val_conv.is_owned = ptr_is_owned(val);
36008 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36009 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
36010 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
36013 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(uint64_t this_ptr) {
36014 LDKChannelTransactionParameters this_ptr_conv;
36015 this_ptr_conv.inner = untag_ptr(this_ptr);
36016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36018 this_ptr_conv.is_owned = false;
36019 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
36020 uint64_t ret_ref = 0;
36021 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36022 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36026 void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_t val) {
36027 LDKChannelTransactionParameters this_ptr_conv;
36028 this_ptr_conv.inner = untag_ptr(this_ptr);
36029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36031 this_ptr_conv.is_owned = false;
36032 LDKOutPoint val_conv;
36033 val_conv.inner = untag_ptr(val);
36034 val_conv.is_owned = ptr_is_owned(val);
36035 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36036 val_conv = OutPoint_clone(&val_conv);
36037 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
36040 uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_anchors(uint64_t this_ptr) {
36041 LDKChannelTransactionParameters this_ptr_conv;
36042 this_ptr_conv.inner = untag_ptr(this_ptr);
36043 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36045 this_ptr_conv.is_owned = false;
36046 uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
36050 void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_anchors(uint64_t this_ptr, uint32_t val) {
36051 LDKChannelTransactionParameters this_ptr_conv;
36052 this_ptr_conv.inner = untag_ptr(this_ptr);
36053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36055 this_ptr_conv.is_owned = false;
36056 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
36057 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
36060 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) {
36061 LDKChannelPublicKeys holder_pubkeys_arg_conv;
36062 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
36063 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
36064 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
36065 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
36066 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
36067 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
36068 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
36069 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
36070 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
36071 LDKOutPoint funding_outpoint_arg_conv;
36072 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
36073 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
36074 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
36075 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
36076 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
36077 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);
36078 uint64_t ret_ref = 0;
36079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36084 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
36085 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
36086 uint64_t ret_ref = 0;
36087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36088 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36091 int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) {
36092 LDKChannelTransactionParameters arg_conv;
36093 arg_conv.inner = untag_ptr(arg);
36094 arg_conv.is_owned = ptr_is_owned(arg);
36095 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36096 arg_conv.is_owned = false;
36097 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
36101 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) {
36102 LDKChannelTransactionParameters orig_conv;
36103 orig_conv.inner = untag_ptr(orig);
36104 orig_conv.is_owned = ptr_is_owned(orig);
36105 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36106 orig_conv.is_owned = false;
36107 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
36108 uint64_t ret_ref = 0;
36109 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36110 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36114 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) {
36115 LDKCounterpartyChannelTransactionParameters this_obj_conv;
36116 this_obj_conv.inner = untag_ptr(this_obj);
36117 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36119 CounterpartyChannelTransactionParameters_free(this_obj_conv);
36122 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) {
36123 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
36124 this_ptr_conv.inner = untag_ptr(this_ptr);
36125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36127 this_ptr_conv.is_owned = false;
36128 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
36129 uint64_t ret_ref = 0;
36130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36135 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) {
36136 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
36137 this_ptr_conv.inner = untag_ptr(this_ptr);
36138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36140 this_ptr_conv.is_owned = false;
36141 LDKChannelPublicKeys val_conv;
36142 val_conv.inner = untag_ptr(val);
36143 val_conv.is_owned = ptr_is_owned(val);
36144 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36145 val_conv = ChannelPublicKeys_clone(&val_conv);
36146 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
36149 int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) {
36150 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
36151 this_ptr_conv.inner = untag_ptr(this_ptr);
36152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36154 this_ptr_conv.is_owned = false;
36155 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
36159 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) {
36160 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
36161 this_ptr_conv.inner = untag_ptr(this_ptr);
36162 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36164 this_ptr_conv.is_owned = false;
36165 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
36168 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
36169 LDKChannelPublicKeys pubkeys_arg_conv;
36170 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
36171 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
36172 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
36173 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
36174 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
36175 uint64_t ret_ref = 0;
36176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36181 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
36182 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
36183 uint64_t ret_ref = 0;
36184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36188 int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) {
36189 LDKCounterpartyChannelTransactionParameters arg_conv;
36190 arg_conv.inner = untag_ptr(arg);
36191 arg_conv.is_owned = ptr_is_owned(arg);
36192 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36193 arg_conv.is_owned = false;
36194 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
36198 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) {
36199 LDKCounterpartyChannelTransactionParameters orig_conv;
36200 orig_conv.inner = untag_ptr(orig);
36201 orig_conv.is_owned = ptr_is_owned(orig);
36202 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36203 orig_conv.is_owned = false;
36204 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
36205 uint64_t ret_ref = 0;
36206 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36207 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36211 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) {
36212 LDKChannelTransactionParameters this_arg_conv;
36213 this_arg_conv.inner = untag_ptr(this_arg);
36214 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36216 this_arg_conv.is_owned = false;
36217 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
36221 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) {
36222 LDKChannelTransactionParameters this_arg_conv;
36223 this_arg_conv.inner = untag_ptr(this_arg);
36224 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36226 this_arg_conv.is_owned = false;
36227 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
36228 uint64_t ret_ref = 0;
36229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36234 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) {
36235 LDKChannelTransactionParameters this_arg_conv;
36236 this_arg_conv.inner = untag_ptr(this_arg);
36237 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36239 this_arg_conv.is_owned = false;
36240 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
36241 uint64_t ret_ref = 0;
36242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36247 int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) {
36248 LDKCounterpartyChannelTransactionParameters obj_conv;
36249 obj_conv.inner = untag_ptr(obj);
36250 obj_conv.is_owned = ptr_is_owned(obj);
36251 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36252 obj_conv.is_owned = false;
36253 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
36254 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36255 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36256 CVec_u8Z_free(ret_var);
36260 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
36261 LDKu8slice ser_ref;
36262 ser_ref.datalen = ser->arr_len;
36263 ser_ref.data = ser->elems;
36264 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
36265 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
36267 return tag_ptr(ret_conv, true);
36270 int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) {
36271 LDKChannelTransactionParameters obj_conv;
36272 obj_conv.inner = untag_ptr(obj);
36273 obj_conv.is_owned = ptr_is_owned(obj);
36274 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36275 obj_conv.is_owned = false;
36276 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
36277 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36278 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36279 CVec_u8Z_free(ret_var);
36283 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
36284 LDKu8slice ser_ref;
36285 ser_ref.datalen = ser->arr_len;
36286 ser_ref.data = ser->elems;
36287 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
36288 *ret_conv = ChannelTransactionParameters_read(ser_ref);
36290 return tag_ptr(ret_conv, true);
36293 void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) {
36294 LDKDirectedChannelTransactionParameters this_obj_conv;
36295 this_obj_conv.inner = untag_ptr(this_obj);
36296 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36298 DirectedChannelTransactionParameters_free(this_obj_conv);
36301 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) {
36302 LDKDirectedChannelTransactionParameters this_arg_conv;
36303 this_arg_conv.inner = untag_ptr(this_arg);
36304 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36306 this_arg_conv.is_owned = false;
36307 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
36308 uint64_t ret_ref = 0;
36309 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36310 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36314 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) {
36315 LDKDirectedChannelTransactionParameters this_arg_conv;
36316 this_arg_conv.inner = untag_ptr(this_arg);
36317 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36319 this_arg_conv.is_owned = false;
36320 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
36321 uint64_t ret_ref = 0;
36322 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36323 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36327 int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) {
36328 LDKDirectedChannelTransactionParameters this_arg_conv;
36329 this_arg_conv.inner = untag_ptr(this_arg);
36330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36332 this_arg_conv.is_owned = false;
36333 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
36337 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) {
36338 LDKDirectedChannelTransactionParameters this_arg_conv;
36339 this_arg_conv.inner = untag_ptr(this_arg);
36340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36342 this_arg_conv.is_owned = false;
36343 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
36347 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) {
36348 LDKDirectedChannelTransactionParameters this_arg_conv;
36349 this_arg_conv.inner = untag_ptr(this_arg);
36350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36352 this_arg_conv.is_owned = false;
36353 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
36354 uint64_t ret_ref = 0;
36355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36360 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) {
36361 LDKDirectedChannelTransactionParameters this_arg_conv;
36362 this_arg_conv.inner = untag_ptr(this_arg);
36363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36365 this_arg_conv.is_owned = false;
36366 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
36370 void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) {
36371 LDKHolderCommitmentTransaction this_obj_conv;
36372 this_obj_conv.inner = untag_ptr(this_obj);
36373 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36375 HolderCommitmentTransaction_free(this_obj_conv);
36378 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) {
36379 LDKHolderCommitmentTransaction this_ptr_conv;
36380 this_ptr_conv.inner = untag_ptr(this_ptr);
36381 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36383 this_ptr_conv.is_owned = false;
36384 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
36385 memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
36389 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) {
36390 LDKHolderCommitmentTransaction this_ptr_conv;
36391 this_ptr_conv.inner = untag_ptr(this_ptr);
36392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36394 this_ptr_conv.is_owned = false;
36395 LDKSignature val_ref;
36396 CHECK(val->arr_len == 64);
36397 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
36398 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
36401 ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) {
36402 LDKHolderCommitmentTransaction this_ptr_conv;
36403 this_ptr_conv.inner = untag_ptr(this_ptr);
36404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36406 this_ptr_conv.is_owned = false;
36407 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
36408 ptrArray ret_arr = NULL;
36409 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
36410 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
36411 for (size_t m = 0; m < ret_var.datalen; m++) {
36412 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
36413 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
36414 ret_arr_ptr[m] = ret_conv_12_arr;
36417 FREE(ret_var.data);
36421 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) {
36422 LDKHolderCommitmentTransaction this_ptr_conv;
36423 this_ptr_conv.inner = untag_ptr(this_ptr);
36424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36426 this_ptr_conv.is_owned = false;
36427 LDKCVec_SignatureZ val_constr;
36428 val_constr.datalen = val->arr_len;
36429 if (val_constr.datalen > 0)
36430 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
36432 val_constr.data = NULL;
36433 int8_tArray* val_vals = (void*) val->elems;
36434 for (size_t m = 0; m < val_constr.datalen; m++) {
36435 int8_tArray val_conv_12 = val_vals[m];
36436 LDKSignature val_conv_12_ref;
36437 CHECK(val_conv_12->arr_len == 64);
36438 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
36439 val_constr.data[m] = val_conv_12_ref;
36442 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
36445 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
36446 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
36447 uint64_t ret_ref = 0;
36448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36452 int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) {
36453 LDKHolderCommitmentTransaction arg_conv;
36454 arg_conv.inner = untag_ptr(arg);
36455 arg_conv.is_owned = ptr_is_owned(arg);
36456 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36457 arg_conv.is_owned = false;
36458 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
36462 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) {
36463 LDKHolderCommitmentTransaction orig_conv;
36464 orig_conv.inner = untag_ptr(orig);
36465 orig_conv.is_owned = ptr_is_owned(orig);
36466 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36467 orig_conv.is_owned = false;
36468 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
36469 uint64_t ret_ref = 0;
36470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36475 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) {
36476 LDKHolderCommitmentTransaction obj_conv;
36477 obj_conv.inner = untag_ptr(obj);
36478 obj_conv.is_owned = ptr_is_owned(obj);
36479 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36480 obj_conv.is_owned = false;
36481 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
36482 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36483 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36484 CVec_u8Z_free(ret_var);
36488 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
36489 LDKu8slice ser_ref;
36490 ser_ref.datalen = ser->arr_len;
36491 ser_ref.data = ser->elems;
36492 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
36493 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
36495 return tag_ptr(ret_conv, true);
36498 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) {
36499 LDKCommitmentTransaction commitment_tx_conv;
36500 commitment_tx_conv.inner = untag_ptr(commitment_tx);
36501 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
36502 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
36503 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
36504 LDKSignature counterparty_sig_ref;
36505 CHECK(counterparty_sig->arr_len == 64);
36506 memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig);
36507 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
36508 counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len;
36509 if (counterparty_htlc_sigs_constr.datalen > 0)
36510 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
36512 counterparty_htlc_sigs_constr.data = NULL;
36513 int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
36514 for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
36515 int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
36516 LDKSignature counterparty_htlc_sigs_conv_12_ref;
36517 CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64);
36518 memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
36519 counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
36521 FREE(counterparty_htlc_sigs);
36522 LDKPublicKey holder_funding_key_ref;
36523 CHECK(holder_funding_key->arr_len == 33);
36524 memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
36525 LDKPublicKey counterparty_funding_key_ref;
36526 CHECK(counterparty_funding_key->arr_len == 33);
36527 memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key);
36528 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
36529 uint64_t ret_ref = 0;
36530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36535 void __attribute__((export_name("TS_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) {
36536 LDKBuiltCommitmentTransaction this_obj_conv;
36537 this_obj_conv.inner = untag_ptr(this_obj);
36538 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36540 BuiltCommitmentTransaction_free(this_obj_conv);
36543 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) {
36544 LDKBuiltCommitmentTransaction this_ptr_conv;
36545 this_ptr_conv.inner = untag_ptr(this_ptr);
36546 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36548 this_ptr_conv.is_owned = false;
36549 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
36550 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36551 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36552 Transaction_free(ret_var);
36556 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) {
36557 LDKBuiltCommitmentTransaction this_ptr_conv;
36558 this_ptr_conv.inner = untag_ptr(this_ptr);
36559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36561 this_ptr_conv.is_owned = false;
36562 LDKTransaction val_ref;
36563 val_ref.datalen = val->arr_len;
36564 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
36565 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
36566 val_ref.data_is_owned = true;
36567 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
36570 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) {
36571 LDKBuiltCommitmentTransaction this_ptr_conv;
36572 this_ptr_conv.inner = untag_ptr(this_ptr);
36573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36575 this_ptr_conv.is_owned = false;
36576 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
36577 memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32);
36581 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) {
36582 LDKBuiltCommitmentTransaction this_ptr_conv;
36583 this_ptr_conv.inner = untag_ptr(this_ptr);
36584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36586 this_ptr_conv.is_owned = false;
36587 LDKThirtyTwoBytes val_ref;
36588 CHECK(val->arr_len == 32);
36589 memcpy(val_ref.data, val->elems, 32); FREE(val);
36590 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
36593 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) {
36594 LDKTransaction transaction_arg_ref;
36595 transaction_arg_ref.datalen = transaction_arg->arr_len;
36596 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
36597 memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg);
36598 transaction_arg_ref.data_is_owned = true;
36599 LDKThirtyTwoBytes txid_arg_ref;
36600 CHECK(txid_arg->arr_len == 32);
36601 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
36602 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
36603 uint64_t ret_ref = 0;
36604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36609 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
36610 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
36611 uint64_t ret_ref = 0;
36612 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36613 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36616 int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) {
36617 LDKBuiltCommitmentTransaction arg_conv;
36618 arg_conv.inner = untag_ptr(arg);
36619 arg_conv.is_owned = ptr_is_owned(arg);
36620 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36621 arg_conv.is_owned = false;
36622 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
36626 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) {
36627 LDKBuiltCommitmentTransaction orig_conv;
36628 orig_conv.inner = untag_ptr(orig);
36629 orig_conv.is_owned = ptr_is_owned(orig);
36630 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36631 orig_conv.is_owned = false;
36632 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
36633 uint64_t ret_ref = 0;
36634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36639 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) {
36640 LDKBuiltCommitmentTransaction obj_conv;
36641 obj_conv.inner = untag_ptr(obj);
36642 obj_conv.is_owned = ptr_is_owned(obj);
36643 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36644 obj_conv.is_owned = false;
36645 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
36646 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36647 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36648 CVec_u8Z_free(ret_var);
36652 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
36653 LDKu8slice ser_ref;
36654 ser_ref.datalen = ser->arr_len;
36655 ser_ref.data = ser->elems;
36656 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
36657 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
36659 return tag_ptr(ret_conv, true);
36662 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) {
36663 LDKBuiltCommitmentTransaction this_arg_conv;
36664 this_arg_conv.inner = untag_ptr(this_arg);
36665 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36667 this_arg_conv.is_owned = false;
36668 LDKu8slice funding_redeemscript_ref;
36669 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
36670 funding_redeemscript_ref.data = funding_redeemscript->elems;
36671 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
36672 memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
36673 FREE(funding_redeemscript);
36677 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) {
36678 LDKBuiltCommitmentTransaction this_arg_conv;
36679 this_arg_conv.inner = untag_ptr(this_arg);
36680 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36682 this_arg_conv.is_owned = false;
36683 unsigned char funding_key_arr[32];
36684 CHECK(funding_key->arr_len == 32);
36685 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
36686 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
36687 LDKu8slice funding_redeemscript_ref;
36688 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
36689 funding_redeemscript_ref.data = funding_redeemscript->elems;
36690 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
36691 memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
36692 FREE(funding_redeemscript);
36696 void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) {
36697 LDKClosingTransaction this_obj_conv;
36698 this_obj_conv.inner = untag_ptr(this_obj);
36699 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36701 ClosingTransaction_free(this_obj_conv);
36704 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
36705 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
36706 uint64_t ret_ref = 0;
36707 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36708 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36711 int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) {
36712 LDKClosingTransaction arg_conv;
36713 arg_conv.inner = untag_ptr(arg);
36714 arg_conv.is_owned = ptr_is_owned(arg);
36715 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36716 arg_conv.is_owned = false;
36717 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
36721 uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) {
36722 LDKClosingTransaction orig_conv;
36723 orig_conv.inner = untag_ptr(orig);
36724 orig_conv.is_owned = ptr_is_owned(orig);
36725 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36726 orig_conv.is_owned = false;
36727 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
36728 uint64_t ret_ref = 0;
36729 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36730 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36734 int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) {
36735 LDKClosingTransaction o_conv;
36736 o_conv.inner = untag_ptr(o);
36737 o_conv.is_owned = ptr_is_owned(o);
36738 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
36739 o_conv.is_owned = false;
36740 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
36744 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) {
36745 LDKCVec_u8Z to_holder_script_ref;
36746 to_holder_script_ref.datalen = to_holder_script->arr_len;
36747 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
36748 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
36749 LDKCVec_u8Z to_counterparty_script_ref;
36750 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
36751 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
36752 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
36753 LDKOutPoint funding_outpoint_conv;
36754 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
36755 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
36756 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
36757 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
36758 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
36759 uint64_t ret_ref = 0;
36760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36765 uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) {
36766 LDKClosingTransaction this_arg_conv;
36767 this_arg_conv.inner = untag_ptr(this_arg);
36768 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36770 this_arg_conv.is_owned = false;
36771 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
36772 uint64_t ret_ref = 0;
36773 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36774 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36778 uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) {
36779 LDKClosingTransaction this_arg_conv;
36780 this_arg_conv.inner = untag_ptr(this_arg);
36781 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36783 this_arg_conv.is_owned = false;
36784 LDKOutPoint funding_outpoint_conv;
36785 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
36786 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
36787 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
36788 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
36789 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
36790 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
36791 return tag_ptr(ret_conv, true);
36794 int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) {
36795 LDKClosingTransaction this_arg_conv;
36796 this_arg_conv.inner = untag_ptr(this_arg);
36797 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36799 this_arg_conv.is_owned = false;
36800 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
36804 int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) {
36805 LDKClosingTransaction this_arg_conv;
36806 this_arg_conv.inner = untag_ptr(this_arg);
36807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36809 this_arg_conv.is_owned = false;
36810 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
36814 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) {
36815 LDKClosingTransaction this_arg_conv;
36816 this_arg_conv.inner = untag_ptr(this_arg);
36817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36819 this_arg_conv.is_owned = false;
36820 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
36821 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36822 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36826 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) {
36827 LDKClosingTransaction this_arg_conv;
36828 this_arg_conv.inner = untag_ptr(this_arg);
36829 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36831 this_arg_conv.is_owned = false;
36832 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
36833 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36834 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36838 void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) {
36839 LDKTrustedClosingTransaction this_obj_conv;
36840 this_obj_conv.inner = untag_ptr(this_obj);
36841 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36842 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36843 TrustedClosingTransaction_free(this_obj_conv);
36846 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) {
36847 LDKTrustedClosingTransaction this_arg_conv;
36848 this_arg_conv.inner = untag_ptr(this_arg);
36849 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36851 this_arg_conv.is_owned = false;
36852 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
36853 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36854 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36855 Transaction_free(ret_var);
36859 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) {
36860 LDKTrustedClosingTransaction this_arg_conv;
36861 this_arg_conv.inner = untag_ptr(this_arg);
36862 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36864 this_arg_conv.is_owned = false;
36865 LDKu8slice funding_redeemscript_ref;
36866 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
36867 funding_redeemscript_ref.data = funding_redeemscript->elems;
36868 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
36869 memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
36870 FREE(funding_redeemscript);
36874 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) {
36875 LDKTrustedClosingTransaction this_arg_conv;
36876 this_arg_conv.inner = untag_ptr(this_arg);
36877 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36879 this_arg_conv.is_owned = false;
36880 unsigned char funding_key_arr[32];
36881 CHECK(funding_key->arr_len == 32);
36882 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
36883 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
36884 LDKu8slice funding_redeemscript_ref;
36885 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
36886 funding_redeemscript_ref.data = funding_redeemscript->elems;
36887 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
36888 memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
36889 FREE(funding_redeemscript);
36893 void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) {
36894 LDKCommitmentTransaction this_obj_conv;
36895 this_obj_conv.inner = untag_ptr(this_obj);
36896 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36897 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36898 CommitmentTransaction_free(this_obj_conv);
36901 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
36902 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
36903 uint64_t ret_ref = 0;
36904 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36905 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36908 int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) {
36909 LDKCommitmentTransaction arg_conv;
36910 arg_conv.inner = untag_ptr(arg);
36911 arg_conv.is_owned = ptr_is_owned(arg);
36912 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36913 arg_conv.is_owned = false;
36914 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
36918 uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) {
36919 LDKCommitmentTransaction orig_conv;
36920 orig_conv.inner = untag_ptr(orig);
36921 orig_conv.is_owned = ptr_is_owned(orig);
36922 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36923 orig_conv.is_owned = false;
36924 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
36925 uint64_t ret_ref = 0;
36926 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36927 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36931 int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) {
36932 LDKCommitmentTransaction obj_conv;
36933 obj_conv.inner = untag_ptr(obj);
36934 obj_conv.is_owned = ptr_is_owned(obj);
36935 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36936 obj_conv.is_owned = false;
36937 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
36938 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36939 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36940 CVec_u8Z_free(ret_var);
36944 uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
36945 LDKu8slice ser_ref;
36946 ser_ref.datalen = ser->arr_len;
36947 ser_ref.data = ser->elems;
36948 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
36949 *ret_conv = CommitmentTransaction_read(ser_ref);
36951 return tag_ptr(ret_conv, true);
36954 int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) {
36955 LDKCommitmentTransaction this_arg_conv;
36956 this_arg_conv.inner = untag_ptr(this_arg);
36957 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36959 this_arg_conv.is_owned = false;
36960 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
36964 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) {
36965 LDKCommitmentTransaction this_arg_conv;
36966 this_arg_conv.inner = untag_ptr(this_arg);
36967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36969 this_arg_conv.is_owned = false;
36970 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
36974 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) {
36975 LDKCommitmentTransaction this_arg_conv;
36976 this_arg_conv.inner = untag_ptr(this_arg);
36977 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36979 this_arg_conv.is_owned = false;
36980 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
36984 int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) {
36985 LDKCommitmentTransaction this_arg_conv;
36986 this_arg_conv.inner = untag_ptr(this_arg);
36987 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36989 this_arg_conv.is_owned = false;
36990 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
36994 uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) {
36995 LDKCommitmentTransaction this_arg_conv;
36996 this_arg_conv.inner = untag_ptr(this_arg);
36997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36999 this_arg_conv.is_owned = false;
37000 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
37001 uint64_t ret_ref = 0;
37002 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37003 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37007 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) {
37008 LDKCommitmentTransaction this_arg_conv;
37009 this_arg_conv.inner = untag_ptr(this_arg);
37010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37012 this_arg_conv.is_owned = false;
37013 LDKDirectedChannelTransactionParameters channel_parameters_conv;
37014 channel_parameters_conv.inner = untag_ptr(channel_parameters);
37015 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
37016 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
37017 channel_parameters_conv.is_owned = false;
37018 LDKChannelPublicKeys broadcaster_keys_conv;
37019 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
37020 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
37021 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
37022 broadcaster_keys_conv.is_owned = false;
37023 LDKChannelPublicKeys countersignatory_keys_conv;
37024 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
37025 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
37026 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
37027 countersignatory_keys_conv.is_owned = false;
37028 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
37029 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
37030 return tag_ptr(ret_conv, true);
37033 void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) {
37034 LDKTrustedCommitmentTransaction this_obj_conv;
37035 this_obj_conv.inner = untag_ptr(this_obj);
37036 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37038 TrustedCommitmentTransaction_free(this_obj_conv);
37041 int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) {
37042 LDKTrustedCommitmentTransaction this_arg_conv;
37043 this_arg_conv.inner = untag_ptr(this_arg);
37044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37046 this_arg_conv.is_owned = false;
37047 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
37048 memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
37052 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) {
37053 LDKTrustedCommitmentTransaction this_arg_conv;
37054 this_arg_conv.inner = untag_ptr(this_arg);
37055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37057 this_arg_conv.is_owned = false;
37058 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
37059 uint64_t ret_ref = 0;
37060 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37061 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37065 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) {
37066 LDKTrustedCommitmentTransaction this_arg_conv;
37067 this_arg_conv.inner = untag_ptr(this_arg);
37068 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37070 this_arg_conv.is_owned = false;
37071 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
37072 uint64_t ret_ref = 0;
37073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37078 jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) {
37079 LDKTrustedCommitmentTransaction this_arg_conv;
37080 this_arg_conv.inner = untag_ptr(this_arg);
37081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37083 this_arg_conv.is_owned = false;
37084 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
37088 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) {
37089 LDKTrustedCommitmentTransaction this_arg_conv;
37090 this_arg_conv.inner = untag_ptr(this_arg);
37091 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37093 this_arg_conv.is_owned = false;
37094 unsigned char htlc_base_key_arr[32];
37095 CHECK(htlc_base_key->arr_len == 32);
37096 memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
37097 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
37098 LDKDirectedChannelTransactionParameters channel_parameters_conv;
37099 channel_parameters_conv.inner = untag_ptr(channel_parameters);
37100 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
37101 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
37102 channel_parameters_conv.is_owned = false;
37103 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
37104 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
37105 return tag_ptr(ret_conv, true);
37108 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) {
37109 LDKPublicKey broadcaster_payment_basepoint_ref;
37110 CHECK(broadcaster_payment_basepoint->arr_len == 33);
37111 memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint);
37112 LDKPublicKey countersignatory_payment_basepoint_ref;
37113 CHECK(countersignatory_payment_basepoint->arr_len == 33);
37114 memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint);
37115 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
37119 jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) {
37120 LDKInitFeatures a_conv;
37121 a_conv.inner = untag_ptr(a);
37122 a_conv.is_owned = ptr_is_owned(a);
37123 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37124 a_conv.is_owned = false;
37125 LDKInitFeatures b_conv;
37126 b_conv.inner = untag_ptr(b);
37127 b_conv.is_owned = ptr_is_owned(b);
37128 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37129 b_conv.is_owned = false;
37130 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
37134 jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) {
37135 LDKNodeFeatures a_conv;
37136 a_conv.inner = untag_ptr(a);
37137 a_conv.is_owned = ptr_is_owned(a);
37138 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37139 a_conv.is_owned = false;
37140 LDKNodeFeatures b_conv;
37141 b_conv.inner = untag_ptr(b);
37142 b_conv.is_owned = ptr_is_owned(b);
37143 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37144 b_conv.is_owned = false;
37145 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
37149 jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) {
37150 LDKChannelFeatures a_conv;
37151 a_conv.inner = untag_ptr(a);
37152 a_conv.is_owned = ptr_is_owned(a);
37153 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37154 a_conv.is_owned = false;
37155 LDKChannelFeatures b_conv;
37156 b_conv.inner = untag_ptr(b);
37157 b_conv.is_owned = ptr_is_owned(b);
37158 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37159 b_conv.is_owned = false;
37160 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
37164 jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) {
37165 LDKInvoiceFeatures a_conv;
37166 a_conv.inner = untag_ptr(a);
37167 a_conv.is_owned = ptr_is_owned(a);
37168 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37169 a_conv.is_owned = false;
37170 LDKInvoiceFeatures b_conv;
37171 b_conv.inner = untag_ptr(b);
37172 b_conv.is_owned = ptr_is_owned(b);
37173 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37174 b_conv.is_owned = false;
37175 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
37179 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
37180 LDKChannelTypeFeatures a_conv;
37181 a_conv.inner = untag_ptr(a);
37182 a_conv.is_owned = ptr_is_owned(a);
37183 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37184 a_conv.is_owned = false;
37185 LDKChannelTypeFeatures b_conv;
37186 b_conv.inner = untag_ptr(b);
37187 b_conv.is_owned = ptr_is_owned(b);
37188 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37189 b_conv.is_owned = false;
37190 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
37194 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
37195 LDKInitFeatures ret_var = InitFeatures_clone(arg);
37196 uint64_t ret_ref = 0;
37197 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37198 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37201 int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) {
37202 LDKInitFeatures arg_conv;
37203 arg_conv.inner = untag_ptr(arg);
37204 arg_conv.is_owned = ptr_is_owned(arg);
37205 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37206 arg_conv.is_owned = false;
37207 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
37211 uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) {
37212 LDKInitFeatures orig_conv;
37213 orig_conv.inner = untag_ptr(orig);
37214 orig_conv.is_owned = ptr_is_owned(orig);
37215 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37216 orig_conv.is_owned = false;
37217 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
37218 uint64_t ret_ref = 0;
37219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37224 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
37225 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
37226 uint64_t ret_ref = 0;
37227 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37228 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37231 int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) {
37232 LDKNodeFeatures arg_conv;
37233 arg_conv.inner = untag_ptr(arg);
37234 arg_conv.is_owned = ptr_is_owned(arg);
37235 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37236 arg_conv.is_owned = false;
37237 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
37241 uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) {
37242 LDKNodeFeatures orig_conv;
37243 orig_conv.inner = untag_ptr(orig);
37244 orig_conv.is_owned = ptr_is_owned(orig);
37245 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37246 orig_conv.is_owned = false;
37247 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
37248 uint64_t ret_ref = 0;
37249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37254 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
37255 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
37256 uint64_t ret_ref = 0;
37257 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37258 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37261 int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) {
37262 LDKChannelFeatures arg_conv;
37263 arg_conv.inner = untag_ptr(arg);
37264 arg_conv.is_owned = ptr_is_owned(arg);
37265 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37266 arg_conv.is_owned = false;
37267 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
37271 uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) {
37272 LDKChannelFeatures orig_conv;
37273 orig_conv.inner = untag_ptr(orig);
37274 orig_conv.is_owned = ptr_is_owned(orig);
37275 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37276 orig_conv.is_owned = false;
37277 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
37278 uint64_t ret_ref = 0;
37279 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37280 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37284 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
37285 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
37286 uint64_t ret_ref = 0;
37287 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37288 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37291 int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) {
37292 LDKInvoiceFeatures arg_conv;
37293 arg_conv.inner = untag_ptr(arg);
37294 arg_conv.is_owned = ptr_is_owned(arg);
37295 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37296 arg_conv.is_owned = false;
37297 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
37301 uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) {
37302 LDKInvoiceFeatures orig_conv;
37303 orig_conv.inner = untag_ptr(orig);
37304 orig_conv.is_owned = ptr_is_owned(orig);
37305 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37306 orig_conv.is_owned = false;
37307 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
37308 uint64_t ret_ref = 0;
37309 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37310 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37314 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
37315 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
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);
37321 int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) {
37322 LDKChannelTypeFeatures arg_conv;
37323 arg_conv.inner = untag_ptr(arg);
37324 arg_conv.is_owned = ptr_is_owned(arg);
37325 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37326 arg_conv.is_owned = false;
37327 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
37331 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) {
37332 LDKChannelTypeFeatures orig_conv;
37333 orig_conv.inner = untag_ptr(orig);
37334 orig_conv.is_owned = ptr_is_owned(orig);
37335 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37336 orig_conv.is_owned = false;
37337 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
37338 uint64_t ret_ref = 0;
37339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37344 void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) {
37345 LDKInitFeatures this_obj_conv;
37346 this_obj_conv.inner = untag_ptr(this_obj);
37347 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37349 InitFeatures_free(this_obj_conv);
37352 void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) {
37353 LDKNodeFeatures this_obj_conv;
37354 this_obj_conv.inner = untag_ptr(this_obj);
37355 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37357 NodeFeatures_free(this_obj_conv);
37360 void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) {
37361 LDKChannelFeatures this_obj_conv;
37362 this_obj_conv.inner = untag_ptr(this_obj);
37363 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37365 ChannelFeatures_free(this_obj_conv);
37368 void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) {
37369 LDKInvoiceFeatures this_obj_conv;
37370 this_obj_conv.inner = untag_ptr(this_obj);
37371 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37373 InvoiceFeatures_free(this_obj_conv);
37376 void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
37377 LDKChannelTypeFeatures this_obj_conv;
37378 this_obj_conv.inner = untag_ptr(this_obj);
37379 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37381 ChannelTypeFeatures_free(this_obj_conv);
37384 uint64_t __attribute__((export_name("TS_InitFeatures_known_channel_features"))) TS_InitFeatures_known_channel_features() {
37385 LDKInitFeatures ret_var = InitFeatures_known_channel_features();
37386 uint64_t ret_ref = 0;
37387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37392 uint64_t __attribute__((export_name("TS_NodeFeatures_known_channel_features"))) TS_NodeFeatures_known_channel_features() {
37393 LDKNodeFeatures ret_var = NodeFeatures_known_channel_features();
37394 uint64_t ret_ref = 0;
37395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37400 uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() {
37401 LDKInitFeatures ret_var = InitFeatures_empty();
37402 uint64_t ret_ref = 0;
37403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37408 uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() {
37409 LDKInitFeatures ret_var = InitFeatures_known();
37410 uint64_t ret_ref = 0;
37411 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37412 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37416 jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
37417 LDKInitFeatures this_arg_conv;
37418 this_arg_conv.inner = untag_ptr(this_arg);
37419 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37421 this_arg_conv.is_owned = false;
37422 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
37426 uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() {
37427 LDKNodeFeatures ret_var = NodeFeatures_empty();
37428 uint64_t ret_ref = 0;
37429 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37430 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37434 uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() {
37435 LDKNodeFeatures ret_var = NodeFeatures_known();
37436 uint64_t ret_ref = 0;
37437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37442 jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
37443 LDKNodeFeatures this_arg_conv;
37444 this_arg_conv.inner = untag_ptr(this_arg);
37445 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37447 this_arg_conv.is_owned = false;
37448 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
37452 uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
37453 LDKChannelFeatures ret_var = ChannelFeatures_empty();
37454 uint64_t ret_ref = 0;
37455 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37456 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37460 uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() {
37461 LDKChannelFeatures ret_var = ChannelFeatures_known();
37462 uint64_t ret_ref = 0;
37463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37468 jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
37469 LDKChannelFeatures this_arg_conv;
37470 this_arg_conv.inner = untag_ptr(this_arg);
37471 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37473 this_arg_conv.is_owned = false;
37474 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
37478 uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
37479 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
37480 uint64_t ret_ref = 0;
37481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37482 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37486 uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() {
37487 LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
37488 uint64_t ret_ref = 0;
37489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37494 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
37495 LDKInvoiceFeatures this_arg_conv;
37496 this_arg_conv.inner = untag_ptr(this_arg);
37497 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37499 this_arg_conv.is_owned = false;
37500 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
37504 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
37505 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
37506 uint64_t ret_ref = 0;
37507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37512 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() {
37513 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
37514 uint64_t ret_ref = 0;
37515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37520 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) {
37521 LDKChannelTypeFeatures this_arg_conv;
37522 this_arg_conv.inner = untag_ptr(this_arg);
37523 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37525 this_arg_conv.is_owned = false;
37526 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
37530 int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) {
37531 LDKInitFeatures obj_conv;
37532 obj_conv.inner = untag_ptr(obj);
37533 obj_conv.is_owned = ptr_is_owned(obj);
37534 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37535 obj_conv.is_owned = false;
37536 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
37537 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37538 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37539 CVec_u8Z_free(ret_var);
37543 uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
37544 LDKu8slice ser_ref;
37545 ser_ref.datalen = ser->arr_len;
37546 ser_ref.data = ser->elems;
37547 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
37548 *ret_conv = InitFeatures_read(ser_ref);
37550 return tag_ptr(ret_conv, true);
37553 int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) {
37554 LDKChannelFeatures obj_conv;
37555 obj_conv.inner = untag_ptr(obj);
37556 obj_conv.is_owned = ptr_is_owned(obj);
37557 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37558 obj_conv.is_owned = false;
37559 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
37560 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37561 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37562 CVec_u8Z_free(ret_var);
37566 uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
37567 LDKu8slice ser_ref;
37568 ser_ref.datalen = ser->arr_len;
37569 ser_ref.data = ser->elems;
37570 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
37571 *ret_conv = ChannelFeatures_read(ser_ref);
37573 return tag_ptr(ret_conv, true);
37576 int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) {
37577 LDKNodeFeatures obj_conv;
37578 obj_conv.inner = untag_ptr(obj);
37579 obj_conv.is_owned = ptr_is_owned(obj);
37580 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37581 obj_conv.is_owned = false;
37582 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
37583 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37584 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37585 CVec_u8Z_free(ret_var);
37589 uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
37590 LDKu8slice ser_ref;
37591 ser_ref.datalen = ser->arr_len;
37592 ser_ref.data = ser->elems;
37593 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
37594 *ret_conv = NodeFeatures_read(ser_ref);
37596 return tag_ptr(ret_conv, true);
37599 int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) {
37600 LDKInvoiceFeatures obj_conv;
37601 obj_conv.inner = untag_ptr(obj);
37602 obj_conv.is_owned = ptr_is_owned(obj);
37603 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37604 obj_conv.is_owned = false;
37605 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
37606 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37607 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37608 CVec_u8Z_free(ret_var);
37612 uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
37613 LDKu8slice ser_ref;
37614 ser_ref.datalen = ser->arr_len;
37615 ser_ref.data = ser->elems;
37616 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
37617 *ret_conv = InvoiceFeatures_read(ser_ref);
37619 return tag_ptr(ret_conv, true);
37622 int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
37623 LDKChannelTypeFeatures obj_conv;
37624 obj_conv.inner = untag_ptr(obj);
37625 obj_conv.is_owned = ptr_is_owned(obj);
37626 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37627 obj_conv.is_owned = false;
37628 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
37629 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37630 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37631 CVec_u8Z_free(ret_var);
37635 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
37636 LDKu8slice ser_ref;
37637 ser_ref.datalen = ser->arr_len;
37638 ser_ref.data = ser->elems;
37639 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
37640 *ret_conv = ChannelTypeFeatures_read(ser_ref);
37642 return tag_ptr(ret_conv, true);
37645 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
37646 LDKInitFeatures this_arg_conv;
37647 this_arg_conv.inner = untag_ptr(this_arg);
37648 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37650 this_arg_conv.is_owned = false;
37651 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
37654 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_required(uint64_t this_arg) {
37655 LDKInitFeatures this_arg_conv;
37656 this_arg_conv.inner = untag_ptr(this_arg);
37657 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37659 this_arg_conv.is_owned = false;
37660 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
37663 jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(uint64_t this_arg) {
37664 LDKInitFeatures this_arg_conv;
37665 this_arg_conv.inner = untag_ptr(this_arg);
37666 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37668 this_arg_conv.is_owned = false;
37669 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
37673 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
37674 LDKNodeFeatures this_arg_conv;
37675 this_arg_conv.inner = untag_ptr(this_arg);
37676 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37678 this_arg_conv.is_owned = false;
37679 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
37682 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_required(uint64_t this_arg) {
37683 LDKNodeFeatures this_arg_conv;
37684 this_arg_conv.inner = untag_ptr(this_arg);
37685 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37687 this_arg_conv.is_owned = false;
37688 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
37691 jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(uint64_t this_arg) {
37692 LDKNodeFeatures this_arg_conv;
37693 this_arg_conv.inner = untag_ptr(this_arg);
37694 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37696 this_arg_conv.is_owned = false;
37697 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
37701 jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(uint64_t this_arg) {
37702 LDKInitFeatures this_arg_conv;
37703 this_arg_conv.inner = untag_ptr(this_arg);
37704 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37706 this_arg_conv.is_owned = false;
37707 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
37711 jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(uint64_t this_arg) {
37712 LDKNodeFeatures this_arg_conv;
37713 this_arg_conv.inner = untag_ptr(this_arg);
37714 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37716 this_arg_conv.is_owned = false;
37717 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
37721 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_optional(uint64_t this_arg) {
37722 LDKInitFeatures this_arg_conv;
37723 this_arg_conv.inner = untag_ptr(this_arg);
37724 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37726 this_arg_conv.is_owned = false;
37727 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
37730 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_required(uint64_t this_arg) {
37731 LDKInitFeatures this_arg_conv;
37732 this_arg_conv.inner = untag_ptr(this_arg);
37733 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37735 this_arg_conv.is_owned = false;
37736 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
37739 jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(uint64_t this_arg) {
37740 LDKInitFeatures this_arg_conv;
37741 this_arg_conv.inner = untag_ptr(this_arg);
37742 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37744 this_arg_conv.is_owned = false;
37745 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
37749 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
37750 LDKInitFeatures this_arg_conv;
37751 this_arg_conv.inner = untag_ptr(this_arg);
37752 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37754 this_arg_conv.is_owned = false;
37755 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
37758 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
37759 LDKInitFeatures this_arg_conv;
37760 this_arg_conv.inner = untag_ptr(this_arg);
37761 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37763 this_arg_conv.is_owned = false;
37764 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
37767 jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
37768 LDKInitFeatures this_arg_conv;
37769 this_arg_conv.inner = untag_ptr(this_arg);
37770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37772 this_arg_conv.is_owned = false;
37773 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
37777 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
37778 LDKNodeFeatures this_arg_conv;
37779 this_arg_conv.inner = untag_ptr(this_arg);
37780 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37782 this_arg_conv.is_owned = false;
37783 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
37786 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
37787 LDKNodeFeatures this_arg_conv;
37788 this_arg_conv.inner = untag_ptr(this_arg);
37789 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37791 this_arg_conv.is_owned = false;
37792 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
37795 jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
37796 LDKNodeFeatures this_arg_conv;
37797 this_arg_conv.inner = untag_ptr(this_arg);
37798 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37800 this_arg_conv.is_owned = false;
37801 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
37805 jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
37806 LDKInitFeatures this_arg_conv;
37807 this_arg_conv.inner = untag_ptr(this_arg);
37808 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37810 this_arg_conv.is_owned = false;
37811 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
37815 jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
37816 LDKNodeFeatures this_arg_conv;
37817 this_arg_conv.inner = untag_ptr(this_arg);
37818 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37820 this_arg_conv.is_owned = false;
37821 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
37825 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) {
37826 LDKInitFeatures this_arg_conv;
37827 this_arg_conv.inner = untag_ptr(this_arg);
37828 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37830 this_arg_conv.is_owned = false;
37831 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
37834 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) {
37835 LDKInitFeatures this_arg_conv;
37836 this_arg_conv.inner = untag_ptr(this_arg);
37837 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37839 this_arg_conv.is_owned = false;
37840 InitFeatures_set_gossip_queries_required(&this_arg_conv);
37843 jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) {
37844 LDKInitFeatures this_arg_conv;
37845 this_arg_conv.inner = untag_ptr(this_arg);
37846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37848 this_arg_conv.is_owned = false;
37849 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
37853 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) {
37854 LDKNodeFeatures this_arg_conv;
37855 this_arg_conv.inner = untag_ptr(this_arg);
37856 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37858 this_arg_conv.is_owned = false;
37859 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
37862 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) {
37863 LDKNodeFeatures this_arg_conv;
37864 this_arg_conv.inner = untag_ptr(this_arg);
37865 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37867 this_arg_conv.is_owned = false;
37868 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
37871 jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) {
37872 LDKNodeFeatures this_arg_conv;
37873 this_arg_conv.inner = untag_ptr(this_arg);
37874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37876 this_arg_conv.is_owned = false;
37877 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
37881 jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) {
37882 LDKInitFeatures this_arg_conv;
37883 this_arg_conv.inner = untag_ptr(this_arg);
37884 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37886 this_arg_conv.is_owned = false;
37887 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
37891 jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) {
37892 LDKNodeFeatures this_arg_conv;
37893 this_arg_conv.inner = untag_ptr(this_arg);
37894 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37896 this_arg_conv.is_owned = false;
37897 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
37901 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
37902 LDKInitFeatures this_arg_conv;
37903 this_arg_conv.inner = untag_ptr(this_arg);
37904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37906 this_arg_conv.is_owned = false;
37907 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
37910 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) {
37911 LDKInitFeatures this_arg_conv;
37912 this_arg_conv.inner = untag_ptr(this_arg);
37913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37915 this_arg_conv.is_owned = false;
37916 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
37919 jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) {
37920 LDKInitFeatures this_arg_conv;
37921 this_arg_conv.inner = untag_ptr(this_arg);
37922 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37924 this_arg_conv.is_owned = false;
37925 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
37929 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
37930 LDKNodeFeatures this_arg_conv;
37931 this_arg_conv.inner = untag_ptr(this_arg);
37932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37934 this_arg_conv.is_owned = false;
37935 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
37938 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) {
37939 LDKNodeFeatures this_arg_conv;
37940 this_arg_conv.inner = untag_ptr(this_arg);
37941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37943 this_arg_conv.is_owned = false;
37944 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
37947 jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) {
37948 LDKNodeFeatures this_arg_conv;
37949 this_arg_conv.inner = untag_ptr(this_arg);
37950 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37952 this_arg_conv.is_owned = false;
37953 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
37957 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
37958 LDKInvoiceFeatures this_arg_conv;
37959 this_arg_conv.inner = untag_ptr(this_arg);
37960 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37962 this_arg_conv.is_owned = false;
37963 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
37966 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) {
37967 LDKInvoiceFeatures this_arg_conv;
37968 this_arg_conv.inner = untag_ptr(this_arg);
37969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37971 this_arg_conv.is_owned = false;
37972 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
37975 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) {
37976 LDKInvoiceFeatures this_arg_conv;
37977 this_arg_conv.inner = untag_ptr(this_arg);
37978 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37980 this_arg_conv.is_owned = false;
37981 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
37985 jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) {
37986 LDKInitFeatures this_arg_conv;
37987 this_arg_conv.inner = untag_ptr(this_arg);
37988 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37990 this_arg_conv.is_owned = false;
37991 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
37995 jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) {
37996 LDKNodeFeatures this_arg_conv;
37997 this_arg_conv.inner = untag_ptr(this_arg);
37998 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38000 this_arg_conv.is_owned = false;
38001 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
38005 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) {
38006 LDKInvoiceFeatures this_arg_conv;
38007 this_arg_conv.inner = untag_ptr(this_arg);
38008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38010 this_arg_conv.is_owned = false;
38011 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
38015 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) {
38016 LDKInitFeatures this_arg_conv;
38017 this_arg_conv.inner = untag_ptr(this_arg);
38018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38020 this_arg_conv.is_owned = false;
38021 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
38024 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) {
38025 LDKInitFeatures this_arg_conv;
38026 this_arg_conv.inner = untag_ptr(this_arg);
38027 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38029 this_arg_conv.is_owned = false;
38030 InitFeatures_set_static_remote_key_required(&this_arg_conv);
38033 jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) {
38034 LDKInitFeatures this_arg_conv;
38035 this_arg_conv.inner = untag_ptr(this_arg);
38036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38038 this_arg_conv.is_owned = false;
38039 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
38043 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
38044 LDKNodeFeatures this_arg_conv;
38045 this_arg_conv.inner = untag_ptr(this_arg);
38046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38048 this_arg_conv.is_owned = false;
38049 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
38052 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) {
38053 LDKNodeFeatures this_arg_conv;
38054 this_arg_conv.inner = untag_ptr(this_arg);
38055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38057 this_arg_conv.is_owned = false;
38058 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
38061 jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) {
38062 LDKNodeFeatures this_arg_conv;
38063 this_arg_conv.inner = untag_ptr(this_arg);
38064 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38066 this_arg_conv.is_owned = false;
38067 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
38071 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
38072 LDKChannelTypeFeatures this_arg_conv;
38073 this_arg_conv.inner = untag_ptr(this_arg);
38074 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38076 this_arg_conv.is_owned = false;
38077 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
38080 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) {
38081 LDKChannelTypeFeatures this_arg_conv;
38082 this_arg_conv.inner = untag_ptr(this_arg);
38083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38085 this_arg_conv.is_owned = false;
38086 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
38089 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) {
38090 LDKChannelTypeFeatures this_arg_conv;
38091 this_arg_conv.inner = untag_ptr(this_arg);
38092 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38094 this_arg_conv.is_owned = false;
38095 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
38099 jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) {
38100 LDKInitFeatures this_arg_conv;
38101 this_arg_conv.inner = untag_ptr(this_arg);
38102 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38104 this_arg_conv.is_owned = false;
38105 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
38109 jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(uint64_t this_arg) {
38110 LDKNodeFeatures this_arg_conv;
38111 this_arg_conv.inner = untag_ptr(this_arg);
38112 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38114 this_arg_conv.is_owned = false;
38115 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
38119 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(uint64_t this_arg) {
38120 LDKChannelTypeFeatures this_arg_conv;
38121 this_arg_conv.inner = untag_ptr(this_arg);
38122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38124 this_arg_conv.is_owned = false;
38125 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
38129 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_optional(uint64_t this_arg) {
38130 LDKInitFeatures this_arg_conv;
38131 this_arg_conv.inner = untag_ptr(this_arg);
38132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38134 this_arg_conv.is_owned = false;
38135 InitFeatures_set_payment_secret_optional(&this_arg_conv);
38138 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) {
38139 LDKInitFeatures this_arg_conv;
38140 this_arg_conv.inner = untag_ptr(this_arg);
38141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38143 this_arg_conv.is_owned = false;
38144 InitFeatures_set_payment_secret_required(&this_arg_conv);
38147 jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) {
38148 LDKInitFeatures this_arg_conv;
38149 this_arg_conv.inner = untag_ptr(this_arg);
38150 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38152 this_arg_conv.is_owned = false;
38153 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
38157 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_optional(uint64_t this_arg) {
38158 LDKNodeFeatures this_arg_conv;
38159 this_arg_conv.inner = untag_ptr(this_arg);
38160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38162 this_arg_conv.is_owned = false;
38163 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
38166 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) {
38167 LDKNodeFeatures this_arg_conv;
38168 this_arg_conv.inner = untag_ptr(this_arg);
38169 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38171 this_arg_conv.is_owned = false;
38172 NodeFeatures_set_payment_secret_required(&this_arg_conv);
38175 jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) {
38176 LDKNodeFeatures this_arg_conv;
38177 this_arg_conv.inner = untag_ptr(this_arg);
38178 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38180 this_arg_conv.is_owned = false;
38181 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
38185 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(uint64_t this_arg) {
38186 LDKInvoiceFeatures this_arg_conv;
38187 this_arg_conv.inner = untag_ptr(this_arg);
38188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38190 this_arg_conv.is_owned = false;
38191 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
38194 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(uint64_t this_arg) {
38195 LDKInvoiceFeatures this_arg_conv;
38196 this_arg_conv.inner = untag_ptr(this_arg);
38197 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38199 this_arg_conv.is_owned = false;
38200 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
38203 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(uint64_t this_arg) {
38204 LDKInvoiceFeatures this_arg_conv;
38205 this_arg_conv.inner = untag_ptr(this_arg);
38206 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38208 this_arg_conv.is_owned = false;
38209 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
38213 jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(uint64_t this_arg) {
38214 LDKInitFeatures this_arg_conv;
38215 this_arg_conv.inner = untag_ptr(this_arg);
38216 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38218 this_arg_conv.is_owned = false;
38219 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
38223 jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(uint64_t this_arg) {
38224 LDKNodeFeatures this_arg_conv;
38225 this_arg_conv.inner = untag_ptr(this_arg);
38226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38228 this_arg_conv.is_owned = false;
38229 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
38233 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(uint64_t this_arg) {
38234 LDKInvoiceFeatures this_arg_conv;
38235 this_arg_conv.inner = untag_ptr(this_arg);
38236 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38238 this_arg_conv.is_owned = false;
38239 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
38243 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_optional(uint64_t this_arg) {
38244 LDKInitFeatures this_arg_conv;
38245 this_arg_conv.inner = untag_ptr(this_arg);
38246 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38248 this_arg_conv.is_owned = false;
38249 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
38252 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_required(uint64_t this_arg) {
38253 LDKInitFeatures this_arg_conv;
38254 this_arg_conv.inner = untag_ptr(this_arg);
38255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38257 this_arg_conv.is_owned = false;
38258 InitFeatures_set_basic_mpp_required(&this_arg_conv);
38261 jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(uint64_t this_arg) {
38262 LDKInitFeatures this_arg_conv;
38263 this_arg_conv.inner = untag_ptr(this_arg);
38264 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38266 this_arg_conv.is_owned = false;
38267 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
38271 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_optional(uint64_t this_arg) {
38272 LDKNodeFeatures this_arg_conv;
38273 this_arg_conv.inner = untag_ptr(this_arg);
38274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38276 this_arg_conv.is_owned = false;
38277 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
38280 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_required(uint64_t this_arg) {
38281 LDKNodeFeatures this_arg_conv;
38282 this_arg_conv.inner = untag_ptr(this_arg);
38283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38285 this_arg_conv.is_owned = false;
38286 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
38289 jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(uint64_t this_arg) {
38290 LDKNodeFeatures this_arg_conv;
38291 this_arg_conv.inner = untag_ptr(this_arg);
38292 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38294 this_arg_conv.is_owned = false;
38295 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
38299 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
38300 LDKInvoiceFeatures this_arg_conv;
38301 this_arg_conv.inner = untag_ptr(this_arg);
38302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38304 this_arg_conv.is_owned = false;
38305 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
38308 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
38309 LDKInvoiceFeatures this_arg_conv;
38310 this_arg_conv.inner = untag_ptr(this_arg);
38311 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38313 this_arg_conv.is_owned = false;
38314 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
38317 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
38318 LDKInvoiceFeatures this_arg_conv;
38319 this_arg_conv.inner = untag_ptr(this_arg);
38320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38322 this_arg_conv.is_owned = false;
38323 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
38327 jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
38328 LDKInitFeatures this_arg_conv;
38329 this_arg_conv.inner = untag_ptr(this_arg);
38330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38332 this_arg_conv.is_owned = false;
38333 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
38337 jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(uint64_t this_arg) {
38338 LDKNodeFeatures this_arg_conv;
38339 this_arg_conv.inner = untag_ptr(this_arg);
38340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38342 this_arg_conv.is_owned = false;
38343 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
38347 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
38348 LDKInvoiceFeatures this_arg_conv;
38349 this_arg_conv.inner = untag_ptr(this_arg);
38350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38352 this_arg_conv.is_owned = false;
38353 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
38357 void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
38358 LDKInitFeatures this_arg_conv;
38359 this_arg_conv.inner = untag_ptr(this_arg);
38360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38362 this_arg_conv.is_owned = false;
38363 InitFeatures_set_wumbo_optional(&this_arg_conv);
38366 void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_required(uint64_t this_arg) {
38367 LDKInitFeatures this_arg_conv;
38368 this_arg_conv.inner = untag_ptr(this_arg);
38369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38371 this_arg_conv.is_owned = false;
38372 InitFeatures_set_wumbo_required(&this_arg_conv);
38375 jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(uint64_t this_arg) {
38376 LDKInitFeatures this_arg_conv;
38377 this_arg_conv.inner = untag_ptr(this_arg);
38378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38380 this_arg_conv.is_owned = false;
38381 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
38385 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_optional(uint64_t this_arg) {
38386 LDKNodeFeatures this_arg_conv;
38387 this_arg_conv.inner = untag_ptr(this_arg);
38388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38390 this_arg_conv.is_owned = false;
38391 NodeFeatures_set_wumbo_optional(&this_arg_conv);
38394 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_required(uint64_t this_arg) {
38395 LDKNodeFeatures this_arg_conv;
38396 this_arg_conv.inner = untag_ptr(this_arg);
38397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38399 this_arg_conv.is_owned = false;
38400 NodeFeatures_set_wumbo_required(&this_arg_conv);
38403 jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(uint64_t this_arg) {
38404 LDKNodeFeatures this_arg_conv;
38405 this_arg_conv.inner = untag_ptr(this_arg);
38406 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38408 this_arg_conv.is_owned = false;
38409 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
38413 jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(uint64_t this_arg) {
38414 LDKInitFeatures this_arg_conv;
38415 this_arg_conv.inner = untag_ptr(this_arg);
38416 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38418 this_arg_conv.is_owned = false;
38419 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
38423 jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(uint64_t this_arg) {
38424 LDKNodeFeatures this_arg_conv;
38425 this_arg_conv.inner = untag_ptr(this_arg);
38426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38428 this_arg_conv.is_owned = false;
38429 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
38433 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
38434 LDKInitFeatures this_arg_conv;
38435 this_arg_conv.inner = untag_ptr(this_arg);
38436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38438 this_arg_conv.is_owned = false;
38439 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
38442 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
38443 LDKInitFeatures this_arg_conv;
38444 this_arg_conv.inner = untag_ptr(this_arg);
38445 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38447 this_arg_conv.is_owned = false;
38448 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
38451 jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
38452 LDKInitFeatures this_arg_conv;
38453 this_arg_conv.inner = untag_ptr(this_arg);
38454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38456 this_arg_conv.is_owned = false;
38457 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
38461 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
38462 LDKNodeFeatures this_arg_conv;
38463 this_arg_conv.inner = untag_ptr(this_arg);
38464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38466 this_arg_conv.is_owned = false;
38467 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
38470 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
38471 LDKNodeFeatures this_arg_conv;
38472 this_arg_conv.inner = untag_ptr(this_arg);
38473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38475 this_arg_conv.is_owned = false;
38476 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
38479 jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
38480 LDKNodeFeatures this_arg_conv;
38481 this_arg_conv.inner = untag_ptr(this_arg);
38482 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38484 this_arg_conv.is_owned = false;
38485 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
38489 jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
38490 LDKInitFeatures this_arg_conv;
38491 this_arg_conv.inner = untag_ptr(this_arg);
38492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38494 this_arg_conv.is_owned = false;
38495 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
38499 jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
38500 LDKNodeFeatures this_arg_conv;
38501 this_arg_conv.inner = untag_ptr(this_arg);
38502 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38504 this_arg_conv.is_owned = false;
38505 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
38509 void __attribute__((export_name("TS_InitFeatures_set_onion_messages_optional"))) TS_InitFeatures_set_onion_messages_optional(uint64_t this_arg) {
38510 LDKInitFeatures this_arg_conv;
38511 this_arg_conv.inner = untag_ptr(this_arg);
38512 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38514 this_arg_conv.is_owned = false;
38515 InitFeatures_set_onion_messages_optional(&this_arg_conv);
38518 void __attribute__((export_name("TS_InitFeatures_set_onion_messages_required"))) TS_InitFeatures_set_onion_messages_required(uint64_t this_arg) {
38519 LDKInitFeatures this_arg_conv;
38520 this_arg_conv.inner = untag_ptr(this_arg);
38521 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38523 this_arg_conv.is_owned = false;
38524 InitFeatures_set_onion_messages_required(&this_arg_conv);
38527 jboolean __attribute__((export_name("TS_InitFeatures_supports_onion_messages"))) TS_InitFeatures_supports_onion_messages(uint64_t this_arg) {
38528 LDKInitFeatures this_arg_conv;
38529 this_arg_conv.inner = untag_ptr(this_arg);
38530 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38532 this_arg_conv.is_owned = false;
38533 jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
38537 void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_optional"))) TS_NodeFeatures_set_onion_messages_optional(uint64_t this_arg) {
38538 LDKNodeFeatures this_arg_conv;
38539 this_arg_conv.inner = untag_ptr(this_arg);
38540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38542 this_arg_conv.is_owned = false;
38543 NodeFeatures_set_onion_messages_optional(&this_arg_conv);
38546 void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_required"))) TS_NodeFeatures_set_onion_messages_required(uint64_t this_arg) {
38547 LDKNodeFeatures this_arg_conv;
38548 this_arg_conv.inner = untag_ptr(this_arg);
38549 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38551 this_arg_conv.is_owned = false;
38552 NodeFeatures_set_onion_messages_required(&this_arg_conv);
38555 jboolean __attribute__((export_name("TS_NodeFeatures_supports_onion_messages"))) TS_NodeFeatures_supports_onion_messages(uint64_t this_arg) {
38556 LDKNodeFeatures this_arg_conv;
38557 this_arg_conv.inner = untag_ptr(this_arg);
38558 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38560 this_arg_conv.is_owned = false;
38561 jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
38565 jboolean __attribute__((export_name("TS_InitFeatures_requires_onion_messages"))) TS_InitFeatures_requires_onion_messages(uint64_t this_arg) {
38566 LDKInitFeatures this_arg_conv;
38567 this_arg_conv.inner = untag_ptr(this_arg);
38568 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38570 this_arg_conv.is_owned = false;
38571 jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
38575 jboolean __attribute__((export_name("TS_NodeFeatures_requires_onion_messages"))) TS_NodeFeatures_requires_onion_messages(uint64_t this_arg) {
38576 LDKNodeFeatures this_arg_conv;
38577 this_arg_conv.inner = untag_ptr(this_arg);
38578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38580 this_arg_conv.is_owned = false;
38581 jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
38585 void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
38586 LDKInitFeatures this_arg_conv;
38587 this_arg_conv.inner = untag_ptr(this_arg);
38588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38590 this_arg_conv.is_owned = false;
38591 InitFeatures_set_channel_type_optional(&this_arg_conv);
38594 void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_required(uint64_t this_arg) {
38595 LDKInitFeatures this_arg_conv;
38596 this_arg_conv.inner = untag_ptr(this_arg);
38597 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38599 this_arg_conv.is_owned = false;
38600 InitFeatures_set_channel_type_required(&this_arg_conv);
38603 jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(uint64_t this_arg) {
38604 LDKInitFeatures this_arg_conv;
38605 this_arg_conv.inner = untag_ptr(this_arg);
38606 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38608 this_arg_conv.is_owned = false;
38609 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
38613 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_optional(uint64_t this_arg) {
38614 LDKNodeFeatures this_arg_conv;
38615 this_arg_conv.inner = untag_ptr(this_arg);
38616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38618 this_arg_conv.is_owned = false;
38619 NodeFeatures_set_channel_type_optional(&this_arg_conv);
38622 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_required(uint64_t this_arg) {
38623 LDKNodeFeatures this_arg_conv;
38624 this_arg_conv.inner = untag_ptr(this_arg);
38625 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38627 this_arg_conv.is_owned = false;
38628 NodeFeatures_set_channel_type_required(&this_arg_conv);
38631 jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) {
38632 LDKNodeFeatures this_arg_conv;
38633 this_arg_conv.inner = untag_ptr(this_arg);
38634 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38636 this_arg_conv.is_owned = false;
38637 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
38641 jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) {
38642 LDKInitFeatures this_arg_conv;
38643 this_arg_conv.inner = untag_ptr(this_arg);
38644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38646 this_arg_conv.is_owned = false;
38647 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
38651 jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) {
38652 LDKNodeFeatures this_arg_conv;
38653 this_arg_conv.inner = untag_ptr(this_arg);
38654 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38656 this_arg_conv.is_owned = false;
38657 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
38661 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_optional(uint64_t this_arg) {
38662 LDKInitFeatures this_arg_conv;
38663 this_arg_conv.inner = untag_ptr(this_arg);
38664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38666 this_arg_conv.is_owned = false;
38667 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
38670 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_required(uint64_t this_arg) {
38671 LDKInitFeatures this_arg_conv;
38672 this_arg_conv.inner = untag_ptr(this_arg);
38673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38675 this_arg_conv.is_owned = false;
38676 InitFeatures_set_scid_privacy_required(&this_arg_conv);
38679 jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(uint64_t this_arg) {
38680 LDKInitFeatures this_arg_conv;
38681 this_arg_conv.inner = untag_ptr(this_arg);
38682 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38684 this_arg_conv.is_owned = false;
38685 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
38689 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
38690 LDKNodeFeatures this_arg_conv;
38691 this_arg_conv.inner = untag_ptr(this_arg);
38692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38694 this_arg_conv.is_owned = false;
38695 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
38698 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_required(uint64_t this_arg) {
38699 LDKNodeFeatures this_arg_conv;
38700 this_arg_conv.inner = untag_ptr(this_arg);
38701 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38703 this_arg_conv.is_owned = false;
38704 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
38707 jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(uint64_t this_arg) {
38708 LDKNodeFeatures this_arg_conv;
38709 this_arg_conv.inner = untag_ptr(this_arg);
38710 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38712 this_arg_conv.is_owned = false;
38713 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
38717 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
38718 LDKChannelTypeFeatures this_arg_conv;
38719 this_arg_conv.inner = untag_ptr(this_arg);
38720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38722 this_arg_conv.is_owned = false;
38723 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
38726 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_required(uint64_t this_arg) {
38727 LDKChannelTypeFeatures this_arg_conv;
38728 this_arg_conv.inner = untag_ptr(this_arg);
38729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38731 this_arg_conv.is_owned = false;
38732 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
38735 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(uint64_t this_arg) {
38736 LDKChannelTypeFeatures this_arg_conv;
38737 this_arg_conv.inner = untag_ptr(this_arg);
38738 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38740 this_arg_conv.is_owned = false;
38741 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
38745 jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(uint64_t this_arg) {
38746 LDKInitFeatures this_arg_conv;
38747 this_arg_conv.inner = untag_ptr(this_arg);
38748 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38750 this_arg_conv.is_owned = false;
38751 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
38755 jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(uint64_t this_arg) {
38756 LDKNodeFeatures this_arg_conv;
38757 this_arg_conv.inner = untag_ptr(this_arg);
38758 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38760 this_arg_conv.is_owned = false;
38761 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
38765 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(uint64_t this_arg) {
38766 LDKChannelTypeFeatures this_arg_conv;
38767 this_arg_conv.inner = untag_ptr(this_arg);
38768 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38770 this_arg_conv.is_owned = false;
38771 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
38775 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_optional(uint64_t this_arg) {
38776 LDKInitFeatures this_arg_conv;
38777 this_arg_conv.inner = untag_ptr(this_arg);
38778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38780 this_arg_conv.is_owned = false;
38781 InitFeatures_set_zero_conf_optional(&this_arg_conv);
38784 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_required(uint64_t this_arg) {
38785 LDKInitFeatures this_arg_conv;
38786 this_arg_conv.inner = untag_ptr(this_arg);
38787 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38789 this_arg_conv.is_owned = false;
38790 InitFeatures_set_zero_conf_required(&this_arg_conv);
38793 jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) {
38794 LDKInitFeatures this_arg_conv;
38795 this_arg_conv.inner = untag_ptr(this_arg);
38796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38798 this_arg_conv.is_owned = false;
38799 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
38803 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_optional(uint64_t this_arg) {
38804 LDKNodeFeatures this_arg_conv;
38805 this_arg_conv.inner = untag_ptr(this_arg);
38806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38808 this_arg_conv.is_owned = false;
38809 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
38812 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_required(uint64_t this_arg) {
38813 LDKNodeFeatures this_arg_conv;
38814 this_arg_conv.inner = untag_ptr(this_arg);
38815 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38817 this_arg_conv.is_owned = false;
38818 NodeFeatures_set_zero_conf_required(&this_arg_conv);
38821 jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) {
38822 LDKNodeFeatures this_arg_conv;
38823 this_arg_conv.inner = untag_ptr(this_arg);
38824 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38826 this_arg_conv.is_owned = false;
38827 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
38831 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_optional(uint64_t this_arg) {
38832 LDKChannelTypeFeatures this_arg_conv;
38833 this_arg_conv.inner = untag_ptr(this_arg);
38834 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38836 this_arg_conv.is_owned = false;
38837 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
38840 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_required(uint64_t this_arg) {
38841 LDKChannelTypeFeatures this_arg_conv;
38842 this_arg_conv.inner = untag_ptr(this_arg);
38843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38845 this_arg_conv.is_owned = false;
38846 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
38849 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) {
38850 LDKChannelTypeFeatures this_arg_conv;
38851 this_arg_conv.inner = untag_ptr(this_arg);
38852 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38854 this_arg_conv.is_owned = false;
38855 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
38859 jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) {
38860 LDKInitFeatures this_arg_conv;
38861 this_arg_conv.inner = untag_ptr(this_arg);
38862 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38864 this_arg_conv.is_owned = false;
38865 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
38869 jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) {
38870 LDKNodeFeatures this_arg_conv;
38871 this_arg_conv.inner = untag_ptr(this_arg);
38872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38874 this_arg_conv.is_owned = false;
38875 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
38879 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) {
38880 LDKChannelTypeFeatures this_arg_conv;
38881 this_arg_conv.inner = untag_ptr(this_arg);
38882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38884 this_arg_conv.is_owned = false;
38885 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
38889 void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_optional(uint64_t this_arg) {
38890 LDKNodeFeatures this_arg_conv;
38891 this_arg_conv.inner = untag_ptr(this_arg);
38892 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38894 this_arg_conv.is_owned = false;
38895 NodeFeatures_set_keysend_optional(&this_arg_conv);
38898 void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_required(uint64_t this_arg) {
38899 LDKNodeFeatures this_arg_conv;
38900 this_arg_conv.inner = untag_ptr(this_arg);
38901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38903 this_arg_conv.is_owned = false;
38904 NodeFeatures_set_keysend_required(&this_arg_conv);
38907 jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(uint64_t this_arg) {
38908 LDKNodeFeatures this_arg_conv;
38909 this_arg_conv.inner = untag_ptr(this_arg);
38910 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38912 this_arg_conv.is_owned = false;
38913 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
38917 jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(uint64_t this_arg) {
38918 LDKNodeFeatures this_arg_conv;
38919 this_arg_conv.inner = untag_ptr(this_arg);
38920 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38922 this_arg_conv.is_owned = false;
38923 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
38927 void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) {
38928 LDKShutdownScript this_obj_conv;
38929 this_obj_conv.inner = untag_ptr(this_obj);
38930 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38932 ShutdownScript_free(this_obj_conv);
38935 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
38936 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
38937 uint64_t ret_ref = 0;
38938 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38939 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38942 int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) {
38943 LDKShutdownScript arg_conv;
38944 arg_conv.inner = untag_ptr(arg);
38945 arg_conv.is_owned = ptr_is_owned(arg);
38946 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38947 arg_conv.is_owned = false;
38948 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
38952 uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) {
38953 LDKShutdownScript orig_conv;
38954 orig_conv.inner = untag_ptr(orig);
38955 orig_conv.is_owned = ptr_is_owned(orig);
38956 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38957 orig_conv.is_owned = false;
38958 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
38959 uint64_t ret_ref = 0;
38960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38965 void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
38966 LDKInvalidShutdownScript this_obj_conv;
38967 this_obj_conv.inner = untag_ptr(this_obj);
38968 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38970 InvalidShutdownScript_free(this_obj_conv);
38973 int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) {
38974 LDKInvalidShutdownScript this_ptr_conv;
38975 this_ptr_conv.inner = untag_ptr(this_ptr);
38976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38978 this_ptr_conv.is_owned = false;
38979 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
38980 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38981 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38985 void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) {
38986 LDKInvalidShutdownScript this_ptr_conv;
38987 this_ptr_conv.inner = untag_ptr(this_ptr);
38988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38990 this_ptr_conv.is_owned = false;
38991 LDKCVec_u8Z val_ref;
38992 val_ref.datalen = val->arr_len;
38993 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
38994 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
38995 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
38998 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
38999 LDKCVec_u8Z script_arg_ref;
39000 script_arg_ref.datalen = script_arg->arr_len;
39001 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
39002 memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg);
39003 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
39004 uint64_t ret_ref = 0;
39005 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39006 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39010 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
39011 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
39012 uint64_t ret_ref = 0;
39013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39017 int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) {
39018 LDKInvalidShutdownScript arg_conv;
39019 arg_conv.inner = untag_ptr(arg);
39020 arg_conv.is_owned = ptr_is_owned(arg);
39021 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39022 arg_conv.is_owned = false;
39023 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
39027 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) {
39028 LDKInvalidShutdownScript orig_conv;
39029 orig_conv.inner = untag_ptr(orig);
39030 orig_conv.is_owned = ptr_is_owned(orig);
39031 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39032 orig_conv.is_owned = false;
39033 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
39034 uint64_t ret_ref = 0;
39035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39036 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39040 int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) {
39041 LDKShutdownScript obj_conv;
39042 obj_conv.inner = untag_ptr(obj);
39043 obj_conv.is_owned = ptr_is_owned(obj);
39044 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39045 obj_conv.is_owned = false;
39046 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
39047 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39048 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39049 CVec_u8Z_free(ret_var);
39053 uint64_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
39054 LDKu8slice ser_ref;
39055 ser_ref.datalen = ser->arr_len;
39056 ser_ref.data = ser->elems;
39057 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
39058 *ret_conv = ShutdownScript_read(ser_ref);
39060 return tag_ptr(ret_conv, true);
39063 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
39064 unsigned char pubkey_hash_arr[20];
39065 CHECK(pubkey_hash->arr_len == 20);
39066 memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
39067 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
39068 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
39069 uint64_t ret_ref = 0;
39070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39075 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
39076 unsigned char script_hash_arr[32];
39077 CHECK(script_hash->arr_len == 32);
39078 memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
39079 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
39080 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
39081 uint64_t ret_ref = 0;
39082 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39083 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39087 uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
39089 LDKu8slice program_ref;
39090 program_ref.datalen = program->arr_len;
39091 program_ref.data = program->elems;
39092 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
39093 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
39095 return tag_ptr(ret_conv, true);
39098 int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) {
39099 LDKShutdownScript this_arg_conv;
39100 this_arg_conv.inner = untag_ptr(this_arg);
39101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39103 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
39104 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
39105 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39106 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39107 CVec_u8Z_free(ret_var);
39111 int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) {
39112 LDKShutdownScript 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 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
39118 memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
39122 jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) {
39123 LDKShutdownScript this_arg_conv;
39124 this_arg_conv.inner = untag_ptr(this_arg);
39125 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39127 this_arg_conv.is_owned = false;
39128 LDKInitFeatures features_conv;
39129 features_conv.inner = untag_ptr(features);
39130 features_conv.is_owned = ptr_is_owned(features);
39131 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
39132 features_conv.is_owned = false;
39133 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
39137 void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
39138 if (!ptr_is_owned(this_ptr)) return;
39139 void* this_ptr_ptr = untag_ptr(this_ptr);
39140 CHECK_ACCESS(this_ptr_ptr);
39141 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
39142 FREE(untag_ptr(this_ptr));
39143 CustomMessageReader_free(this_ptr_conv);
39146 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
39147 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
39148 *ret_ret = Type_clone(arg);
39149 return tag_ptr(ret_ret, true);
39151 int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) {
39152 void* arg_ptr = untag_ptr(arg);
39153 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
39154 LDKType* arg_conv = (LDKType*)arg_ptr;
39155 int64_t ret_conv = Type_clone_ptr(arg_conv);
39159 uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) {
39160 void* orig_ptr = untag_ptr(orig);
39161 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
39162 LDKType* orig_conv = (LDKType*)orig_ptr;
39163 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
39164 *ret_ret = Type_clone(orig_conv);
39165 return tag_ptr(ret_ret, true);
39168 void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_ptr) {
39169 if (!ptr_is_owned(this_ptr)) return;
39170 void* this_ptr_ptr = untag_ptr(this_ptr);
39171 CHECK_ACCESS(this_ptr_ptr);
39172 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
39173 FREE(untag_ptr(this_ptr));
39174 Type_free(this_ptr_conv);
39177 void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
39178 LDKNodeId this_obj_conv;
39179 this_obj_conv.inner = untag_ptr(this_obj);
39180 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39182 NodeId_free(this_obj_conv);
39185 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
39186 LDKNodeId ret_var = NodeId_clone(arg);
39187 uint64_t ret_ref = 0;
39188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39192 int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) {
39193 LDKNodeId arg_conv;
39194 arg_conv.inner = untag_ptr(arg);
39195 arg_conv.is_owned = ptr_is_owned(arg);
39196 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39197 arg_conv.is_owned = false;
39198 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
39202 uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) {
39203 LDKNodeId orig_conv;
39204 orig_conv.inner = untag_ptr(orig);
39205 orig_conv.is_owned = ptr_is_owned(orig);
39206 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39207 orig_conv.is_owned = false;
39208 LDKNodeId ret_var = NodeId_clone(&orig_conv);
39209 uint64_t ret_ref = 0;
39210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39211 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39215 uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) {
39216 LDKPublicKey pubkey_ref;
39217 CHECK(pubkey->arr_len == 33);
39218 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
39219 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
39220 uint64_t ret_ref = 0;
39221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39226 int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) {
39227 LDKNodeId this_arg_conv;
39228 this_arg_conv.inner = untag_ptr(this_arg);
39229 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39231 this_arg_conv.is_owned = false;
39232 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
39233 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39234 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39238 int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) {
39240 o_conv.inner = untag_ptr(o);
39241 o_conv.is_owned = ptr_is_owned(o);
39242 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
39243 o_conv.is_owned = false;
39244 int64_t ret_conv = NodeId_hash(&o_conv);
39248 int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) {
39249 LDKNodeId obj_conv;
39250 obj_conv.inner = untag_ptr(obj);
39251 obj_conv.is_owned = ptr_is_owned(obj);
39252 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39253 obj_conv.is_owned = false;
39254 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
39255 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39256 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39257 CVec_u8Z_free(ret_var);
39261 uint64_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
39262 LDKu8slice ser_ref;
39263 ser_ref.datalen = ser->arr_len;
39264 ser_ref.data = ser->elems;
39265 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
39266 *ret_conv = NodeId_read(ser_ref);
39268 return tag_ptr(ret_conv, true);
39271 void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) {
39272 LDKNetworkGraph this_obj_conv;
39273 this_obj_conv.inner = untag_ptr(this_obj);
39274 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39276 NetworkGraph_free(this_obj_conv);
39279 void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) {
39280 LDKReadOnlyNetworkGraph this_obj_conv;
39281 this_obj_conv.inner = untag_ptr(this_obj);
39282 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39284 ReadOnlyNetworkGraph_free(this_obj_conv);
39287 void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint64_t this_ptr) {
39288 if (!ptr_is_owned(this_ptr)) return;
39289 void* this_ptr_ptr = untag_ptr(this_ptr);
39290 CHECK_ACCESS(this_ptr_ptr);
39291 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
39292 FREE(untag_ptr(this_ptr));
39293 NetworkUpdate_free(this_ptr_conv);
39296 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
39297 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
39298 *ret_copy = NetworkUpdate_clone(arg);
39299 uint64_t ret_ref = tag_ptr(ret_copy, true);
39302 int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) {
39303 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
39304 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
39308 uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) {
39309 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
39310 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
39311 *ret_copy = NetworkUpdate_clone(orig_conv);
39312 uint64_t ret_ref = tag_ptr(ret_copy, true);
39316 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) {
39317 LDKChannelUpdate msg_conv;
39318 msg_conv.inner = untag_ptr(msg);
39319 msg_conv.is_owned = ptr_is_owned(msg);
39320 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39321 msg_conv = ChannelUpdate_clone(&msg_conv);
39322 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
39323 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
39324 uint64_t ret_ref = tag_ptr(ret_copy, true);
39328 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) {
39329 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
39330 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
39331 uint64_t ret_ref = tag_ptr(ret_copy, true);
39335 uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
39336 LDKPublicKey node_id_ref;
39337 CHECK(node_id->arr_len == 33);
39338 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
39339 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
39340 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
39341 uint64_t ret_ref = tag_ptr(ret_copy, true);
39345 int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
39346 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
39347 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
39348 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39349 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39350 CVec_u8Z_free(ret_var);
39354 uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
39355 LDKu8slice ser_ref;
39356 ser_ref.datalen = ser->arr_len;
39357 ser_ref.data = ser->elems;
39358 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
39359 *ret_conv = NetworkUpdate_read(ser_ref);
39361 return tag_ptr(ret_conv, true);
39364 void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) {
39365 LDKP2PGossipSync this_obj_conv;
39366 this_obj_conv.inner = untag_ptr(this_obj);
39367 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39369 P2PGossipSync_free(this_obj_conv);
39372 uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
39373 LDKNetworkGraph network_graph_conv;
39374 network_graph_conv.inner = untag_ptr(network_graph);
39375 network_graph_conv.is_owned = ptr_is_owned(network_graph);
39376 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
39377 network_graph_conv.is_owned = false;
39378 void* chain_access_ptr = untag_ptr(chain_access);
39379 CHECK_ACCESS(chain_access_ptr);
39380 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39381 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39382 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39383 // Manually implement clone for Java trait instances
39384 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39385 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39386 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39389 void* logger_ptr = untag_ptr(logger);
39390 CHECK_ACCESS(logger_ptr);
39391 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
39392 if (logger_conv.free == LDKLogger_JCalls_free) {
39393 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39394 LDKLogger_JCalls_cloned(&logger_conv);
39396 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
39397 uint64_t ret_ref = 0;
39398 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39399 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39403 void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
39404 LDKP2PGossipSync this_arg_conv;
39405 this_arg_conv.inner = untag_ptr(this_arg);
39406 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39408 this_arg_conv.is_owned = false;
39409 void* chain_access_ptr = untag_ptr(chain_access);
39410 CHECK_ACCESS(chain_access_ptr);
39411 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39412 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39413 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39414 // Manually implement clone for Java trait instances
39415 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39416 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39417 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39420 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
39423 uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
39424 LDKNetworkGraph this_arg_conv;
39425 this_arg_conv.inner = untag_ptr(this_arg);
39426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39428 this_arg_conv.is_owned = false;
39429 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
39430 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
39431 return tag_ptr(ret_ret, true);
39434 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
39435 LDKP2PGossipSync this_arg_conv;
39436 this_arg_conv.inner = untag_ptr(this_arg);
39437 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39439 this_arg_conv.is_owned = false;
39440 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
39441 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
39442 return tag_ptr(ret_ret, true);
39445 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) {
39446 LDKP2PGossipSync this_arg_conv;
39447 this_arg_conv.inner = untag_ptr(this_arg);
39448 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39450 this_arg_conv.is_owned = false;
39451 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
39452 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
39453 return tag_ptr(ret_ret, true);
39456 void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) {
39457 LDKChannelUpdateInfo this_obj_conv;
39458 this_obj_conv.inner = untag_ptr(this_obj);
39459 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39461 ChannelUpdateInfo_free(this_obj_conv);
39464 int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) {
39465 LDKChannelUpdateInfo this_ptr_conv;
39466 this_ptr_conv.inner = untag_ptr(this_ptr);
39467 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39469 this_ptr_conv.is_owned = false;
39470 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
39474 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) {
39475 LDKChannelUpdateInfo this_ptr_conv;
39476 this_ptr_conv.inner = untag_ptr(this_ptr);
39477 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39479 this_ptr_conv.is_owned = false;
39480 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
39483 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) {
39484 LDKChannelUpdateInfo this_ptr_conv;
39485 this_ptr_conv.inner = untag_ptr(this_ptr);
39486 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39488 this_ptr_conv.is_owned = false;
39489 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
39493 void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) {
39494 LDKChannelUpdateInfo this_ptr_conv;
39495 this_ptr_conv.inner = untag_ptr(this_ptr);
39496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39498 this_ptr_conv.is_owned = false;
39499 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
39502 int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
39503 LDKChannelUpdateInfo this_ptr_conv;
39504 this_ptr_conv.inner = untag_ptr(this_ptr);
39505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39507 this_ptr_conv.is_owned = false;
39508 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
39512 void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
39513 LDKChannelUpdateInfo this_ptr_conv;
39514 this_ptr_conv.inner = untag_ptr(this_ptr);
39515 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39517 this_ptr_conv.is_owned = false;
39518 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
39521 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) {
39522 LDKChannelUpdateInfo this_ptr_conv;
39523 this_ptr_conv.inner = untag_ptr(this_ptr);
39524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39526 this_ptr_conv.is_owned = false;
39527 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
39531 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
39532 LDKChannelUpdateInfo this_ptr_conv;
39533 this_ptr_conv.inner = untag_ptr(this_ptr);
39534 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39536 this_ptr_conv.is_owned = false;
39537 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
39540 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) {
39541 LDKChannelUpdateInfo this_ptr_conv;
39542 this_ptr_conv.inner = untag_ptr(this_ptr);
39543 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39545 this_ptr_conv.is_owned = false;
39546 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
39550 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
39551 LDKChannelUpdateInfo this_ptr_conv;
39552 this_ptr_conv.inner = untag_ptr(this_ptr);
39553 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39555 this_ptr_conv.is_owned = false;
39556 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
39559 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) {
39560 LDKChannelUpdateInfo this_ptr_conv;
39561 this_ptr_conv.inner = untag_ptr(this_ptr);
39562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39564 this_ptr_conv.is_owned = false;
39565 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
39566 uint64_t ret_ref = 0;
39567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39572 void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) {
39573 LDKChannelUpdateInfo this_ptr_conv;
39574 this_ptr_conv.inner = untag_ptr(this_ptr);
39575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39577 this_ptr_conv.is_owned = false;
39578 LDKRoutingFees val_conv;
39579 val_conv.inner = untag_ptr(val);
39580 val_conv.is_owned = ptr_is_owned(val);
39581 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39582 val_conv = RoutingFees_clone(&val_conv);
39583 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
39586 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) {
39587 LDKChannelUpdateInfo this_ptr_conv;
39588 this_ptr_conv.inner = untag_ptr(this_ptr);
39589 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39591 this_ptr_conv.is_owned = false;
39592 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
39593 uint64_t ret_ref = 0;
39594 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39595 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39599 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) {
39600 LDKChannelUpdateInfo this_ptr_conv;
39601 this_ptr_conv.inner = untag_ptr(this_ptr);
39602 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39604 this_ptr_conv.is_owned = false;
39605 LDKChannelUpdate val_conv;
39606 val_conv.inner = untag_ptr(val);
39607 val_conv.is_owned = ptr_is_owned(val);
39608 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39609 val_conv = ChannelUpdate_clone(&val_conv);
39610 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
39613 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) {
39614 LDKRoutingFees fees_arg_conv;
39615 fees_arg_conv.inner = untag_ptr(fees_arg);
39616 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
39617 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
39618 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
39619 LDKChannelUpdate last_update_message_arg_conv;
39620 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
39621 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
39622 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
39623 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
39624 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);
39625 uint64_t ret_ref = 0;
39626 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39627 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39631 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
39632 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
39633 uint64_t ret_ref = 0;
39634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39638 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) {
39639 LDKChannelUpdateInfo arg_conv;
39640 arg_conv.inner = untag_ptr(arg);
39641 arg_conv.is_owned = ptr_is_owned(arg);
39642 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39643 arg_conv.is_owned = false;
39644 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
39648 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) {
39649 LDKChannelUpdateInfo orig_conv;
39650 orig_conv.inner = untag_ptr(orig);
39651 orig_conv.is_owned = ptr_is_owned(orig);
39652 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39653 orig_conv.is_owned = false;
39654 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
39655 uint64_t ret_ref = 0;
39656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39661 int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
39662 LDKChannelUpdateInfo obj_conv;
39663 obj_conv.inner = untag_ptr(obj);
39664 obj_conv.is_owned = ptr_is_owned(obj);
39665 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39666 obj_conv.is_owned = false;
39667 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
39668 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39669 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39670 CVec_u8Z_free(ret_var);
39674 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
39675 LDKu8slice ser_ref;
39676 ser_ref.datalen = ser->arr_len;
39677 ser_ref.data = ser->elems;
39678 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
39679 *ret_conv = ChannelUpdateInfo_read(ser_ref);
39681 return tag_ptr(ret_conv, true);
39684 void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) {
39685 LDKChannelInfo this_obj_conv;
39686 this_obj_conv.inner = untag_ptr(this_obj);
39687 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39689 ChannelInfo_free(this_obj_conv);
39692 uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) {
39693 LDKChannelInfo this_ptr_conv;
39694 this_ptr_conv.inner = untag_ptr(this_ptr);
39695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39697 this_ptr_conv.is_owned = false;
39698 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
39699 uint64_t ret_ref = 0;
39700 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39701 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39705 void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) {
39706 LDKChannelInfo this_ptr_conv;
39707 this_ptr_conv.inner = untag_ptr(this_ptr);
39708 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39710 this_ptr_conv.is_owned = false;
39711 LDKChannelFeatures val_conv;
39712 val_conv.inner = untag_ptr(val);
39713 val_conv.is_owned = ptr_is_owned(val);
39714 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39715 val_conv = ChannelFeatures_clone(&val_conv);
39716 ChannelInfo_set_features(&this_ptr_conv, val_conv);
39719 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) {
39720 LDKChannelInfo this_ptr_conv;
39721 this_ptr_conv.inner = untag_ptr(this_ptr);
39722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39724 this_ptr_conv.is_owned = false;
39725 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
39726 uint64_t ret_ref = 0;
39727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39732 void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) {
39733 LDKChannelInfo this_ptr_conv;
39734 this_ptr_conv.inner = untag_ptr(this_ptr);
39735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39737 this_ptr_conv.is_owned = false;
39738 LDKNodeId val_conv;
39739 val_conv.inner = untag_ptr(val);
39740 val_conv.is_owned = ptr_is_owned(val);
39741 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39742 val_conv = NodeId_clone(&val_conv);
39743 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
39746 uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) {
39747 LDKChannelInfo this_ptr_conv;
39748 this_ptr_conv.inner = untag_ptr(this_ptr);
39749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39751 this_ptr_conv.is_owned = false;
39752 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
39753 uint64_t ret_ref = 0;
39754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39759 void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) {
39760 LDKChannelInfo this_ptr_conv;
39761 this_ptr_conv.inner = untag_ptr(this_ptr);
39762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39764 this_ptr_conv.is_owned = false;
39765 LDKChannelUpdateInfo val_conv;
39766 val_conv.inner = untag_ptr(val);
39767 val_conv.is_owned = ptr_is_owned(val);
39768 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39769 val_conv = ChannelUpdateInfo_clone(&val_conv);
39770 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
39773 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) {
39774 LDKChannelInfo this_ptr_conv;
39775 this_ptr_conv.inner = untag_ptr(this_ptr);
39776 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39778 this_ptr_conv.is_owned = false;
39779 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
39780 uint64_t ret_ref = 0;
39781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39786 void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) {
39787 LDKChannelInfo this_ptr_conv;
39788 this_ptr_conv.inner = untag_ptr(this_ptr);
39789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39791 this_ptr_conv.is_owned = false;
39792 LDKNodeId val_conv;
39793 val_conv.inner = untag_ptr(val);
39794 val_conv.is_owned = ptr_is_owned(val);
39795 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39796 val_conv = NodeId_clone(&val_conv);
39797 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
39800 uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) {
39801 LDKChannelInfo this_ptr_conv;
39802 this_ptr_conv.inner = untag_ptr(this_ptr);
39803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39805 this_ptr_conv.is_owned = false;
39806 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
39807 uint64_t ret_ref = 0;
39808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39813 void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) {
39814 LDKChannelInfo this_ptr_conv;
39815 this_ptr_conv.inner = untag_ptr(this_ptr);
39816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39818 this_ptr_conv.is_owned = false;
39819 LDKChannelUpdateInfo val_conv;
39820 val_conv.inner = untag_ptr(val);
39821 val_conv.is_owned = ptr_is_owned(val);
39822 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39823 val_conv = ChannelUpdateInfo_clone(&val_conv);
39824 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
39827 uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) {
39828 LDKChannelInfo this_ptr_conv;
39829 this_ptr_conv.inner = untag_ptr(this_ptr);
39830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39832 this_ptr_conv.is_owned = false;
39833 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
39834 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
39835 uint64_t ret_ref = tag_ptr(ret_copy, true);
39839 void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) {
39840 LDKChannelInfo this_ptr_conv;
39841 this_ptr_conv.inner = untag_ptr(this_ptr);
39842 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39844 this_ptr_conv.is_owned = false;
39845 void* val_ptr = untag_ptr(val);
39846 CHECK_ACCESS(val_ptr);
39847 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
39848 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
39849 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
39852 uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) {
39853 LDKChannelInfo this_ptr_conv;
39854 this_ptr_conv.inner = untag_ptr(this_ptr);
39855 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39857 this_ptr_conv.is_owned = false;
39858 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
39859 uint64_t ret_ref = 0;
39860 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39861 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39865 void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
39866 LDKChannelInfo this_ptr_conv;
39867 this_ptr_conv.inner = untag_ptr(this_ptr);
39868 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39870 this_ptr_conv.is_owned = false;
39871 LDKChannelAnnouncement val_conv;
39872 val_conv.inner = untag_ptr(val);
39873 val_conv.is_owned = ptr_is_owned(val);
39874 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39875 val_conv = ChannelAnnouncement_clone(&val_conv);
39876 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
39879 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
39880 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
39881 uint64_t ret_ref = 0;
39882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39886 int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) {
39887 LDKChannelInfo arg_conv;
39888 arg_conv.inner = untag_ptr(arg);
39889 arg_conv.is_owned = ptr_is_owned(arg);
39890 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39891 arg_conv.is_owned = false;
39892 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
39896 uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) {
39897 LDKChannelInfo orig_conv;
39898 orig_conv.inner = untag_ptr(orig);
39899 orig_conv.is_owned = ptr_is_owned(orig);
39900 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39901 orig_conv.is_owned = false;
39902 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
39903 uint64_t ret_ref = 0;
39904 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39905 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39909 uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
39910 LDKChannelInfo this_arg_conv;
39911 this_arg_conv.inner = untag_ptr(this_arg);
39912 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39914 this_arg_conv.is_owned = false;
39915 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
39916 uint64_t ret_ref = 0;
39917 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39918 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39922 int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) {
39923 LDKChannelInfo obj_conv;
39924 obj_conv.inner = untag_ptr(obj);
39925 obj_conv.is_owned = ptr_is_owned(obj);
39926 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39927 obj_conv.is_owned = false;
39928 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
39929 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39930 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39931 CVec_u8Z_free(ret_var);
39935 uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
39936 LDKu8slice ser_ref;
39937 ser_ref.datalen = ser->arr_len;
39938 ser_ref.data = ser->elems;
39939 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
39940 *ret_conv = ChannelInfo_read(ser_ref);
39942 return tag_ptr(ret_conv, true);
39945 void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) {
39946 LDKDirectedChannelInfo this_obj_conv;
39947 this_obj_conv.inner = untag_ptr(this_obj);
39948 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39950 DirectedChannelInfo_free(this_obj_conv);
39953 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
39954 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
39955 uint64_t ret_ref = 0;
39956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39960 int64_t __attribute__((export_name("TS_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) {
39961 LDKDirectedChannelInfo arg_conv;
39962 arg_conv.inner = untag_ptr(arg);
39963 arg_conv.is_owned = ptr_is_owned(arg);
39964 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39965 arg_conv.is_owned = false;
39966 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
39970 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) {
39971 LDKDirectedChannelInfo orig_conv;
39972 orig_conv.inner = untag_ptr(orig);
39973 orig_conv.is_owned = ptr_is_owned(orig);
39974 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39975 orig_conv.is_owned = false;
39976 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
39977 uint64_t ret_ref = 0;
39978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39983 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(uint64_t this_arg) {
39984 LDKDirectedChannelInfo this_arg_conv;
39985 this_arg_conv.inner = untag_ptr(this_arg);
39986 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39988 this_arg_conv.is_owned = false;
39989 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
39990 uint64_t ret_ref = 0;
39991 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39992 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39996 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
39997 LDKDirectedChannelInfo this_arg_conv;
39998 this_arg_conv.inner = untag_ptr(this_arg);
39999 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40001 this_arg_conv.is_owned = false;
40002 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_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 int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
40010 LDKDirectedChannelInfo this_arg_conv;
40011 this_arg_conv.inner = untag_ptr(this_arg);
40012 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40014 this_arg_conv.is_owned = false;
40015 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
40019 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(uint64_t this_arg) {
40020 LDKDirectedChannelInfo this_arg_conv;
40021 this_arg_conv.inner = untag_ptr(this_arg);
40022 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40024 this_arg_conv.is_owned = false;
40025 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40026 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
40027 uint64_t ret_ref = tag_ptr(ret_copy, true);
40031 void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) {
40032 if (!ptr_is_owned(this_ptr)) return;
40033 void* this_ptr_ptr = untag_ptr(this_ptr);
40034 CHECK_ACCESS(this_ptr_ptr);
40035 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
40036 FREE(untag_ptr(this_ptr));
40037 EffectiveCapacity_free(this_ptr_conv);
40040 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
40041 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40042 *ret_copy = EffectiveCapacity_clone(arg);
40043 uint64_t ret_ref = tag_ptr(ret_copy, true);
40046 int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) {
40047 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
40048 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
40052 uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) {
40053 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
40054 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40055 *ret_copy = EffectiveCapacity_clone(orig_conv);
40056 uint64_t ret_ref = tag_ptr(ret_copy, true);
40060 uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) {
40061 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40062 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
40063 uint64_t ret_ref = tag_ptr(ret_copy, true);
40067 uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) {
40068 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40069 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
40070 uint64_t ret_ref = tag_ptr(ret_copy, true);
40074 uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
40075 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
40076 CHECK_ACCESS(htlc_maximum_msat_ptr);
40077 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
40078 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
40079 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40080 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
40081 uint64_t ret_ref = tag_ptr(ret_copy, true);
40085 uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() {
40086 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40087 *ret_copy = EffectiveCapacity_infinite();
40088 uint64_t ret_ref = tag_ptr(ret_copy, true);
40092 uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() {
40093 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
40094 *ret_copy = EffectiveCapacity_unknown();
40095 uint64_t ret_ref = tag_ptr(ret_copy, true);
40099 int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) {
40100 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
40101 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
40105 void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) {
40106 LDKRoutingFees this_obj_conv;
40107 this_obj_conv.inner = untag_ptr(this_obj);
40108 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40110 RoutingFees_free(this_obj_conv);
40113 int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) {
40114 LDKRoutingFees this_ptr_conv;
40115 this_ptr_conv.inner = untag_ptr(this_ptr);
40116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40118 this_ptr_conv.is_owned = false;
40119 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
40123 void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) {
40124 LDKRoutingFees this_ptr_conv;
40125 this_ptr_conv.inner = untag_ptr(this_ptr);
40126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40128 this_ptr_conv.is_owned = false;
40129 RoutingFees_set_base_msat(&this_ptr_conv, val);
40132 int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) {
40133 LDKRoutingFees this_ptr_conv;
40134 this_ptr_conv.inner = untag_ptr(this_ptr);
40135 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40137 this_ptr_conv.is_owned = false;
40138 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
40142 void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) {
40143 LDKRoutingFees this_ptr_conv;
40144 this_ptr_conv.inner = untag_ptr(this_ptr);
40145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40147 this_ptr_conv.is_owned = false;
40148 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
40151 uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
40152 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
40153 uint64_t ret_ref = 0;
40154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40159 jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) {
40160 LDKRoutingFees a_conv;
40161 a_conv.inner = untag_ptr(a);
40162 a_conv.is_owned = ptr_is_owned(a);
40163 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40164 a_conv.is_owned = false;
40165 LDKRoutingFees b_conv;
40166 b_conv.inner = untag_ptr(b);
40167 b_conv.is_owned = ptr_is_owned(b);
40168 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40169 b_conv.is_owned = false;
40170 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
40174 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
40175 LDKRoutingFees ret_var = RoutingFees_clone(arg);
40176 uint64_t ret_ref = 0;
40177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40181 int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) {
40182 LDKRoutingFees arg_conv;
40183 arg_conv.inner = untag_ptr(arg);
40184 arg_conv.is_owned = ptr_is_owned(arg);
40185 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40186 arg_conv.is_owned = false;
40187 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
40191 uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) {
40192 LDKRoutingFees orig_conv;
40193 orig_conv.inner = untag_ptr(orig);
40194 orig_conv.is_owned = ptr_is_owned(orig);
40195 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40196 orig_conv.is_owned = false;
40197 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
40198 uint64_t ret_ref = 0;
40199 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40200 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40204 int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) {
40205 LDKRoutingFees o_conv;
40206 o_conv.inner = untag_ptr(o);
40207 o_conv.is_owned = ptr_is_owned(o);
40208 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40209 o_conv.is_owned = false;
40210 int64_t ret_conv = RoutingFees_hash(&o_conv);
40214 int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) {
40215 LDKRoutingFees obj_conv;
40216 obj_conv.inner = untag_ptr(obj);
40217 obj_conv.is_owned = ptr_is_owned(obj);
40218 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40219 obj_conv.is_owned = false;
40220 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
40221 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40222 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40223 CVec_u8Z_free(ret_var);
40227 uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
40228 LDKu8slice ser_ref;
40229 ser_ref.datalen = ser->arr_len;
40230 ser_ref.data = ser->elems;
40231 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
40232 *ret_conv = RoutingFees_read(ser_ref);
40234 return tag_ptr(ret_conv, true);
40237 void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) {
40238 LDKNodeAnnouncementInfo this_obj_conv;
40239 this_obj_conv.inner = untag_ptr(this_obj);
40240 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40242 NodeAnnouncementInfo_free(this_obj_conv);
40245 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) {
40246 LDKNodeAnnouncementInfo this_ptr_conv;
40247 this_ptr_conv.inner = untag_ptr(this_ptr);
40248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40250 this_ptr_conv.is_owned = false;
40251 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
40252 uint64_t ret_ref = 0;
40253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40258 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) {
40259 LDKNodeAnnouncementInfo this_ptr_conv;
40260 this_ptr_conv.inner = untag_ptr(this_ptr);
40261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40263 this_ptr_conv.is_owned = false;
40264 LDKNodeFeatures val_conv;
40265 val_conv.inner = untag_ptr(val);
40266 val_conv.is_owned = ptr_is_owned(val);
40267 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40268 val_conv = NodeFeatures_clone(&val_conv);
40269 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
40272 int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) {
40273 LDKNodeAnnouncementInfo this_ptr_conv;
40274 this_ptr_conv.inner = untag_ptr(this_ptr);
40275 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40277 this_ptr_conv.is_owned = false;
40278 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
40282 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) {
40283 LDKNodeAnnouncementInfo this_ptr_conv;
40284 this_ptr_conv.inner = untag_ptr(this_ptr);
40285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40287 this_ptr_conv.is_owned = false;
40288 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
40291 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) {
40292 LDKNodeAnnouncementInfo this_ptr_conv;
40293 this_ptr_conv.inner = untag_ptr(this_ptr);
40294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40296 this_ptr_conv.is_owned = false;
40297 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
40298 memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
40302 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) {
40303 LDKNodeAnnouncementInfo this_ptr_conv;
40304 this_ptr_conv.inner = untag_ptr(this_ptr);
40305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40307 this_ptr_conv.is_owned = false;
40308 LDKThreeBytes val_ref;
40309 CHECK(val->arr_len == 3);
40310 memcpy(val_ref.data, val->elems, 3); FREE(val);
40311 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
40314 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) {
40315 LDKNodeAnnouncementInfo this_ptr_conv;
40316 this_ptr_conv.inner = untag_ptr(this_ptr);
40317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40319 this_ptr_conv.is_owned = false;
40320 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
40321 uint64_t ret_ref = 0;
40322 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40323 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40327 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) {
40328 LDKNodeAnnouncementInfo this_ptr_conv;
40329 this_ptr_conv.inner = untag_ptr(this_ptr);
40330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40332 this_ptr_conv.is_owned = false;
40333 LDKNodeAlias val_conv;
40334 val_conv.inner = untag_ptr(val);
40335 val_conv.is_owned = ptr_is_owned(val);
40336 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40337 val_conv = NodeAlias_clone(&val_conv);
40338 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
40341 uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) {
40342 LDKNodeAnnouncementInfo this_ptr_conv;
40343 this_ptr_conv.inner = untag_ptr(this_ptr);
40344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40346 this_ptr_conv.is_owned = false;
40347 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
40348 uint64_tArray ret_arr = NULL;
40349 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40350 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40351 for (size_t m = 0; m < ret_var.datalen; m++) {
40352 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
40353 *ret_conv_12_copy = ret_var.data[m];
40354 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
40355 ret_arr_ptr[m] = ret_conv_12_ref;
40358 FREE(ret_var.data);
40362 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) {
40363 LDKNodeAnnouncementInfo this_ptr_conv;
40364 this_ptr_conv.inner = untag_ptr(this_ptr);
40365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40367 this_ptr_conv.is_owned = false;
40368 LDKCVec_NetAddressZ val_constr;
40369 val_constr.datalen = val->arr_len;
40370 if (val_constr.datalen > 0)
40371 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
40373 val_constr.data = NULL;
40374 uint64_t* val_vals = val->elems;
40375 for (size_t m = 0; m < val_constr.datalen; m++) {
40376 uint64_t val_conv_12 = val_vals[m];
40377 void* val_conv_12_ptr = untag_ptr(val_conv_12);
40378 CHECK_ACCESS(val_conv_12_ptr);
40379 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
40380 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
40381 val_constr.data[m] = val_conv_12_conv;
40384 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
40387 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) {
40388 LDKNodeAnnouncementInfo this_ptr_conv;
40389 this_ptr_conv.inner = untag_ptr(this_ptr);
40390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40392 this_ptr_conv.is_owned = false;
40393 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
40394 uint64_t ret_ref = 0;
40395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40400 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
40401 LDKNodeAnnouncementInfo this_ptr_conv;
40402 this_ptr_conv.inner = untag_ptr(this_ptr);
40403 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40405 this_ptr_conv.is_owned = false;
40406 LDKNodeAnnouncement val_conv;
40407 val_conv.inner = untag_ptr(val);
40408 val_conv.is_owned = ptr_is_owned(val);
40409 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40410 val_conv = NodeAnnouncement_clone(&val_conv);
40411 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
40414 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) {
40415 LDKNodeFeatures features_arg_conv;
40416 features_arg_conv.inner = untag_ptr(features_arg);
40417 features_arg_conv.is_owned = ptr_is_owned(features_arg);
40418 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
40419 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
40420 LDKThreeBytes rgb_arg_ref;
40421 CHECK(rgb_arg->arr_len == 3);
40422 memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg);
40423 LDKNodeAlias alias_arg_conv;
40424 alias_arg_conv.inner = untag_ptr(alias_arg);
40425 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
40426 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
40427 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
40428 LDKCVec_NetAddressZ addresses_arg_constr;
40429 addresses_arg_constr.datalen = addresses_arg->arr_len;
40430 if (addresses_arg_constr.datalen > 0)
40431 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
40433 addresses_arg_constr.data = NULL;
40434 uint64_t* addresses_arg_vals = addresses_arg->elems;
40435 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
40436 uint64_t addresses_arg_conv_12 = addresses_arg_vals[m];
40437 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
40438 CHECK_ACCESS(addresses_arg_conv_12_ptr);
40439 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
40440 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
40442 FREE(addresses_arg);
40443 LDKNodeAnnouncement announcement_message_arg_conv;
40444 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
40445 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
40446 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
40447 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
40448 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
40449 uint64_t ret_ref = 0;
40450 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40451 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40455 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
40456 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
40457 uint64_t ret_ref = 0;
40458 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40459 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40462 int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) {
40463 LDKNodeAnnouncementInfo arg_conv;
40464 arg_conv.inner = untag_ptr(arg);
40465 arg_conv.is_owned = ptr_is_owned(arg);
40466 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40467 arg_conv.is_owned = false;
40468 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
40472 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) {
40473 LDKNodeAnnouncementInfo orig_conv;
40474 orig_conv.inner = untag_ptr(orig);
40475 orig_conv.is_owned = ptr_is_owned(orig);
40476 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40477 orig_conv.is_owned = false;
40478 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
40479 uint64_t ret_ref = 0;
40480 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40481 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40485 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
40486 LDKNodeAnnouncementInfo obj_conv;
40487 obj_conv.inner = untag_ptr(obj);
40488 obj_conv.is_owned = ptr_is_owned(obj);
40489 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40490 obj_conv.is_owned = false;
40491 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
40492 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40493 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40494 CVec_u8Z_free(ret_var);
40498 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
40499 LDKu8slice ser_ref;
40500 ser_ref.datalen = ser->arr_len;
40501 ser_ref.data = ser->elems;
40502 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
40503 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
40505 return tag_ptr(ret_conv, true);
40508 void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) {
40509 LDKNodeAlias this_obj_conv;
40510 this_obj_conv.inner = untag_ptr(this_obj);
40511 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40513 NodeAlias_free(this_obj_conv);
40516 int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) {
40517 LDKNodeAlias 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
40523 memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32);
40527 void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) {
40528 LDKNodeAlias this_ptr_conv;
40529 this_ptr_conv.inner = untag_ptr(this_ptr);
40530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40532 this_ptr_conv.is_owned = false;
40533 LDKThirtyTwoBytes val_ref;
40534 CHECK(val->arr_len == 32);
40535 memcpy(val_ref.data, val->elems, 32); FREE(val);
40536 NodeAlias_set_a(&this_ptr_conv, val_ref);
40539 uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) {
40540 LDKThirtyTwoBytes a_arg_ref;
40541 CHECK(a_arg->arr_len == 32);
40542 memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg);
40543 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
40544 uint64_t ret_ref = 0;
40545 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40546 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40550 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
40551 LDKNodeAlias ret_var = NodeAlias_clone(arg);
40552 uint64_t ret_ref = 0;
40553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40557 int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) {
40558 LDKNodeAlias arg_conv;
40559 arg_conv.inner = untag_ptr(arg);
40560 arg_conv.is_owned = ptr_is_owned(arg);
40561 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40562 arg_conv.is_owned = false;
40563 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
40567 uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) {
40568 LDKNodeAlias orig_conv;
40569 orig_conv.inner = untag_ptr(orig);
40570 orig_conv.is_owned = ptr_is_owned(orig);
40571 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40572 orig_conv.is_owned = false;
40573 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
40574 uint64_t ret_ref = 0;
40575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40580 int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
40581 LDKNodeAlias obj_conv;
40582 obj_conv.inner = untag_ptr(obj);
40583 obj_conv.is_owned = ptr_is_owned(obj);
40584 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40585 obj_conv.is_owned = false;
40586 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
40587 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40588 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40589 CVec_u8Z_free(ret_var);
40593 uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) {
40594 LDKu8slice ser_ref;
40595 ser_ref.datalen = ser->arr_len;
40596 ser_ref.data = ser->elems;
40597 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
40598 *ret_conv = NodeAlias_read(ser_ref);
40600 return tag_ptr(ret_conv, true);
40603 void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) {
40604 LDKNodeInfo this_obj_conv;
40605 this_obj_conv.inner = untag_ptr(this_obj);
40606 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40608 NodeInfo_free(this_obj_conv);
40611 int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) {
40612 LDKNodeInfo this_ptr_conv;
40613 this_ptr_conv.inner = untag_ptr(this_ptr);
40614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40616 this_ptr_conv.is_owned = false;
40617 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
40618 int64_tArray ret_arr = NULL;
40619 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
40620 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
40621 for (size_t i = 0; i < ret_var.datalen; i++) {
40622 int64_t ret_conv_8_conv = ret_var.data[i];
40623 ret_arr_ptr[i] = ret_conv_8_conv;
40626 FREE(ret_var.data);
40630 void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) {
40631 LDKNodeInfo this_ptr_conv;
40632 this_ptr_conv.inner = untag_ptr(this_ptr);
40633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40635 this_ptr_conv.is_owned = false;
40636 LDKCVec_u64Z val_constr;
40637 val_constr.datalen = val->arr_len;
40638 if (val_constr.datalen > 0)
40639 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40641 val_constr.data = NULL;
40642 int64_t* val_vals = val->elems;
40643 for (size_t i = 0; i < val_constr.datalen; i++) {
40644 int64_t val_conv_8 = val_vals[i];
40645 val_constr.data[i] = val_conv_8;
40648 NodeInfo_set_channels(&this_ptr_conv, val_constr);
40651 uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
40652 LDKNodeInfo this_ptr_conv;
40653 this_ptr_conv.inner = untag_ptr(this_ptr);
40654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40656 this_ptr_conv.is_owned = false;
40657 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
40658 uint64_t ret_ref = 0;
40659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40664 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) {
40665 LDKNodeInfo this_ptr_conv;
40666 this_ptr_conv.inner = untag_ptr(this_ptr);
40667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40669 this_ptr_conv.is_owned = false;
40670 LDKRoutingFees val_conv;
40671 val_conv.inner = untag_ptr(val);
40672 val_conv.is_owned = ptr_is_owned(val);
40673 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40674 val_conv = RoutingFees_clone(&val_conv);
40675 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
40678 uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
40679 LDKNodeInfo this_ptr_conv;
40680 this_ptr_conv.inner = untag_ptr(this_ptr);
40681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40683 this_ptr_conv.is_owned = false;
40684 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
40685 uint64_t ret_ref = 0;
40686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40691 void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(uint64_t this_ptr, uint64_t val) {
40692 LDKNodeInfo this_ptr_conv;
40693 this_ptr_conv.inner = untag_ptr(this_ptr);
40694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40696 this_ptr_conv.is_owned = false;
40697 LDKNodeAnnouncementInfo val_conv;
40698 val_conv.inner = untag_ptr(val);
40699 val_conv.is_owned = ptr_is_owned(val);
40700 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40701 val_conv = NodeAnnouncementInfo_clone(&val_conv);
40702 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
40705 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) {
40706 LDKCVec_u64Z channels_arg_constr;
40707 channels_arg_constr.datalen = channels_arg->arr_len;
40708 if (channels_arg_constr.datalen > 0)
40709 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40711 channels_arg_constr.data = NULL;
40712 int64_t* channels_arg_vals = channels_arg->elems;
40713 for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
40714 int64_t channels_arg_conv_8 = channels_arg_vals[i];
40715 channels_arg_constr.data[i] = channels_arg_conv_8;
40717 FREE(channels_arg);
40718 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
40719 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
40720 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
40721 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
40722 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
40723 LDKNodeAnnouncementInfo announcement_info_arg_conv;
40724 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
40725 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
40726 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
40727 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
40728 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
40729 uint64_t ret_ref = 0;
40730 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40731 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40735 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
40736 LDKNodeInfo ret_var = NodeInfo_clone(arg);
40737 uint64_t ret_ref = 0;
40738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40742 int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) {
40743 LDKNodeInfo arg_conv;
40744 arg_conv.inner = untag_ptr(arg);
40745 arg_conv.is_owned = ptr_is_owned(arg);
40746 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40747 arg_conv.is_owned = false;
40748 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
40752 uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) {
40753 LDKNodeInfo orig_conv;
40754 orig_conv.inner = untag_ptr(orig);
40755 orig_conv.is_owned = ptr_is_owned(orig);
40756 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40757 orig_conv.is_owned = false;
40758 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
40759 uint64_t ret_ref = 0;
40760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40765 int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
40766 LDKNodeInfo obj_conv;
40767 obj_conv.inner = untag_ptr(obj);
40768 obj_conv.is_owned = ptr_is_owned(obj);
40769 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40770 obj_conv.is_owned = false;
40771 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
40772 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40773 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40774 CVec_u8Z_free(ret_var);
40778 uint64_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
40779 LDKu8slice ser_ref;
40780 ser_ref.datalen = ser->arr_len;
40781 ser_ref.data = ser->elems;
40782 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
40783 *ret_conv = NodeInfo_read(ser_ref);
40785 return tag_ptr(ret_conv, true);
40788 int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) {
40789 LDKNetworkGraph obj_conv;
40790 obj_conv.inner = untag_ptr(obj);
40791 obj_conv.is_owned = ptr_is_owned(obj);
40792 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40793 obj_conv.is_owned = false;
40794 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
40795 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40796 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40797 CVec_u8Z_free(ret_var);
40801 uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) {
40802 LDKu8slice ser_ref;
40803 ser_ref.datalen = ser->arr_len;
40804 ser_ref.data = ser->elems;
40805 void* arg_ptr = untag_ptr(arg);
40806 CHECK_ACCESS(arg_ptr);
40807 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
40808 if (arg_conv.free == LDKLogger_JCalls_free) {
40809 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40810 LDKLogger_JCalls_cloned(&arg_conv);
40812 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
40813 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
40815 return tag_ptr(ret_conv, true);
40818 uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
40819 LDKThirtyTwoBytes genesis_hash_ref;
40820 CHECK(genesis_hash->arr_len == 32);
40821 memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
40822 void* logger_ptr = untag_ptr(logger);
40823 CHECK_ACCESS(logger_ptr);
40824 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
40825 if (logger_conv.free == LDKLogger_JCalls_free) {
40826 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40827 LDKLogger_JCalls_cloned(&logger_conv);
40829 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
40830 uint64_t ret_ref = 0;
40831 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40832 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40836 uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) {
40837 LDKNetworkGraph this_arg_conv;
40838 this_arg_conv.inner = untag_ptr(this_arg);
40839 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40841 this_arg_conv.is_owned = false;
40842 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
40843 uint64_t ret_ref = 0;
40844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40849 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) {
40850 LDKNetworkGraph this_arg_conv;
40851 this_arg_conv.inner = untag_ptr(this_arg);
40852 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40854 this_arg_conv.is_owned = false;
40855 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
40856 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
40857 uint64_t ret_ref = tag_ptr(ret_copy, true);
40861 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) {
40862 LDKNetworkGraph this_arg_conv;
40863 this_arg_conv.inner = untag_ptr(this_arg);
40864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40866 this_arg_conv.is_owned = false;
40867 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
40870 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) {
40871 LDKNetworkGraph this_arg_conv;
40872 this_arg_conv.inner = untag_ptr(this_arg);
40873 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40875 this_arg_conv.is_owned = false;
40876 LDKNodeAnnouncement msg_conv;
40877 msg_conv.inner = untag_ptr(msg);
40878 msg_conv.is_owned = ptr_is_owned(msg);
40879 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40880 msg_conv.is_owned = false;
40881 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
40882 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
40883 return tag_ptr(ret_conv, true);
40886 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) {
40887 LDKNetworkGraph this_arg_conv;
40888 this_arg_conv.inner = untag_ptr(this_arg);
40889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40891 this_arg_conv.is_owned = false;
40892 LDKUnsignedNodeAnnouncement msg_conv;
40893 msg_conv.inner = untag_ptr(msg);
40894 msg_conv.is_owned = ptr_is_owned(msg);
40895 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40896 msg_conv.is_owned = false;
40897 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
40898 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
40899 return tag_ptr(ret_conv, true);
40902 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) {
40903 LDKNetworkGraph this_arg_conv;
40904 this_arg_conv.inner = untag_ptr(this_arg);
40905 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40907 this_arg_conv.is_owned = false;
40908 LDKChannelAnnouncement msg_conv;
40909 msg_conv.inner = untag_ptr(msg);
40910 msg_conv.is_owned = ptr_is_owned(msg);
40911 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40912 msg_conv.is_owned = false;
40913 void* chain_access_ptr = untag_ptr(chain_access);
40914 CHECK_ACCESS(chain_access_ptr);
40915 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
40916 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
40917 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
40918 // Manually implement clone for Java trait instances
40919 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
40920 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40921 LDKAccess_JCalls_cloned(&chain_access_conv.some);
40924 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
40925 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
40926 return tag_ptr(ret_conv, true);
40929 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) {
40930 LDKNetworkGraph this_arg_conv;
40931 this_arg_conv.inner = untag_ptr(this_arg);
40932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40934 this_arg_conv.is_owned = false;
40935 LDKUnsignedChannelAnnouncement msg_conv;
40936 msg_conv.inner = untag_ptr(msg);
40937 msg_conv.is_owned = ptr_is_owned(msg);
40938 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40939 msg_conv.is_owned = false;
40940 void* chain_access_ptr = untag_ptr(chain_access);
40941 CHECK_ACCESS(chain_access_ptr);
40942 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
40943 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
40944 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
40945 // Manually implement clone for Java trait instances
40946 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
40947 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40948 LDKAccess_JCalls_cloned(&chain_access_conv.some);
40951 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
40952 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
40953 return tag_ptr(ret_conv, true);
40956 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) {
40957 LDKNetworkGraph this_arg_conv;
40958 this_arg_conv.inner = untag_ptr(this_arg);
40959 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40961 this_arg_conv.is_owned = false;
40962 LDKChannelFeatures features_conv;
40963 features_conv.inner = untag_ptr(features);
40964 features_conv.is_owned = ptr_is_owned(features);
40965 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
40966 features_conv = ChannelFeatures_clone(&features_conv);
40967 LDKPublicKey node_id_1_ref;
40968 CHECK(node_id_1->arr_len == 33);
40969 memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1);
40970 LDKPublicKey node_id_2_ref;
40971 CHECK(node_id_2->arr_len == 33);
40972 memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2);
40973 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
40974 *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);
40975 return tag_ptr(ret_conv, true);
40978 void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
40979 LDKNetworkGraph this_arg_conv;
40980 this_arg_conv.inner = untag_ptr(this_arg);
40981 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40983 this_arg_conv.is_owned = false;
40984 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
40987 void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
40988 LDKNetworkGraph this_arg_conv;
40989 this_arg_conv.inner = untag_ptr(this_arg);
40990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40992 this_arg_conv.is_owned = false;
40993 LDKPublicKey _node_id_ref;
40994 CHECK(_node_id->arr_len == 33);
40995 memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id);
40996 NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
40999 void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_with_time"))) TS_NetworkGraph_remove_stale_channels_with_time(uint64_t this_arg, int64_t current_time_unix) {
41000 LDKNetworkGraph this_arg_conv;
41001 this_arg_conv.inner = untag_ptr(this_arg);
41002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41004 this_arg_conv.is_owned = false;
41005 NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
41008 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
41009 LDKNetworkGraph this_arg_conv;
41010 this_arg_conv.inner = untag_ptr(this_arg);
41011 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41013 this_arg_conv.is_owned = false;
41014 LDKChannelUpdate msg_conv;
41015 msg_conv.inner = untag_ptr(msg);
41016 msg_conv.is_owned = ptr_is_owned(msg);
41017 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41018 msg_conv.is_owned = false;
41019 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
41020 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
41021 return tag_ptr(ret_conv, true);
41024 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) {
41025 LDKNetworkGraph this_arg_conv;
41026 this_arg_conv.inner = untag_ptr(this_arg);
41027 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41029 this_arg_conv.is_owned = false;
41030 LDKUnsignedChannelUpdate msg_conv;
41031 msg_conv.inner = untag_ptr(msg);
41032 msg_conv.is_owned = ptr_is_owned(msg);
41033 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41034 msg_conv.is_owned = false;
41035 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
41036 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
41037 return tag_ptr(ret_conv, true);
41040 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) {
41041 LDKReadOnlyNetworkGraph this_arg_conv;
41042 this_arg_conv.inner = untag_ptr(this_arg);
41043 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41045 this_arg_conv.is_owned = false;
41046 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
41047 uint64_t ret_ref = 0;
41048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41053 int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) {
41054 LDKReadOnlyNetworkGraph this_arg_conv;
41055 this_arg_conv.inner = untag_ptr(this_arg);
41056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41058 this_arg_conv.is_owned = false;
41059 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
41060 int64_tArray ret_arr = NULL;
41061 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
41062 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
41063 for (size_t i = 0; i < ret_var.datalen; i++) {
41064 int64_t ret_conv_8_conv = ret_var.data[i];
41065 ret_arr_ptr[i] = ret_conv_8_conv;
41068 FREE(ret_var.data);
41072 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) {
41073 LDKReadOnlyNetworkGraph this_arg_conv;
41074 this_arg_conv.inner = untag_ptr(this_arg);
41075 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41077 this_arg_conv.is_owned = false;
41078 LDKNodeId node_id_conv;
41079 node_id_conv.inner = untag_ptr(node_id);
41080 node_id_conv.is_owned = ptr_is_owned(node_id);
41081 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41082 node_id_conv.is_owned = false;
41083 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
41084 uint64_t ret_ref = 0;
41085 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41086 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41090 uint64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) {
41091 LDKReadOnlyNetworkGraph this_arg_conv;
41092 this_arg_conv.inner = untag_ptr(this_arg);
41093 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41095 this_arg_conv.is_owned = false;
41096 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
41097 uint64_tArray ret_arr = NULL;
41098 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
41099 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
41100 for (size_t i = 0; i < ret_var.datalen; i++) {
41101 LDKNodeId ret_conv_8_var = ret_var.data[i];
41102 uint64_t ret_conv_8_ref = 0;
41103 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
41104 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
41105 ret_arr_ptr[i] = ret_conv_8_ref;
41108 FREE(ret_var.data);
41112 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) {
41113 LDKReadOnlyNetworkGraph this_arg_conv;
41114 this_arg_conv.inner = untag_ptr(this_arg);
41115 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41117 this_arg_conv.is_owned = false;
41118 LDKPublicKey pubkey_ref;
41119 CHECK(pubkey->arr_len == 33);
41120 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
41121 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
41122 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
41123 uint64_t ret_ref = tag_ptr(ret_copy, true);
41127 void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
41128 LDKRouteHop this_obj_conv;
41129 this_obj_conv.inner = untag_ptr(this_obj);
41130 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41132 RouteHop_free(this_obj_conv);
41135 int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) {
41136 LDKRouteHop this_ptr_conv;
41137 this_ptr_conv.inner = untag_ptr(this_ptr);
41138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41140 this_ptr_conv.is_owned = false;
41141 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
41142 memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
41146 void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) {
41147 LDKRouteHop this_ptr_conv;
41148 this_ptr_conv.inner = untag_ptr(this_ptr);
41149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41151 this_ptr_conv.is_owned = false;
41152 LDKPublicKey val_ref;
41153 CHECK(val->arr_len == 33);
41154 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
41155 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
41158 uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) {
41159 LDKRouteHop this_ptr_conv;
41160 this_ptr_conv.inner = untag_ptr(this_ptr);
41161 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41163 this_ptr_conv.is_owned = false;
41164 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
41165 uint64_t ret_ref = 0;
41166 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41167 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41171 void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) {
41172 LDKRouteHop this_ptr_conv;
41173 this_ptr_conv.inner = untag_ptr(this_ptr);
41174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41176 this_ptr_conv.is_owned = false;
41177 LDKNodeFeatures val_conv;
41178 val_conv.inner = untag_ptr(val);
41179 val_conv.is_owned = ptr_is_owned(val);
41180 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41181 val_conv = NodeFeatures_clone(&val_conv);
41182 RouteHop_set_node_features(&this_ptr_conv, val_conv);
41185 int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) {
41186 LDKRouteHop this_ptr_conv;
41187 this_ptr_conv.inner = untag_ptr(this_ptr);
41188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41190 this_ptr_conv.is_owned = false;
41191 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
41195 void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
41196 LDKRouteHop this_ptr_conv;
41197 this_ptr_conv.inner = untag_ptr(this_ptr);
41198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41200 this_ptr_conv.is_owned = false;
41201 RouteHop_set_short_channel_id(&this_ptr_conv, val);
41204 uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) {
41205 LDKRouteHop this_ptr_conv;
41206 this_ptr_conv.inner = untag_ptr(this_ptr);
41207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41209 this_ptr_conv.is_owned = false;
41210 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
41211 uint64_t ret_ref = 0;
41212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41217 void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) {
41218 LDKRouteHop this_ptr_conv;
41219 this_ptr_conv.inner = untag_ptr(this_ptr);
41220 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41222 this_ptr_conv.is_owned = false;
41223 LDKChannelFeatures val_conv;
41224 val_conv.inner = untag_ptr(val);
41225 val_conv.is_owned = ptr_is_owned(val);
41226 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41227 val_conv = ChannelFeatures_clone(&val_conv);
41228 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
41231 int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) {
41232 LDKRouteHop this_ptr_conv;
41233 this_ptr_conv.inner = untag_ptr(this_ptr);
41234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41236 this_ptr_conv.is_owned = false;
41237 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
41241 void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) {
41242 LDKRouteHop this_ptr_conv;
41243 this_ptr_conv.inner = untag_ptr(this_ptr);
41244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41246 this_ptr_conv.is_owned = false;
41247 RouteHop_set_fee_msat(&this_ptr_conv, val);
41250 int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) {
41251 LDKRouteHop this_ptr_conv;
41252 this_ptr_conv.inner = untag_ptr(this_ptr);
41253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41255 this_ptr_conv.is_owned = false;
41256 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
41260 void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
41261 LDKRouteHop this_ptr_conv;
41262 this_ptr_conv.inner = untag_ptr(this_ptr);
41263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41265 this_ptr_conv.is_owned = false;
41266 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
41269 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) {
41270 LDKPublicKey pubkey_arg_ref;
41271 CHECK(pubkey_arg->arr_len == 33);
41272 memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg);
41273 LDKNodeFeatures node_features_arg_conv;
41274 node_features_arg_conv.inner = untag_ptr(node_features_arg);
41275 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
41276 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
41277 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
41278 LDKChannelFeatures channel_features_arg_conv;
41279 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
41280 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
41281 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
41282 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
41283 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);
41284 uint64_t ret_ref = 0;
41285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41290 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
41291 LDKRouteHop ret_var = RouteHop_clone(arg);
41292 uint64_t ret_ref = 0;
41293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41297 int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) {
41298 LDKRouteHop arg_conv;
41299 arg_conv.inner = untag_ptr(arg);
41300 arg_conv.is_owned = ptr_is_owned(arg);
41301 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41302 arg_conv.is_owned = false;
41303 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
41307 uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) {
41308 LDKRouteHop orig_conv;
41309 orig_conv.inner = untag_ptr(orig);
41310 orig_conv.is_owned = ptr_is_owned(orig);
41311 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41312 orig_conv.is_owned = false;
41313 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
41314 uint64_t ret_ref = 0;
41315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41320 int64_t __attribute__((export_name("TS_RouteHop_hash"))) TS_RouteHop_hash(uint64_t o) {
41321 LDKRouteHop o_conv;
41322 o_conv.inner = untag_ptr(o);
41323 o_conv.is_owned = ptr_is_owned(o);
41324 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41325 o_conv.is_owned = false;
41326 int64_t ret_conv = RouteHop_hash(&o_conv);
41330 jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) {
41331 LDKRouteHop a_conv;
41332 a_conv.inner = untag_ptr(a);
41333 a_conv.is_owned = ptr_is_owned(a);
41334 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41335 a_conv.is_owned = false;
41336 LDKRouteHop b_conv;
41337 b_conv.inner = untag_ptr(b);
41338 b_conv.is_owned = ptr_is_owned(b);
41339 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41340 b_conv.is_owned = false;
41341 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
41345 int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) {
41346 LDKRouteHop obj_conv;
41347 obj_conv.inner = untag_ptr(obj);
41348 obj_conv.is_owned = ptr_is_owned(obj);
41349 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41350 obj_conv.is_owned = false;
41351 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
41352 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41353 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41354 CVec_u8Z_free(ret_var);
41358 uint64_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
41359 LDKu8slice ser_ref;
41360 ser_ref.datalen = ser->arr_len;
41361 ser_ref.data = ser->elems;
41362 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
41363 *ret_conv = RouteHop_read(ser_ref);
41365 return tag_ptr(ret_conv, true);
41368 void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) {
41369 LDKRoute this_obj_conv;
41370 this_obj_conv.inner = untag_ptr(this_obj);
41371 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41373 Route_free(this_obj_conv);
41376 ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) {
41377 LDKRoute this_ptr_conv;
41378 this_ptr_conv.inner = untag_ptr(this_ptr);
41379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41381 this_ptr_conv.is_owned = false;
41382 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
41383 ptrArray ret_arr = NULL;
41384 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
41385 uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8);
41386 for (size_t m = 0; m < ret_var.datalen; m++) {
41387 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
41388 uint64_tArray ret_conv_12_arr = NULL;
41389 ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__);
41390 uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8);
41391 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
41392 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
41393 uint64_t ret_conv_12_conv_10_ref = 0;
41394 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
41395 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
41396 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
41399 FREE(ret_conv_12_var.data);
41400 ret_arr_ptr[m] = ret_conv_12_arr;
41403 FREE(ret_var.data);
41407 void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) {
41408 LDKRoute this_ptr_conv;
41409 this_ptr_conv.inner = untag_ptr(this_ptr);
41410 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41412 this_ptr_conv.is_owned = false;
41413 LDKCVec_CVec_RouteHopZZ val_constr;
41414 val_constr.datalen = val->arr_len;
41415 if (val_constr.datalen > 0)
41416 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
41418 val_constr.data = NULL;
41419 uint64_tArray* val_vals = (void*) val->elems;
41420 for (size_t m = 0; m < val_constr.datalen; m++) {
41421 uint64_tArray val_conv_12 = val_vals[m];
41422 LDKCVec_RouteHopZ val_conv_12_constr;
41423 val_conv_12_constr.datalen = val_conv_12->arr_len;
41424 if (val_conv_12_constr.datalen > 0)
41425 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
41427 val_conv_12_constr.data = NULL;
41428 uint64_t* val_conv_12_vals = val_conv_12->elems;
41429 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
41430 uint64_t val_conv_12_conv_10 = val_conv_12_vals[k];
41431 LDKRouteHop val_conv_12_conv_10_conv;
41432 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
41433 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
41434 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
41435 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
41436 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
41439 val_constr.data[m] = val_conv_12_constr;
41442 Route_set_paths(&this_ptr_conv, val_constr);
41445 uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) {
41446 LDKRoute this_ptr_conv;
41447 this_ptr_conv.inner = untag_ptr(this_ptr);
41448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41450 this_ptr_conv.is_owned = false;
41451 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
41452 uint64_t ret_ref = 0;
41453 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41454 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41458 void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) {
41459 LDKRoute this_ptr_conv;
41460 this_ptr_conv.inner = untag_ptr(this_ptr);
41461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41463 this_ptr_conv.is_owned = false;
41464 LDKPaymentParameters val_conv;
41465 val_conv.inner = untag_ptr(val);
41466 val_conv.is_owned = ptr_is_owned(val);
41467 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41468 val_conv = PaymentParameters_clone(&val_conv);
41469 Route_set_payment_params(&this_ptr_conv, val_conv);
41472 uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) {
41473 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
41474 paths_arg_constr.datalen = paths_arg->arr_len;
41475 if (paths_arg_constr.datalen > 0)
41476 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
41478 paths_arg_constr.data = NULL;
41479 uint64_tArray* paths_arg_vals = (void*) paths_arg->elems;
41480 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
41481 uint64_tArray paths_arg_conv_12 = paths_arg_vals[m];
41482 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
41483 paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len;
41484 if (paths_arg_conv_12_constr.datalen > 0)
41485 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
41487 paths_arg_conv_12_constr.data = NULL;
41488 uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
41489 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
41490 uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
41491 LDKRouteHop paths_arg_conv_12_conv_10_conv;
41492 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
41493 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
41494 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
41495 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
41496 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
41498 FREE(paths_arg_conv_12);
41499 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
41502 LDKPaymentParameters payment_params_arg_conv;
41503 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
41504 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
41505 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
41506 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
41507 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
41508 uint64_t ret_ref = 0;
41509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41514 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
41515 LDKRoute ret_var = Route_clone(arg);
41516 uint64_t ret_ref = 0;
41517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41521 int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) {
41523 arg_conv.inner = untag_ptr(arg);
41524 arg_conv.is_owned = ptr_is_owned(arg);
41525 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41526 arg_conv.is_owned = false;
41527 int64_t ret_conv = Route_clone_ptr(&arg_conv);
41531 uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) {
41532 LDKRoute orig_conv;
41533 orig_conv.inner = untag_ptr(orig);
41534 orig_conv.is_owned = ptr_is_owned(orig);
41535 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41536 orig_conv.is_owned = false;
41537 LDKRoute ret_var = Route_clone(&orig_conv);
41538 uint64_t ret_ref = 0;
41539 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41540 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41544 int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(uint64_t o) {
41546 o_conv.inner = untag_ptr(o);
41547 o_conv.is_owned = ptr_is_owned(o);
41548 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41549 o_conv.is_owned = false;
41550 int64_t ret_conv = Route_hash(&o_conv);
41554 jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) {
41556 a_conv.inner = untag_ptr(a);
41557 a_conv.is_owned = ptr_is_owned(a);
41558 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41559 a_conv.is_owned = false;
41561 b_conv.inner = untag_ptr(b);
41562 b_conv.is_owned = ptr_is_owned(b);
41563 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41564 b_conv.is_owned = false;
41565 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
41569 int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) {
41570 LDKRoute this_arg_conv;
41571 this_arg_conv.inner = untag_ptr(this_arg);
41572 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41574 this_arg_conv.is_owned = false;
41575 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
41579 int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) {
41580 LDKRoute this_arg_conv;
41581 this_arg_conv.inner = untag_ptr(this_arg);
41582 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41584 this_arg_conv.is_owned = false;
41585 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
41589 int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) {
41591 obj_conv.inner = untag_ptr(obj);
41592 obj_conv.is_owned = ptr_is_owned(obj);
41593 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41594 obj_conv.is_owned = false;
41595 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
41596 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41597 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41598 CVec_u8Z_free(ret_var);
41602 uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
41603 LDKu8slice ser_ref;
41604 ser_ref.datalen = ser->arr_len;
41605 ser_ref.data = ser->elems;
41606 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
41607 *ret_conv = Route_read(ser_ref);
41609 return tag_ptr(ret_conv, true);
41612 void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) {
41613 LDKRouteParameters this_obj_conv;
41614 this_obj_conv.inner = untag_ptr(this_obj);
41615 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41617 RouteParameters_free(this_obj_conv);
41620 uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(uint64_t this_ptr) {
41621 LDKRouteParameters this_ptr_conv;
41622 this_ptr_conv.inner = untag_ptr(this_ptr);
41623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41625 this_ptr_conv.is_owned = false;
41626 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
41627 uint64_t ret_ref = 0;
41628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41633 void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_t val) {
41634 LDKRouteParameters this_ptr_conv;
41635 this_ptr_conv.inner = untag_ptr(this_ptr);
41636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41638 this_ptr_conv.is_owned = false;
41639 LDKPaymentParameters val_conv;
41640 val_conv.inner = untag_ptr(val);
41641 val_conv.is_owned = ptr_is_owned(val);
41642 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41643 val_conv = PaymentParameters_clone(&val_conv);
41644 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
41647 int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(uint64_t this_ptr) {
41648 LDKRouteParameters 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 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
41657 void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_t val) {
41658 LDKRouteParameters this_ptr_conv;
41659 this_ptr_conv.inner = untag_ptr(this_ptr);
41660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41662 this_ptr_conv.is_owned = false;
41663 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
41666 int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
41667 LDKRouteParameters 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 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
41676 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) {
41677 LDKRouteParameters this_ptr_conv;
41678 this_ptr_conv.inner = untag_ptr(this_ptr);
41679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41681 this_ptr_conv.is_owned = false;
41682 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
41685 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) {
41686 LDKPaymentParameters payment_params_arg_conv;
41687 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
41688 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
41689 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
41690 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
41691 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
41692 uint64_t ret_ref = 0;
41693 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41694 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41698 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
41699 LDKRouteParameters ret_var = RouteParameters_clone(arg);
41700 uint64_t ret_ref = 0;
41701 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41702 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41705 int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) {
41706 LDKRouteParameters arg_conv;
41707 arg_conv.inner = untag_ptr(arg);
41708 arg_conv.is_owned = ptr_is_owned(arg);
41709 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41710 arg_conv.is_owned = false;
41711 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
41715 uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) {
41716 LDKRouteParameters orig_conv;
41717 orig_conv.inner = untag_ptr(orig);
41718 orig_conv.is_owned = ptr_is_owned(orig);
41719 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41720 orig_conv.is_owned = false;
41721 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
41722 uint64_t ret_ref = 0;
41723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41728 int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
41729 LDKRouteParameters obj_conv;
41730 obj_conv.inner = untag_ptr(obj);
41731 obj_conv.is_owned = ptr_is_owned(obj);
41732 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41733 obj_conv.is_owned = false;
41734 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
41735 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41736 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41737 CVec_u8Z_free(ret_var);
41741 uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
41742 LDKu8slice ser_ref;
41743 ser_ref.datalen = ser->arr_len;
41744 ser_ref.data = ser->elems;
41745 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
41746 *ret_conv = RouteParameters_read(ser_ref);
41748 return tag_ptr(ret_conv, true);
41751 void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) {
41752 LDKPaymentParameters this_obj_conv;
41753 this_obj_conv.inner = untag_ptr(this_obj);
41754 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41756 PaymentParameters_free(this_obj_conv);
41759 int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(uint64_t this_ptr) {
41760 LDKPaymentParameters this_ptr_conv;
41761 this_ptr_conv.inner = untag_ptr(this_ptr);
41762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41764 this_ptr_conv.is_owned = false;
41765 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
41766 memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33);
41770 void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray val) {
41771 LDKPaymentParameters this_ptr_conv;
41772 this_ptr_conv.inner = untag_ptr(this_ptr);
41773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41775 this_ptr_conv.is_owned = false;
41776 LDKPublicKey val_ref;
41777 CHECK(val->arr_len == 33);
41778 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
41779 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
41782 uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(uint64_t this_ptr) {
41783 LDKPaymentParameters this_ptr_conv;
41784 this_ptr_conv.inner = untag_ptr(this_ptr);
41785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41787 this_ptr_conv.is_owned = false;
41788 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
41789 uint64_t ret_ref = 0;
41790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41795 void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_t val) {
41796 LDKPaymentParameters this_ptr_conv;
41797 this_ptr_conv.inner = untag_ptr(this_ptr);
41798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41800 this_ptr_conv.is_owned = false;
41801 LDKInvoiceFeatures val_conv;
41802 val_conv.inner = untag_ptr(val);
41803 val_conv.is_owned = ptr_is_owned(val);
41804 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41805 val_conv = InvoiceFeatures_clone(&val_conv);
41806 PaymentParameters_set_features(&this_ptr_conv, val_conv);
41809 uint64_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(uint64_t this_ptr) {
41810 LDKPaymentParameters this_ptr_conv;
41811 this_ptr_conv.inner = untag_ptr(this_ptr);
41812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41814 this_ptr_conv.is_owned = false;
41815 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
41816 uint64_tArray ret_arr = NULL;
41817 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
41818 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
41819 for (size_t l = 0; l < ret_var.datalen; l++) {
41820 LDKRouteHint ret_conv_11_var = ret_var.data[l];
41821 uint64_t ret_conv_11_ref = 0;
41822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
41823 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
41824 ret_arr_ptr[l] = ret_conv_11_ref;
41827 FREE(ret_var.data);
41831 void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray val) {
41832 LDKPaymentParameters this_ptr_conv;
41833 this_ptr_conv.inner = untag_ptr(this_ptr);
41834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41836 this_ptr_conv.is_owned = false;
41837 LDKCVec_RouteHintZ val_constr;
41838 val_constr.datalen = val->arr_len;
41839 if (val_constr.datalen > 0)
41840 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
41842 val_constr.data = NULL;
41843 uint64_t* val_vals = val->elems;
41844 for (size_t l = 0; l < val_constr.datalen; l++) {
41845 uint64_t val_conv_11 = val_vals[l];
41846 LDKRouteHint val_conv_11_conv;
41847 val_conv_11_conv.inner = untag_ptr(val_conv_11);
41848 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
41849 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
41850 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
41851 val_constr.data[l] = val_conv_11_conv;
41854 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
41857 uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(uint64_t this_ptr) {
41858 LDKPaymentParameters this_ptr_conv;
41859 this_ptr_conv.inner = untag_ptr(this_ptr);
41860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41862 this_ptr_conv.is_owned = false;
41863 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
41864 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
41865 uint64_t ret_ref = tag_ptr(ret_copy, true);
41869 void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_t val) {
41870 LDKPaymentParameters this_ptr_conv;
41871 this_ptr_conv.inner = untag_ptr(this_ptr);
41872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41874 this_ptr_conv.is_owned = false;
41875 void* val_ptr = untag_ptr(val);
41876 CHECK_ACCESS(val_ptr);
41877 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
41878 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
41879 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
41882 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) {
41883 LDKPaymentParameters this_ptr_conv;
41884 this_ptr_conv.inner = untag_ptr(this_ptr);
41885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41887 this_ptr_conv.is_owned = false;
41888 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
41892 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) {
41893 LDKPaymentParameters this_ptr_conv;
41894 this_ptr_conv.inner = untag_ptr(this_ptr);
41895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41897 this_ptr_conv.is_owned = false;
41898 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
41901 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(uint64_t this_ptr) {
41902 LDKPaymentParameters this_ptr_conv;
41903 this_ptr_conv.inner = untag_ptr(this_ptr);
41904 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41906 this_ptr_conv.is_owned = false;
41907 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
41911 void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_t val) {
41912 LDKPaymentParameters this_ptr_conv;
41913 this_ptr_conv.inner = untag_ptr(this_ptr);
41914 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41916 this_ptr_conv.is_owned = false;
41917 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
41920 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) {
41921 LDKPaymentParameters this_ptr_conv;
41922 this_ptr_conv.inner = untag_ptr(this_ptr);
41923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41925 this_ptr_conv.is_owned = false;
41926 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
41930 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) {
41931 LDKPaymentParameters this_ptr_conv;
41932 this_ptr_conv.inner = untag_ptr(this_ptr);
41933 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41935 this_ptr_conv.is_owned = false;
41936 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
41939 int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(uint64_t this_ptr) {
41940 LDKPaymentParameters this_ptr_conv;
41941 this_ptr_conv.inner = untag_ptr(this_ptr);
41942 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41944 this_ptr_conv.is_owned = false;
41945 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
41946 int64_tArray ret_arr = NULL;
41947 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
41948 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
41949 for (size_t i = 0; i < ret_var.datalen; i++) {
41950 int64_t ret_conv_8_conv = ret_var.data[i];
41951 ret_arr_ptr[i] = ret_conv_8_conv;
41954 FREE(ret_var.data);
41958 void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray val) {
41959 LDKPaymentParameters this_ptr_conv;
41960 this_ptr_conv.inner = untag_ptr(this_ptr);
41961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41963 this_ptr_conv.is_owned = false;
41964 LDKCVec_u64Z val_constr;
41965 val_constr.datalen = val->arr_len;
41966 if (val_constr.datalen > 0)
41967 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
41969 val_constr.data = NULL;
41970 int64_t* val_vals = val->elems;
41971 for (size_t i = 0; i < val_constr.datalen; i++) {
41972 int64_t val_conv_8 = val_vals[i];
41973 val_constr.data[i] = val_conv_8;
41976 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
41979 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) {
41980 LDKPublicKey payee_pubkey_arg_ref;
41981 CHECK(payee_pubkey_arg->arr_len == 33);
41982 memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
41983 LDKInvoiceFeatures features_arg_conv;
41984 features_arg_conv.inner = untag_ptr(features_arg);
41985 features_arg_conv.is_owned = ptr_is_owned(features_arg);
41986 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
41987 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
41988 LDKCVec_RouteHintZ route_hints_arg_constr;
41989 route_hints_arg_constr.datalen = route_hints_arg->arr_len;
41990 if (route_hints_arg_constr.datalen > 0)
41991 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
41993 route_hints_arg_constr.data = NULL;
41994 uint64_t* route_hints_arg_vals = route_hints_arg->elems;
41995 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
41996 uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
41997 LDKRouteHint route_hints_arg_conv_11_conv;
41998 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
41999 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
42000 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
42001 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
42002 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
42004 FREE(route_hints_arg);
42005 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
42006 CHECK_ACCESS(expiry_time_arg_ptr);
42007 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
42008 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
42009 LDKCVec_u64Z previously_failed_channels_arg_constr;
42010 previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len;
42011 if (previously_failed_channels_arg_constr.datalen > 0)
42012 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
42014 previously_failed_channels_arg_constr.data = NULL;
42015 int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems;
42016 for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) {
42017 int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i];
42018 previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
42020 FREE(previously_failed_channels_arg);
42021 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);
42022 uint64_t ret_ref = 0;
42023 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42024 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42028 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
42029 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
42030 uint64_t ret_ref = 0;
42031 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42032 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42035 int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) {
42036 LDKPaymentParameters arg_conv;
42037 arg_conv.inner = untag_ptr(arg);
42038 arg_conv.is_owned = ptr_is_owned(arg);
42039 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42040 arg_conv.is_owned = false;
42041 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
42045 uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) {
42046 LDKPaymentParameters orig_conv;
42047 orig_conv.inner = untag_ptr(orig);
42048 orig_conv.is_owned = ptr_is_owned(orig);
42049 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42050 orig_conv.is_owned = false;
42051 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
42052 uint64_t ret_ref = 0;
42053 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42054 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42058 int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) {
42059 LDKPaymentParameters o_conv;
42060 o_conv.inner = untag_ptr(o);
42061 o_conv.is_owned = ptr_is_owned(o);
42062 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42063 o_conv.is_owned = false;
42064 int64_t ret_conv = PaymentParameters_hash(&o_conv);
42068 jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) {
42069 LDKPaymentParameters a_conv;
42070 a_conv.inner = untag_ptr(a);
42071 a_conv.is_owned = ptr_is_owned(a);
42072 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42073 a_conv.is_owned = false;
42074 LDKPaymentParameters b_conv;
42075 b_conv.inner = untag_ptr(b);
42076 b_conv.is_owned = ptr_is_owned(b);
42077 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42078 b_conv.is_owned = false;
42079 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
42083 int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) {
42084 LDKPaymentParameters obj_conv;
42085 obj_conv.inner = untag_ptr(obj);
42086 obj_conv.is_owned = ptr_is_owned(obj);
42087 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42088 obj_conv.is_owned = false;
42089 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
42090 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42091 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42092 CVec_u8Z_free(ret_var);
42096 uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
42097 LDKu8slice ser_ref;
42098 ser_ref.datalen = ser->arr_len;
42099 ser_ref.data = ser->elems;
42100 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
42101 *ret_conv = PaymentParameters_read(ser_ref);
42103 return tag_ptr(ret_conv, true);
42106 uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
42107 LDKPublicKey payee_pubkey_ref;
42108 CHECK(payee_pubkey->arr_len == 33);
42109 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
42110 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
42111 uint64_t ret_ref = 0;
42112 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42113 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42117 uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
42118 LDKPublicKey payee_pubkey_ref;
42119 CHECK(payee_pubkey->arr_len == 33);
42120 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
42121 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
42122 uint64_t ret_ref = 0;
42123 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42124 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42128 void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) {
42129 LDKRouteHint this_obj_conv;
42130 this_obj_conv.inner = untag_ptr(this_obj);
42131 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42133 RouteHint_free(this_obj_conv);
42136 uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) {
42137 LDKRouteHint this_ptr_conv;
42138 this_ptr_conv.inner = untag_ptr(this_ptr);
42139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42141 this_ptr_conv.is_owned = false;
42142 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
42143 uint64_tArray ret_arr = NULL;
42144 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
42145 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
42146 for (size_t o = 0; o < ret_var.datalen; o++) {
42147 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
42148 uint64_t ret_conv_14_ref = 0;
42149 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
42150 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
42151 ret_arr_ptr[o] = ret_conv_14_ref;
42154 FREE(ret_var.data);
42158 void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) {
42159 LDKRouteHint this_ptr_conv;
42160 this_ptr_conv.inner = untag_ptr(this_ptr);
42161 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42163 this_ptr_conv.is_owned = false;
42164 LDKCVec_RouteHintHopZ val_constr;
42165 val_constr.datalen = val->arr_len;
42166 if (val_constr.datalen > 0)
42167 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
42169 val_constr.data = NULL;
42170 uint64_t* val_vals = val->elems;
42171 for (size_t o = 0; o < val_constr.datalen; o++) {
42172 uint64_t val_conv_14 = val_vals[o];
42173 LDKRouteHintHop val_conv_14_conv;
42174 val_conv_14_conv.inner = untag_ptr(val_conv_14);
42175 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
42176 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
42177 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
42178 val_constr.data[o] = val_conv_14_conv;
42181 RouteHint_set_a(&this_ptr_conv, val_constr);
42184 uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) {
42185 LDKCVec_RouteHintHopZ a_arg_constr;
42186 a_arg_constr.datalen = a_arg->arr_len;
42187 if (a_arg_constr.datalen > 0)
42188 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
42190 a_arg_constr.data = NULL;
42191 uint64_t* a_arg_vals = a_arg->elems;
42192 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
42193 uint64_t a_arg_conv_14 = a_arg_vals[o];
42194 LDKRouteHintHop a_arg_conv_14_conv;
42195 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
42196 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
42197 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
42198 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
42199 a_arg_constr.data[o] = a_arg_conv_14_conv;
42202 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
42203 uint64_t ret_ref = 0;
42204 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42205 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42209 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
42210 LDKRouteHint ret_var = RouteHint_clone(arg);
42211 uint64_t ret_ref = 0;
42212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42216 int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) {
42217 LDKRouteHint arg_conv;
42218 arg_conv.inner = untag_ptr(arg);
42219 arg_conv.is_owned = ptr_is_owned(arg);
42220 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42221 arg_conv.is_owned = false;
42222 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
42226 uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) {
42227 LDKRouteHint orig_conv;
42228 orig_conv.inner = untag_ptr(orig);
42229 orig_conv.is_owned = ptr_is_owned(orig);
42230 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42231 orig_conv.is_owned = false;
42232 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
42233 uint64_t ret_ref = 0;
42234 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42235 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42239 int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) {
42240 LDKRouteHint o_conv;
42241 o_conv.inner = untag_ptr(o);
42242 o_conv.is_owned = ptr_is_owned(o);
42243 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42244 o_conv.is_owned = false;
42245 int64_t ret_conv = RouteHint_hash(&o_conv);
42249 jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) {
42250 LDKRouteHint a_conv;
42251 a_conv.inner = untag_ptr(a);
42252 a_conv.is_owned = ptr_is_owned(a);
42253 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42254 a_conv.is_owned = false;
42255 LDKRouteHint b_conv;
42256 b_conv.inner = untag_ptr(b);
42257 b_conv.is_owned = ptr_is_owned(b);
42258 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42259 b_conv.is_owned = false;
42260 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
42264 int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) {
42265 LDKRouteHint obj_conv;
42266 obj_conv.inner = untag_ptr(obj);
42267 obj_conv.is_owned = ptr_is_owned(obj);
42268 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42269 obj_conv.is_owned = false;
42270 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
42271 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42272 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42273 CVec_u8Z_free(ret_var);
42277 uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
42278 LDKu8slice ser_ref;
42279 ser_ref.datalen = ser->arr_len;
42280 ser_ref.data = ser->elems;
42281 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
42282 *ret_conv = RouteHint_read(ser_ref);
42284 return tag_ptr(ret_conv, true);
42287 void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) {
42288 LDKRouteHintHop this_obj_conv;
42289 this_obj_conv.inner = untag_ptr(this_obj);
42290 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42292 RouteHintHop_free(this_obj_conv);
42295 int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) {
42296 LDKRouteHintHop this_ptr_conv;
42297 this_ptr_conv.inner = untag_ptr(this_ptr);
42298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42300 this_ptr_conv.is_owned = false;
42301 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42302 memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33);
42306 void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) {
42307 LDKRouteHintHop this_ptr_conv;
42308 this_ptr_conv.inner = untag_ptr(this_ptr);
42309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42311 this_ptr_conv.is_owned = false;
42312 LDKPublicKey val_ref;
42313 CHECK(val->arr_len == 33);
42314 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42315 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
42318 int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) {
42319 LDKRouteHintHop this_ptr_conv;
42320 this_ptr_conv.inner = untag_ptr(this_ptr);
42321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42323 this_ptr_conv.is_owned = false;
42324 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
42328 void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
42329 LDKRouteHintHop this_ptr_conv;
42330 this_ptr_conv.inner = untag_ptr(this_ptr);
42331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42333 this_ptr_conv.is_owned = false;
42334 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
42337 uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) {
42338 LDKRouteHintHop this_ptr_conv;
42339 this_ptr_conv.inner = untag_ptr(this_ptr);
42340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42342 this_ptr_conv.is_owned = false;
42343 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
42344 uint64_t ret_ref = 0;
42345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42350 void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) {
42351 LDKRouteHintHop this_ptr_conv;
42352 this_ptr_conv.inner = untag_ptr(this_ptr);
42353 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42355 this_ptr_conv.is_owned = false;
42356 LDKRoutingFees val_conv;
42357 val_conv.inner = untag_ptr(val);
42358 val_conv.is_owned = ptr_is_owned(val);
42359 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42360 val_conv = RoutingFees_clone(&val_conv);
42361 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
42364 int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) {
42365 LDKRouteHintHop this_ptr_conv;
42366 this_ptr_conv.inner = untag_ptr(this_ptr);
42367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42369 this_ptr_conv.is_owned = false;
42370 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
42374 void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
42375 LDKRouteHintHop this_ptr_conv;
42376 this_ptr_conv.inner = untag_ptr(this_ptr);
42377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42379 this_ptr_conv.is_owned = false;
42380 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
42383 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) {
42384 LDKRouteHintHop this_ptr_conv;
42385 this_ptr_conv.inner = untag_ptr(this_ptr);
42386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42388 this_ptr_conv.is_owned = false;
42389 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
42390 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
42391 uint64_t ret_ref = tag_ptr(ret_copy, true);
42395 void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
42396 LDKRouteHintHop this_ptr_conv;
42397 this_ptr_conv.inner = untag_ptr(this_ptr);
42398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42400 this_ptr_conv.is_owned = false;
42401 void* val_ptr = untag_ptr(val);
42402 CHECK_ACCESS(val_ptr);
42403 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
42404 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
42405 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
42408 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) {
42409 LDKRouteHintHop this_ptr_conv;
42410 this_ptr_conv.inner = untag_ptr(this_ptr);
42411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42413 this_ptr_conv.is_owned = false;
42414 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
42415 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
42416 uint64_t ret_ref = tag_ptr(ret_copy, true);
42420 void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
42421 LDKRouteHintHop this_ptr_conv;
42422 this_ptr_conv.inner = untag_ptr(this_ptr);
42423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42425 this_ptr_conv.is_owned = false;
42426 void* val_ptr = untag_ptr(val);
42427 CHECK_ACCESS(val_ptr);
42428 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
42429 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
42430 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
42433 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) {
42434 LDKPublicKey src_node_id_arg_ref;
42435 CHECK(src_node_id_arg->arr_len == 33);
42436 memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg);
42437 LDKRoutingFees fees_arg_conv;
42438 fees_arg_conv.inner = untag_ptr(fees_arg);
42439 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
42440 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
42441 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
42442 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
42443 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
42444 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
42445 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
42446 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
42447 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
42448 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
42449 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
42450 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);
42451 uint64_t ret_ref = 0;
42452 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42453 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42457 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
42458 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
42459 uint64_t ret_ref = 0;
42460 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42461 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42464 int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) {
42465 LDKRouteHintHop arg_conv;
42466 arg_conv.inner = untag_ptr(arg);
42467 arg_conv.is_owned = ptr_is_owned(arg);
42468 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42469 arg_conv.is_owned = false;
42470 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
42474 uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) {
42475 LDKRouteHintHop orig_conv;
42476 orig_conv.inner = untag_ptr(orig);
42477 orig_conv.is_owned = ptr_is_owned(orig);
42478 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42479 orig_conv.is_owned = false;
42480 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
42481 uint64_t ret_ref = 0;
42482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42483 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42487 int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) {
42488 LDKRouteHintHop o_conv;
42489 o_conv.inner = untag_ptr(o);
42490 o_conv.is_owned = ptr_is_owned(o);
42491 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42492 o_conv.is_owned = false;
42493 int64_t ret_conv = RouteHintHop_hash(&o_conv);
42497 jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) {
42498 LDKRouteHintHop a_conv;
42499 a_conv.inner = untag_ptr(a);
42500 a_conv.is_owned = ptr_is_owned(a);
42501 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42502 a_conv.is_owned = false;
42503 LDKRouteHintHop b_conv;
42504 b_conv.inner = untag_ptr(b);
42505 b_conv.is_owned = ptr_is_owned(b);
42506 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42507 b_conv.is_owned = false;
42508 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
42512 int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) {
42513 LDKRouteHintHop obj_conv;
42514 obj_conv.inner = untag_ptr(obj);
42515 obj_conv.is_owned = ptr_is_owned(obj);
42516 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42517 obj_conv.is_owned = false;
42518 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
42519 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42520 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42521 CVec_u8Z_free(ret_var);
42525 uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
42526 LDKu8slice ser_ref;
42527 ser_ref.datalen = ser->arr_len;
42528 ser_ref.data = ser->elems;
42529 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
42530 *ret_conv = RouteHintHop_read(ser_ref);
42532 return tag_ptr(ret_conv, true);
42535 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) {
42536 LDKPublicKey our_node_pubkey_ref;
42537 CHECK(our_node_pubkey->arr_len == 33);
42538 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
42539 LDKRouteParameters route_params_conv;
42540 route_params_conv.inner = untag_ptr(route_params);
42541 route_params_conv.is_owned = ptr_is_owned(route_params);
42542 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
42543 route_params_conv.is_owned = false;
42544 LDKNetworkGraph network_graph_conv;
42545 network_graph_conv.inner = untag_ptr(network_graph);
42546 network_graph_conv.is_owned = ptr_is_owned(network_graph);
42547 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
42548 network_graph_conv.is_owned = false;
42549 LDKCVec_ChannelDetailsZ first_hops_constr;
42550 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
42551 if (first_hops != 0) {
42552 first_hops_constr.datalen = first_hops->arr_len;
42553 if (first_hops_constr.datalen > 0)
42554 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
42556 first_hops_constr.data = NULL;
42557 uint64_t* first_hops_vals = first_hops->elems;
42558 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
42559 uint64_t first_hops_conv_16 = first_hops_vals[q];
42560 LDKChannelDetails first_hops_conv_16_conv;
42561 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
42562 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
42563 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
42564 first_hops_conv_16_conv.is_owned = false;
42565 first_hops_constr.data[q] = first_hops_conv_16_conv;
42568 first_hops_ptr = &first_hops_constr;
42570 void* logger_ptr = untag_ptr(logger);
42571 CHECK_ACCESS(logger_ptr);
42572 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
42573 if (logger_conv.free == LDKLogger_JCalls_free) {
42574 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42575 LDKLogger_JCalls_cloned(&logger_conv);
42577 void* scorer_ptr = untag_ptr(scorer);
42578 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
42579 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
42580 unsigned char random_seed_bytes_arr[32];
42581 CHECK(random_seed_bytes->arr_len == 32);
42582 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
42583 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
42584 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
42585 *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);
42586 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
42587 return tag_ptr(ret_conv, true);
42590 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) {
42591 LDKPublicKey our_node_pubkey_ref;
42592 CHECK(our_node_pubkey->arr_len == 33);
42593 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
42594 LDKCVec_PublicKeyZ hops_constr;
42595 hops_constr.datalen = hops->arr_len;
42596 if (hops_constr.datalen > 0)
42597 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
42599 hops_constr.data = NULL;
42600 int8_tArray* hops_vals = (void*) hops->elems;
42601 for (size_t m = 0; m < hops_constr.datalen; m++) {
42602 int8_tArray hops_conv_12 = hops_vals[m];
42603 LDKPublicKey hops_conv_12_ref;
42604 CHECK(hops_conv_12->arr_len == 33);
42605 memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
42606 hops_constr.data[m] = hops_conv_12_ref;
42609 LDKRouteParameters route_params_conv;
42610 route_params_conv.inner = untag_ptr(route_params);
42611 route_params_conv.is_owned = ptr_is_owned(route_params);
42612 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
42613 route_params_conv.is_owned = false;
42614 LDKNetworkGraph network_graph_conv;
42615 network_graph_conv.inner = untag_ptr(network_graph);
42616 network_graph_conv.is_owned = ptr_is_owned(network_graph);
42617 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
42618 network_graph_conv.is_owned = false;
42619 void* logger_ptr = untag_ptr(logger);
42620 CHECK_ACCESS(logger_ptr);
42621 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
42622 if (logger_conv.free == LDKLogger_JCalls_free) {
42623 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42624 LDKLogger_JCalls_cloned(&logger_conv);
42626 unsigned char random_seed_bytes_arr[32];
42627 CHECK(random_seed_bytes->arr_len == 32);
42628 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
42629 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
42630 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
42631 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
42632 return tag_ptr(ret_conv, true);
42635 void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint64_t this_ptr) {
42636 if (!ptr_is_owned(this_ptr)) return;
42637 void* this_ptr_ptr = untag_ptr(this_ptr);
42638 CHECK_ACCESS(this_ptr_ptr);
42639 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
42640 FREE(untag_ptr(this_ptr));
42641 Score_free(this_ptr_conv);
42644 void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint64_t this_ptr) {
42645 if (!ptr_is_owned(this_ptr)) return;
42646 void* this_ptr_ptr = untag_ptr(this_ptr);
42647 CHECK_ACCESS(this_ptr_ptr);
42648 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
42649 FREE(untag_ptr(this_ptr));
42650 LockableScore_free(this_ptr_conv);
42653 void __attribute__((export_name("TS_WriteableScore_free"))) TS_WriteableScore_free(uint64_t this_ptr) {
42654 if (!ptr_is_owned(this_ptr)) return;
42655 void* this_ptr_ptr = untag_ptr(this_ptr);
42656 CHECK_ACCESS(this_ptr_ptr);
42657 LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
42658 FREE(untag_ptr(this_ptr));
42659 WriteableScore_free(this_ptr_conv);
42662 void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
42663 LDKMultiThreadedLockableScore this_obj_conv;
42664 this_obj_conv.inner = untag_ptr(this_obj);
42665 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42667 MultiThreadedLockableScore_free(this_obj_conv);
42670 void __attribute__((export_name("TS_MultiThreadedScoreLock_free"))) TS_MultiThreadedScoreLock_free(uint64_t this_obj) {
42671 LDKMultiThreadedScoreLock this_obj_conv;
42672 this_obj_conv.inner = untag_ptr(this_obj);
42673 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42675 MultiThreadedScoreLock_free(this_obj_conv);
42678 uint64_t __attribute__((export_name("TS_MultiThreadedScoreLock_as_Score"))) TS_MultiThreadedScoreLock_as_Score(uint64_t this_arg) {
42679 LDKMultiThreadedScoreLock this_arg_conv;
42680 this_arg_conv.inner = untag_ptr(this_arg);
42681 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42683 this_arg_conv.is_owned = false;
42684 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
42685 *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
42686 return tag_ptr(ret_ret, true);
42689 int8_tArray __attribute__((export_name("TS_MultiThreadedScoreLock_write"))) TS_MultiThreadedScoreLock_write(uint64_t obj) {
42690 LDKMultiThreadedScoreLock obj_conv;
42691 obj_conv.inner = untag_ptr(obj);
42692 obj_conv.is_owned = ptr_is_owned(obj);
42693 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42694 obj_conv.is_owned = false;
42695 LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
42696 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42697 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42698 CVec_u8Z_free(ret_var);
42702 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_LockableScore"))) TS_MultiThreadedLockableScore_as_LockableScore(uint64_t this_arg) {
42703 LDKMultiThreadedLockableScore this_arg_conv;
42704 this_arg_conv.inner = untag_ptr(this_arg);
42705 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42707 this_arg_conv.is_owned = false;
42708 LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
42709 *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
42710 return tag_ptr(ret_ret, true);
42713 int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
42714 LDKMultiThreadedLockableScore obj_conv;
42715 obj_conv.inner = untag_ptr(obj);
42716 obj_conv.is_owned = ptr_is_owned(obj);
42717 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42718 obj_conv.is_owned = false;
42719 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
42720 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42721 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42722 CVec_u8Z_free(ret_var);
42726 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_WriteableScore"))) TS_MultiThreadedLockableScore_as_WriteableScore(uint64_t this_arg) {
42727 LDKMultiThreadedLockableScore this_arg_conv;
42728 this_arg_conv.inner = untag_ptr(this_arg);
42729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42731 this_arg_conv.is_owned = false;
42732 LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
42733 *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
42734 return tag_ptr(ret_ret, true);
42737 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
42738 void* score_ptr = untag_ptr(score);
42739 CHECK_ACCESS(score_ptr);
42740 LDKScore score_conv = *(LDKScore*)(score_ptr);
42741 if (score_conv.free == LDKScore_JCalls_free) {
42742 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42743 LDKScore_JCalls_cloned(&score_conv);
42745 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
42746 uint64_t ret_ref = 0;
42747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42752 void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) {
42753 LDKChannelUsage this_obj_conv;
42754 this_obj_conv.inner = untag_ptr(this_obj);
42755 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42757 ChannelUsage_free(this_obj_conv);
42760 int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) {
42761 LDKChannelUsage this_ptr_conv;
42762 this_ptr_conv.inner = untag_ptr(this_ptr);
42763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42765 this_ptr_conv.is_owned = false;
42766 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
42770 void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) {
42771 LDKChannelUsage this_ptr_conv;
42772 this_ptr_conv.inner = untag_ptr(this_ptr);
42773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42775 this_ptr_conv.is_owned = false;
42776 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
42779 int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) {
42780 LDKChannelUsage this_ptr_conv;
42781 this_ptr_conv.inner = untag_ptr(this_ptr);
42782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42784 this_ptr_conv.is_owned = false;
42785 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
42789 void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) {
42790 LDKChannelUsage this_ptr_conv;
42791 this_ptr_conv.inner = untag_ptr(this_ptr);
42792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42794 this_ptr_conv.is_owned = false;
42795 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
42798 uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) {
42799 LDKChannelUsage this_ptr_conv;
42800 this_ptr_conv.inner = untag_ptr(this_ptr);
42801 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42803 this_ptr_conv.is_owned = false;
42804 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42805 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
42806 uint64_t ret_ref = tag_ptr(ret_copy, true);
42810 void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) {
42811 LDKChannelUsage 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 void* val_ptr = untag_ptr(val);
42817 CHECK_ACCESS(val_ptr);
42818 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
42819 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
42820 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
42823 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) {
42824 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
42825 CHECK_ACCESS(effective_capacity_arg_ptr);
42826 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
42827 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
42828 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
42829 uint64_t ret_ref = 0;
42830 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42831 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42835 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
42836 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
42837 uint64_t ret_ref = 0;
42838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42842 int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) {
42843 LDKChannelUsage arg_conv;
42844 arg_conv.inner = untag_ptr(arg);
42845 arg_conv.is_owned = ptr_is_owned(arg);
42846 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42847 arg_conv.is_owned = false;
42848 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
42852 uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) {
42853 LDKChannelUsage orig_conv;
42854 orig_conv.inner = untag_ptr(orig);
42855 orig_conv.is_owned = ptr_is_owned(orig);
42856 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42857 orig_conv.is_owned = false;
42858 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
42859 uint64_t ret_ref = 0;
42860 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42861 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42865 void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) {
42866 LDKFixedPenaltyScorer this_obj_conv;
42867 this_obj_conv.inner = untag_ptr(this_obj);
42868 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42870 FixedPenaltyScorer_free(this_obj_conv);
42873 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
42874 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
42875 uint64_t ret_ref = 0;
42876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42880 int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) {
42881 LDKFixedPenaltyScorer arg_conv;
42882 arg_conv.inner = untag_ptr(arg);
42883 arg_conv.is_owned = ptr_is_owned(arg);
42884 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42885 arg_conv.is_owned = false;
42886 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
42890 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) {
42891 LDKFixedPenaltyScorer orig_conv;
42892 orig_conv.inner = untag_ptr(orig);
42893 orig_conv.is_owned = ptr_is_owned(orig);
42894 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42895 orig_conv.is_owned = false;
42896 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
42897 uint64_t ret_ref = 0;
42898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42903 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) {
42904 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
42905 uint64_t ret_ref = 0;
42906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42911 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) {
42912 LDKFixedPenaltyScorer this_arg_conv;
42913 this_arg_conv.inner = untag_ptr(this_arg);
42914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42916 this_arg_conv.is_owned = false;
42917 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
42918 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
42919 return tag_ptr(ret_ret, true);
42922 int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) {
42923 LDKFixedPenaltyScorer obj_conv;
42924 obj_conv.inner = untag_ptr(obj);
42925 obj_conv.is_owned = ptr_is_owned(obj);
42926 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42927 obj_conv.is_owned = false;
42928 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
42929 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
42930 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
42931 CVec_u8Z_free(ret_var);
42935 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
42936 LDKu8slice ser_ref;
42937 ser_ref.datalen = ser->arr_len;
42938 ser_ref.data = ser->elems;
42939 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
42940 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
42942 return tag_ptr(ret_conv, true);
42945 void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) {
42946 LDKProbabilisticScorer this_obj_conv;
42947 this_obj_conv.inner = untag_ptr(this_obj);
42948 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42950 ProbabilisticScorer_free(this_obj_conv);
42953 void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) {
42954 LDKProbabilisticScoringParameters this_obj_conv;
42955 this_obj_conv.inner = untag_ptr(this_obj);
42956 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42958 ProbabilisticScoringParameters_free(this_obj_conv);
42961 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_msat(uint64_t this_ptr) {
42962 LDKProbabilisticScoringParameters this_ptr_conv;
42963 this_ptr_conv.inner = untag_ptr(this_ptr);
42964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42966 this_ptr_conv.is_owned = false;
42967 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
42971 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_msat(uint64_t this_ptr, int64_t val) {
42972 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
42980 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) {
42981 LDKProbabilisticScoringParameters this_ptr_conv;
42982 this_ptr_conv.inner = untag_ptr(this_ptr);
42983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42985 this_ptr_conv.is_owned = false;
42986 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
42990 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) {
42991 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
42999 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
43000 LDKProbabilisticScoringParameters this_ptr_conv;
43001 this_ptr_conv.inner = untag_ptr(this_ptr);
43002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43004 this_ptr_conv.is_owned = false;
43005 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
43009 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) {
43010 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
43018 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life(uint64_t this_ptr) {
43019 LDKProbabilisticScoringParameters this_ptr_conv;
43020 this_ptr_conv.inner = untag_ptr(this_ptr);
43021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43023 this_ptr_conv.is_owned = false;
43024 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
43028 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) {
43029 LDKProbabilisticScoringParameters this_ptr_conv;
43030 this_ptr_conv.inner = untag_ptr(this_ptr);
43031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43033 this_ptr_conv.is_owned = false;
43034 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
43037 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) {
43038 LDKProbabilisticScoringParameters this_ptr_conv;
43039 this_ptr_conv.inner = untag_ptr(this_ptr);
43040 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43042 this_ptr_conv.is_owned = false;
43043 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
43047 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) {
43048 LDKProbabilisticScoringParameters this_ptr_conv;
43049 this_ptr_conv.inner = untag_ptr(this_ptr);
43050 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43051 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43052 this_ptr_conv.is_owned = false;
43053 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
43056 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
43057 LDKProbabilisticScoringParameters this_ptr_conv;
43058 this_ptr_conv.inner = untag_ptr(this_ptr);
43059 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43061 this_ptr_conv.is_owned = false;
43062 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
43066 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) {
43067 LDKProbabilisticScoringParameters this_ptr_conv;
43068 this_ptr_conv.inner = untag_ptr(this_ptr);
43069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43071 this_ptr_conv.is_owned = false;
43072 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
43075 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(uint64_t this_ptr) {
43076 LDKProbabilisticScoringParameters this_ptr_conv;
43077 this_ptr_conv.inner = untag_ptr(this_ptr);
43078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43080 this_ptr_conv.is_owned = false;
43081 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
43085 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) {
43086 LDKProbabilisticScoringParameters this_ptr_conv;
43087 this_ptr_conv.inner = untag_ptr(this_ptr);
43088 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43090 this_ptr_conv.is_owned = false;
43091 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
43094 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
43095 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
43096 uint64_t ret_ref = 0;
43097 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43098 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43101 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) {
43102 LDKProbabilisticScoringParameters arg_conv;
43103 arg_conv.inner = untag_ptr(arg);
43104 arg_conv.is_owned = ptr_is_owned(arg);
43105 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43106 arg_conv.is_owned = false;
43107 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
43111 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) {
43112 LDKProbabilisticScoringParameters orig_conv;
43113 orig_conv.inner = untag_ptr(orig);
43114 orig_conv.is_owned = ptr_is_owned(orig);
43115 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43116 orig_conv.is_owned = false;
43117 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
43118 uint64_t ret_ref = 0;
43119 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43120 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43124 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) {
43125 LDKProbabilisticScoringParameters params_conv;
43126 params_conv.inner = untag_ptr(params);
43127 params_conv.is_owned = ptr_is_owned(params);
43128 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
43129 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
43130 LDKNetworkGraph network_graph_conv;
43131 network_graph_conv.inner = untag_ptr(network_graph);
43132 network_graph_conv.is_owned = ptr_is_owned(network_graph);
43133 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
43134 network_graph_conv.is_owned = false;
43135 void* logger_ptr = untag_ptr(logger);
43136 CHECK_ACCESS(logger_ptr);
43137 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43138 if (logger_conv.free == LDKLogger_JCalls_free) {
43139 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43140 LDKLogger_JCalls_cloned(&logger_conv);
43142 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
43143 uint64_t ret_ref = 0;
43144 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43145 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43149 void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) {
43150 LDKProbabilisticScorer this_arg_conv;
43151 this_arg_conv.inner = untag_ptr(this_arg);
43152 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43154 this_arg_conv.is_owned = false;
43155 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
43158 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) {
43159 LDKProbabilisticScorer this_arg_conv;
43160 this_arg_conv.inner = untag_ptr(this_arg);
43161 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43163 this_arg_conv.is_owned = false;
43164 LDKNodeId target_conv;
43165 target_conv.inner = untag_ptr(target);
43166 target_conv.is_owned = ptr_is_owned(target);
43167 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
43168 target_conv.is_owned = false;
43169 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
43170 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
43171 uint64_t ret_ref = tag_ptr(ret_copy, true);
43175 void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
43176 LDKProbabilisticScorer this_arg_conv;
43177 this_arg_conv.inner = untag_ptr(this_arg);
43178 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43180 this_arg_conv.is_owned = false;
43181 LDKNodeId node_id_conv;
43182 node_id_conv.inner = untag_ptr(node_id);
43183 node_id_conv.is_owned = ptr_is_owned(node_id);
43184 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
43185 node_id_conv.is_owned = false;
43186 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
43189 void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) {
43190 LDKProbabilisticScorer this_arg_conv;
43191 this_arg_conv.inner = untag_ptr(this_arg);
43192 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43194 this_arg_conv.is_owned = false;
43195 LDKNodeId node_id_conv;
43196 node_id_conv.inner = untag_ptr(node_id);
43197 node_id_conv.is_owned = ptr_is_owned(node_id);
43198 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
43199 node_id_conv.is_owned = false;
43200 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
43203 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) {
43204 LDKProbabilisticScorer this_arg_conv;
43205 this_arg_conv.inner = untag_ptr(this_arg);
43206 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43208 this_arg_conv.is_owned = false;
43209 LDKNodeId node_id_conv;
43210 node_id_conv.inner = untag_ptr(node_id);
43211 node_id_conv.is_owned = ptr_is_owned(node_id);
43212 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
43213 node_id_conv.is_owned = false;
43214 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
43217 void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) {
43218 LDKProbabilisticScorer this_arg_conv;
43219 this_arg_conv.inner = untag_ptr(this_arg);
43220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43222 this_arg_conv.is_owned = false;
43223 LDKNodeId node_id_conv;
43224 node_id_conv.inner = untag_ptr(node_id);
43225 node_id_conv.is_owned = ptr_is_owned(node_id);
43226 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
43227 node_id_conv.is_owned = false;
43228 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
43231 void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) {
43232 LDKProbabilisticScorer this_arg_conv;
43233 this_arg_conv.inner = untag_ptr(this_arg);
43234 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43236 this_arg_conv.is_owned = false;
43237 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
43240 void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) {
43241 LDKProbabilisticScoringParameters this_arg_conv;
43242 this_arg_conv.inner = untag_ptr(this_arg);
43243 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43245 this_arg_conv.is_owned = false;
43246 LDKCVec_NodeIdZ node_ids_constr;
43247 node_ids_constr.datalen = node_ids->arr_len;
43248 if (node_ids_constr.datalen > 0)
43249 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
43251 node_ids_constr.data = NULL;
43252 uint64_t* node_ids_vals = node_ids->elems;
43253 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
43254 uint64_t node_ids_conv_8 = node_ids_vals[i];
43255 LDKNodeId node_ids_conv_8_conv;
43256 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
43257 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
43258 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
43259 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
43260 node_ids_constr.data[i] = node_ids_conv_8_conv;
43263 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
43266 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() {
43267 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
43268 uint64_t ret_ref = 0;
43269 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43270 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43274 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) {
43275 LDKProbabilisticScorer this_arg_conv;
43276 this_arg_conv.inner = untag_ptr(this_arg);
43277 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43279 this_arg_conv.is_owned = false;
43280 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
43281 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
43282 return tag_ptr(ret_ret, true);
43285 int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) {
43286 LDKProbabilisticScorer obj_conv;
43287 obj_conv.inner = untag_ptr(obj);
43288 obj_conv.is_owned = ptr_is_owned(obj);
43289 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43290 obj_conv.is_owned = false;
43291 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
43292 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43293 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43294 CVec_u8Z_free(ret_var);
43298 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) {
43299 LDKu8slice ser_ref;
43300 ser_ref.datalen = ser->arr_len;
43301 ser_ref.data = ser->elems;
43302 LDKProbabilisticScoringParameters arg_a_conv;
43303 arg_a_conv.inner = untag_ptr(arg_a);
43304 arg_a_conv.is_owned = ptr_is_owned(arg_a);
43305 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
43306 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
43307 LDKNetworkGraph arg_b_conv;
43308 arg_b_conv.inner = untag_ptr(arg_b);
43309 arg_b_conv.is_owned = ptr_is_owned(arg_b);
43310 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
43311 arg_b_conv.is_owned = false;
43312 void* arg_c_ptr = untag_ptr(arg_c);
43313 CHECK_ACCESS(arg_c_ptr);
43314 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
43315 if (arg_c_conv.free == LDKLogger_JCalls_free) {
43316 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43317 LDKLogger_JCalls_cloned(&arg_c_conv);
43319 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
43320 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
43322 return tag_ptr(ret_conv, true);
43325 void __attribute__((export_name("TS_BlindedRoute_free"))) TS_BlindedRoute_free(uint64_t this_obj) {
43326 LDKBlindedRoute this_obj_conv;
43327 this_obj_conv.inner = untag_ptr(this_obj);
43328 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43330 BlindedRoute_free(this_obj_conv);
43333 void __attribute__((export_name("TS_BlindedHop_free"))) TS_BlindedHop_free(uint64_t this_obj) {
43334 LDKBlindedHop this_obj_conv;
43335 this_obj_conv.inner = untag_ptr(this_obj);
43336 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43338 BlindedHop_free(this_obj_conv);
43341 uint64_t __attribute__((export_name("TS_BlindedRoute_new"))) TS_BlindedRoute_new(ptrArray node_pks, uint64_t keys_manager) {
43342 LDKCVec_PublicKeyZ node_pks_constr;
43343 node_pks_constr.datalen = node_pks->arr_len;
43344 if (node_pks_constr.datalen > 0)
43345 node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
43347 node_pks_constr.data = NULL;
43348 int8_tArray* node_pks_vals = (void*) node_pks->elems;
43349 for (size_t m = 0; m < node_pks_constr.datalen; m++) {
43350 int8_tArray node_pks_conv_12 = node_pks_vals[m];
43351 LDKPublicKey node_pks_conv_12_ref;
43352 CHECK(node_pks_conv_12->arr_len == 33);
43353 memcpy(node_pks_conv_12_ref.compressed_form, node_pks_conv_12->elems, 33); FREE(node_pks_conv_12);
43354 node_pks_constr.data[m] = node_pks_conv_12_ref;
43357 void* keys_manager_ptr = untag_ptr(keys_manager);
43358 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
43359 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
43360 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
43361 *ret_conv = BlindedRoute_new(node_pks_constr, keys_manager_conv);
43362 return tag_ptr(ret_conv, true);
43365 int8_tArray __attribute__((export_name("TS_BlindedRoute_write"))) TS_BlindedRoute_write(uint64_t obj) {
43366 LDKBlindedRoute obj_conv;
43367 obj_conv.inner = untag_ptr(obj);
43368 obj_conv.is_owned = ptr_is_owned(obj);
43369 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43370 obj_conv.is_owned = false;
43371 LDKCVec_u8Z ret_var = BlindedRoute_write(&obj_conv);
43372 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43373 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43374 CVec_u8Z_free(ret_var);
43378 uint64_t __attribute__((export_name("TS_BlindedRoute_read"))) TS_BlindedRoute_read(int8_tArray ser) {
43379 LDKu8slice ser_ref;
43380 ser_ref.datalen = ser->arr_len;
43381 ser_ref.data = ser->elems;
43382 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
43383 *ret_conv = BlindedRoute_read(ser_ref);
43385 return tag_ptr(ret_conv, true);
43388 int8_tArray __attribute__((export_name("TS_BlindedHop_write"))) TS_BlindedHop_write(uint64_t obj) {
43389 LDKBlindedHop obj_conv;
43390 obj_conv.inner = untag_ptr(obj);
43391 obj_conv.is_owned = ptr_is_owned(obj);
43392 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43393 obj_conv.is_owned = false;
43394 LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
43395 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
43396 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
43397 CVec_u8Z_free(ret_var);
43401 uint64_t __attribute__((export_name("TS_BlindedHop_read"))) TS_BlindedHop_read(int8_tArray ser) {
43402 LDKu8slice ser_ref;
43403 ser_ref.datalen = ser->arr_len;
43404 ser_ref.data = ser->elems;
43405 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
43406 *ret_conv = BlindedHop_read(ser_ref);
43408 return tag_ptr(ret_conv, true);
43411 void __attribute__((export_name("TS_OnionMessenger_free"))) TS_OnionMessenger_free(uint64_t this_obj) {
43412 LDKOnionMessenger this_obj_conv;
43413 this_obj_conv.inner = untag_ptr(this_obj);
43414 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43416 OnionMessenger_free(this_obj_conv);
43419 void __attribute__((export_name("TS_Destination_free"))) TS_Destination_free(uint64_t this_ptr) {
43420 if (!ptr_is_owned(this_ptr)) return;
43421 void* this_ptr_ptr = untag_ptr(this_ptr);
43422 CHECK_ACCESS(this_ptr_ptr);
43423 LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
43424 FREE(untag_ptr(this_ptr));
43425 Destination_free(this_ptr_conv);
43428 uint64_t __attribute__((export_name("TS_Destination_node"))) TS_Destination_node(int8_tArray a) {
43429 LDKPublicKey a_ref;
43430 CHECK(a->arr_len == 33);
43431 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
43432 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
43433 *ret_copy = Destination_node(a_ref);
43434 uint64_t ret_ref = tag_ptr(ret_copy, true);
43438 uint64_t __attribute__((export_name("TS_Destination_blinded_route"))) TS_Destination_blinded_route(uint64_t a) {
43439 LDKBlindedRoute a_conv;
43440 a_conv.inner = untag_ptr(a);
43441 a_conv.is_owned = ptr_is_owned(a);
43442 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43443 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
43445 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
43446 *ret_copy = Destination_blinded_route(a_conv);
43447 uint64_t ret_ref = tag_ptr(ret_copy, true);
43451 void __attribute__((export_name("TS_SendError_free"))) TS_SendError_free(uint64_t this_ptr) {
43452 if (!ptr_is_owned(this_ptr)) return;
43453 void* this_ptr_ptr = untag_ptr(this_ptr);
43454 CHECK_ACCESS(this_ptr_ptr);
43455 LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
43456 FREE(untag_ptr(this_ptr));
43457 SendError_free(this_ptr_conv);
43460 static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
43461 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43462 *ret_copy = SendError_clone(arg);
43463 uint64_t ret_ref = tag_ptr(ret_copy, true);
43466 int64_t __attribute__((export_name("TS_SendError_clone_ptr"))) TS_SendError_clone_ptr(uint64_t arg) {
43467 LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
43468 int64_t ret_conv = SendError_clone_ptr(arg_conv);
43472 uint64_t __attribute__((export_name("TS_SendError_clone"))) TS_SendError_clone(uint64_t orig) {
43473 LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
43474 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43475 *ret_copy = SendError_clone(orig_conv);
43476 uint64_t ret_ref = tag_ptr(ret_copy, true);
43480 uint64_t __attribute__((export_name("TS_SendError_secp256k1"))) TS_SendError_secp256k1(uint32_t a) {
43481 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
43482 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43483 *ret_copy = SendError_secp256k1(a_conv);
43484 uint64_t ret_ref = tag_ptr(ret_copy, true);
43488 uint64_t __attribute__((export_name("TS_SendError_too_big_packet"))) TS_SendError_too_big_packet() {
43489 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43490 *ret_copy = SendError_too_big_packet();
43491 uint64_t ret_ref = tag_ptr(ret_copy, true);
43495 uint64_t __attribute__((export_name("TS_SendError_too_few_blinded_hops"))) TS_SendError_too_few_blinded_hops() {
43496 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43497 *ret_copy = SendError_too_few_blinded_hops();
43498 uint64_t ret_ref = tag_ptr(ret_copy, true);
43502 uint64_t __attribute__((export_name("TS_SendError_invalid_first_hop"))) TS_SendError_invalid_first_hop() {
43503 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43504 *ret_copy = SendError_invalid_first_hop();
43505 uint64_t ret_ref = tag_ptr(ret_copy, true);
43509 uint64_t __attribute__((export_name("TS_SendError_buffer_full"))) TS_SendError_buffer_full() {
43510 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
43511 *ret_copy = SendError_buffer_full();
43512 uint64_t ret_ref = tag_ptr(ret_copy, true);
43516 uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t keys_manager, uint64_t logger) {
43517 void* keys_manager_ptr = untag_ptr(keys_manager);
43518 CHECK_ACCESS(keys_manager_ptr);
43519 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
43520 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
43521 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43522 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
43524 void* logger_ptr = untag_ptr(logger);
43525 CHECK_ACCESS(logger_ptr);
43526 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43527 if (logger_conv.free == LDKLogger_JCalls_free) {
43528 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43529 LDKLogger_JCalls_cloned(&logger_conv);
43531 LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_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 uint64_t __attribute__((export_name("TS_OnionMessenger_send_onion_message"))) TS_OnionMessenger_send_onion_message(uint64_t this_arg, ptrArray intermediate_nodes, uint64_t destination, uint64_t reply_path) {
43539 LDKOnionMessenger this_arg_conv;
43540 this_arg_conv.inner = untag_ptr(this_arg);
43541 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43543 this_arg_conv.is_owned = false;
43544 LDKCVec_PublicKeyZ intermediate_nodes_constr;
43545 intermediate_nodes_constr.datalen = intermediate_nodes->arr_len;
43546 if (intermediate_nodes_constr.datalen > 0)
43547 intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
43549 intermediate_nodes_constr.data = NULL;
43550 int8_tArray* intermediate_nodes_vals = (void*) intermediate_nodes->elems;
43551 for (size_t m = 0; m < intermediate_nodes_constr.datalen; m++) {
43552 int8_tArray intermediate_nodes_conv_12 = intermediate_nodes_vals[m];
43553 LDKPublicKey intermediate_nodes_conv_12_ref;
43554 CHECK(intermediate_nodes_conv_12->arr_len == 33);
43555 memcpy(intermediate_nodes_conv_12_ref.compressed_form, intermediate_nodes_conv_12->elems, 33); FREE(intermediate_nodes_conv_12);
43556 intermediate_nodes_constr.data[m] = intermediate_nodes_conv_12_ref;
43558 FREE(intermediate_nodes);
43559 void* destination_ptr = untag_ptr(destination);
43560 CHECK_ACCESS(destination_ptr);
43561 LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
43562 // WARNING: we may need a move here but no clone is available for LDKDestination
43563 LDKBlindedRoute reply_path_conv;
43564 reply_path_conv.inner = untag_ptr(reply_path);
43565 reply_path_conv.is_owned = ptr_is_owned(reply_path);
43566 CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
43567 reply_path_conv.is_owned = false;
43568 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
43569 *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, reply_path_conv);
43570 return tag_ptr(ret_conv, true);
43573 uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageHandler"))) TS_OnionMessenger_as_OnionMessageHandler(uint64_t this_arg) {
43574 LDKOnionMessenger this_arg_conv;
43575 this_arg_conv.inner = untag_ptr(this_arg);
43576 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43578 this_arg_conv.is_owned = false;
43579 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
43580 *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
43581 return tag_ptr(ret_ret, true);
43584 uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageProvider"))) TS_OnionMessenger_as_OnionMessageProvider(uint64_t this_arg) {
43585 LDKOnionMessenger this_arg_conv;
43586 this_arg_conv.inner = untag_ptr(this_arg);
43587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43589 this_arg_conv.is_owned = false;
43590 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
43591 *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
43592 return tag_ptr(ret_ret, true);
43595 void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
43596 if (!ptr_is_owned(this_ptr)) return;
43597 void* this_ptr_ptr = untag_ptr(this_ptr);
43598 CHECK_ACCESS(this_ptr_ptr);
43599 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
43600 FREE(untag_ptr(this_ptr));
43601 ParseError_free(this_ptr_conv);
43604 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
43605 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43606 *ret_copy = ParseError_clone(arg);
43607 uint64_t ret_ref = tag_ptr(ret_copy, true);
43610 int64_t __attribute__((export_name("TS_ParseError_clone_ptr"))) TS_ParseError_clone_ptr(uint64_t arg) {
43611 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
43612 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
43616 uint64_t __attribute__((export_name("TS_ParseError_clone"))) TS_ParseError_clone(uint64_t orig) {
43617 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
43618 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43619 *ret_copy = ParseError_clone(orig_conv);
43620 uint64_t ret_ref = tag_ptr(ret_copy, true);
43624 uint64_t __attribute__((export_name("TS_ParseError_bech32_error"))) TS_ParseError_bech32_error(uint64_t a) {
43625 void* a_ptr = untag_ptr(a);
43626 CHECK_ACCESS(a_ptr);
43627 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
43628 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
43629 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43630 *ret_copy = ParseError_bech32_error(a_conv);
43631 uint64_t ret_ref = tag_ptr(ret_copy, true);
43635 uint64_t __attribute__((export_name("TS_ParseError_parse_amount_error"))) TS_ParseError_parse_amount_error(int32_t a) {
43637 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43638 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
43639 uint64_t ret_ref = tag_ptr(ret_copy, true);
43643 uint64_t __attribute__((export_name("TS_ParseError_malformed_signature"))) TS_ParseError_malformed_signature(uint32_t a) {
43644 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
43645 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43646 *ret_copy = ParseError_malformed_signature(a_conv);
43647 uint64_t ret_ref = tag_ptr(ret_copy, true);
43651 uint64_t __attribute__((export_name("TS_ParseError_bad_prefix"))) TS_ParseError_bad_prefix() {
43652 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43653 *ret_copy = ParseError_bad_prefix();
43654 uint64_t ret_ref = tag_ptr(ret_copy, true);
43658 uint64_t __attribute__((export_name("TS_ParseError_unknown_currency"))) TS_ParseError_unknown_currency() {
43659 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43660 *ret_copy = ParseError_unknown_currency();
43661 uint64_t ret_ref = tag_ptr(ret_copy, true);
43665 uint64_t __attribute__((export_name("TS_ParseError_unknown_si_prefix"))) TS_ParseError_unknown_si_prefix() {
43666 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43667 *ret_copy = ParseError_unknown_si_prefix();
43668 uint64_t ret_ref = tag_ptr(ret_copy, true);
43672 uint64_t __attribute__((export_name("TS_ParseError_malformed_hrp"))) TS_ParseError_malformed_hrp() {
43673 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43674 *ret_copy = ParseError_malformed_hrp();
43675 uint64_t ret_ref = tag_ptr(ret_copy, true);
43679 uint64_t __attribute__((export_name("TS_ParseError_too_short_data_part"))) TS_ParseError_too_short_data_part() {
43680 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43681 *ret_copy = ParseError_too_short_data_part();
43682 uint64_t ret_ref = tag_ptr(ret_copy, true);
43686 uint64_t __attribute__((export_name("TS_ParseError_unexpected_end_of_tagged_fields"))) TS_ParseError_unexpected_end_of_tagged_fields() {
43687 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43688 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
43689 uint64_t ret_ref = tag_ptr(ret_copy, true);
43693 uint64_t __attribute__((export_name("TS_ParseError_description_decode_error"))) TS_ParseError_description_decode_error(int32_t a) {
43695 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43696 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
43697 uint64_t ret_ref = tag_ptr(ret_copy, true);
43701 uint64_t __attribute__((export_name("TS_ParseError_padding_error"))) TS_ParseError_padding_error() {
43702 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43703 *ret_copy = ParseError_padding_error();
43704 uint64_t ret_ref = tag_ptr(ret_copy, true);
43708 uint64_t __attribute__((export_name("TS_ParseError_integer_overflow_error"))) TS_ParseError_integer_overflow_error() {
43709 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43710 *ret_copy = ParseError_integer_overflow_error();
43711 uint64_t ret_ref = tag_ptr(ret_copy, true);
43715 uint64_t __attribute__((export_name("TS_ParseError_invalid_seg_wit_program_length"))) TS_ParseError_invalid_seg_wit_program_length() {
43716 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43717 *ret_copy = ParseError_invalid_seg_wit_program_length();
43718 uint64_t ret_ref = tag_ptr(ret_copy, true);
43722 uint64_t __attribute__((export_name("TS_ParseError_invalid_pub_key_hash_length"))) TS_ParseError_invalid_pub_key_hash_length() {
43723 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43724 *ret_copy = ParseError_invalid_pub_key_hash_length();
43725 uint64_t ret_ref = tag_ptr(ret_copy, true);
43729 uint64_t __attribute__((export_name("TS_ParseError_invalid_script_hash_length"))) TS_ParseError_invalid_script_hash_length() {
43730 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43731 *ret_copy = ParseError_invalid_script_hash_length();
43732 uint64_t ret_ref = tag_ptr(ret_copy, true);
43736 uint64_t __attribute__((export_name("TS_ParseError_invalid_recovery_id"))) TS_ParseError_invalid_recovery_id() {
43737 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43738 *ret_copy = ParseError_invalid_recovery_id();
43739 uint64_t ret_ref = tag_ptr(ret_copy, true);
43743 uint64_t __attribute__((export_name("TS_ParseError_invalid_slice_length"))) TS_ParseError_invalid_slice_length(jstring a) {
43744 LDKStr a_conv = str_ref_to_owned_c(a);
43745 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43746 *ret_copy = ParseError_invalid_slice_length(a_conv);
43747 uint64_t ret_ref = tag_ptr(ret_copy, true);
43751 uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip() {
43752 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
43753 *ret_copy = ParseError_skip();
43754 uint64_t ret_ref = tag_ptr(ret_copy, true);
43758 void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
43759 if (!ptr_is_owned(this_ptr)) return;
43760 void* this_ptr_ptr = untag_ptr(this_ptr);
43761 CHECK_ACCESS(this_ptr_ptr);
43762 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
43763 FREE(untag_ptr(this_ptr));
43764 ParseOrSemanticError_free(this_ptr_conv);
43767 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
43768 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
43769 *ret_copy = ParseOrSemanticError_clone(arg);
43770 uint64_t ret_ref = tag_ptr(ret_copy, true);
43773 int64_t __attribute__((export_name("TS_ParseOrSemanticError_clone_ptr"))) TS_ParseOrSemanticError_clone_ptr(uint64_t arg) {
43774 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
43775 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
43779 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_clone"))) TS_ParseOrSemanticError_clone(uint64_t orig) {
43780 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
43781 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
43782 *ret_copy = ParseOrSemanticError_clone(orig_conv);
43783 uint64_t ret_ref = tag_ptr(ret_copy, true);
43787 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_parse_error"))) TS_ParseOrSemanticError_parse_error(uint64_t a) {
43788 void* a_ptr = untag_ptr(a);
43789 CHECK_ACCESS(a_ptr);
43790 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
43791 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
43792 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
43793 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
43794 uint64_t ret_ref = tag_ptr(ret_copy, true);
43798 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) TS_ParseOrSemanticError_semantic_error(uint32_t a) {
43799 LDKSemanticError a_conv = LDKSemanticError_from_js(a);
43800 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
43801 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
43802 uint64_t ret_ref = tag_ptr(ret_copy, true);
43806 void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
43807 LDKInvoice this_obj_conv;
43808 this_obj_conv.inner = untag_ptr(this_obj);
43809 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43811 Invoice_free(this_obj_conv);
43814 jboolean __attribute__((export_name("TS_Invoice_eq"))) TS_Invoice_eq(uint64_t a, uint64_t b) {
43816 a_conv.inner = untag_ptr(a);
43817 a_conv.is_owned = ptr_is_owned(a);
43818 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43819 a_conv.is_owned = false;
43821 b_conv.inner = untag_ptr(b);
43822 b_conv.is_owned = ptr_is_owned(b);
43823 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43824 b_conv.is_owned = false;
43825 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
43829 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
43830 LDKInvoice ret_var = Invoice_clone(arg);
43831 uint64_t ret_ref = 0;
43832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43836 int64_t __attribute__((export_name("TS_Invoice_clone_ptr"))) TS_Invoice_clone_ptr(uint64_t arg) {
43837 LDKInvoice arg_conv;
43838 arg_conv.inner = untag_ptr(arg);
43839 arg_conv.is_owned = ptr_is_owned(arg);
43840 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43841 arg_conv.is_owned = false;
43842 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
43846 uint64_t __attribute__((export_name("TS_Invoice_clone"))) TS_Invoice_clone(uint64_t orig) {
43847 LDKInvoice orig_conv;
43848 orig_conv.inner = untag_ptr(orig);
43849 orig_conv.is_owned = ptr_is_owned(orig);
43850 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43851 orig_conv.is_owned = false;
43852 LDKInvoice ret_var = Invoice_clone(&orig_conv);
43853 uint64_t ret_ref = 0;
43854 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43855 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43859 int64_t __attribute__((export_name("TS_Invoice_hash"))) TS_Invoice_hash(uint64_t o) {
43861 o_conv.inner = untag_ptr(o);
43862 o_conv.is_owned = ptr_is_owned(o);
43863 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43864 o_conv.is_owned = false;
43865 int64_t ret_conv = Invoice_hash(&o_conv);
43869 void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
43870 LDKSignedRawInvoice this_obj_conv;
43871 this_obj_conv.inner = untag_ptr(this_obj);
43872 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43874 SignedRawInvoice_free(this_obj_conv);
43877 jboolean __attribute__((export_name("TS_SignedRawInvoice_eq"))) TS_SignedRawInvoice_eq(uint64_t a, uint64_t b) {
43878 LDKSignedRawInvoice a_conv;
43879 a_conv.inner = untag_ptr(a);
43880 a_conv.is_owned = ptr_is_owned(a);
43881 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43882 a_conv.is_owned = false;
43883 LDKSignedRawInvoice b_conv;
43884 b_conv.inner = untag_ptr(b);
43885 b_conv.is_owned = ptr_is_owned(b);
43886 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43887 b_conv.is_owned = false;
43888 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
43892 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
43893 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
43894 uint64_t ret_ref = 0;
43895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43899 int64_t __attribute__((export_name("TS_SignedRawInvoice_clone_ptr"))) TS_SignedRawInvoice_clone_ptr(uint64_t arg) {
43900 LDKSignedRawInvoice arg_conv;
43901 arg_conv.inner = untag_ptr(arg);
43902 arg_conv.is_owned = ptr_is_owned(arg);
43903 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43904 arg_conv.is_owned = false;
43905 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
43909 uint64_t __attribute__((export_name("TS_SignedRawInvoice_clone"))) TS_SignedRawInvoice_clone(uint64_t orig) {
43910 LDKSignedRawInvoice orig_conv;
43911 orig_conv.inner = untag_ptr(orig);
43912 orig_conv.is_owned = ptr_is_owned(orig);
43913 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43914 orig_conv.is_owned = false;
43915 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
43916 uint64_t ret_ref = 0;
43917 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43918 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43922 int64_t __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t o) {
43923 LDKSignedRawInvoice o_conv;
43924 o_conv.inner = untag_ptr(o);
43925 o_conv.is_owned = ptr_is_owned(o);
43926 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43927 o_conv.is_owned = false;
43928 int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
43932 void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
43933 LDKRawInvoice this_obj_conv;
43934 this_obj_conv.inner = untag_ptr(this_obj);
43935 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43937 RawInvoice_free(this_obj_conv);
43940 uint64_t __attribute__((export_name("TS_RawInvoice_get_data"))) TS_RawInvoice_get_data(uint64_t this_ptr) {
43941 LDKRawInvoice this_ptr_conv;
43942 this_ptr_conv.inner = untag_ptr(this_ptr);
43943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43945 this_ptr_conv.is_owned = false;
43946 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
43947 uint64_t ret_ref = 0;
43948 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43949 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43953 void __attribute__((export_name("TS_RawInvoice_set_data"))) TS_RawInvoice_set_data(uint64_t this_ptr, uint64_t val) {
43954 LDKRawInvoice this_ptr_conv;
43955 this_ptr_conv.inner = untag_ptr(this_ptr);
43956 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43958 this_ptr_conv.is_owned = false;
43959 LDKRawDataPart val_conv;
43960 val_conv.inner = untag_ptr(val);
43961 val_conv.is_owned = ptr_is_owned(val);
43962 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43963 val_conv = RawDataPart_clone(&val_conv);
43964 RawInvoice_set_data(&this_ptr_conv, val_conv);
43967 jboolean __attribute__((export_name("TS_RawInvoice_eq"))) TS_RawInvoice_eq(uint64_t a, uint64_t b) {
43968 LDKRawInvoice a_conv;
43969 a_conv.inner = untag_ptr(a);
43970 a_conv.is_owned = ptr_is_owned(a);
43971 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43972 a_conv.is_owned = false;
43973 LDKRawInvoice b_conv;
43974 b_conv.inner = untag_ptr(b);
43975 b_conv.is_owned = ptr_is_owned(b);
43976 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43977 b_conv.is_owned = false;
43978 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
43982 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
43983 LDKRawInvoice ret_var = RawInvoice_clone(arg);
43984 uint64_t ret_ref = 0;
43985 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43986 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43989 int64_t __attribute__((export_name("TS_RawInvoice_clone_ptr"))) TS_RawInvoice_clone_ptr(uint64_t arg) {
43990 LDKRawInvoice arg_conv;
43991 arg_conv.inner = untag_ptr(arg);
43992 arg_conv.is_owned = ptr_is_owned(arg);
43993 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43994 arg_conv.is_owned = false;
43995 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
43999 uint64_t __attribute__((export_name("TS_RawInvoice_clone"))) TS_RawInvoice_clone(uint64_t orig) {
44000 LDKRawInvoice orig_conv;
44001 orig_conv.inner = untag_ptr(orig);
44002 orig_conv.is_owned = ptr_is_owned(orig);
44003 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44004 orig_conv.is_owned = false;
44005 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
44006 uint64_t ret_ref = 0;
44007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44012 int64_t __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t o) {
44013 LDKRawInvoice o_conv;
44014 o_conv.inner = untag_ptr(o);
44015 o_conv.is_owned = ptr_is_owned(o);
44016 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44017 o_conv.is_owned = false;
44018 int64_t ret_conv = RawInvoice_hash(&o_conv);
44022 void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
44023 LDKRawDataPart this_obj_conv;
44024 this_obj_conv.inner = untag_ptr(this_obj);
44025 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44027 RawDataPart_free(this_obj_conv);
44030 uint64_t __attribute__((export_name("TS_RawDataPart_get_timestamp"))) TS_RawDataPart_get_timestamp(uint64_t this_ptr) {
44031 LDKRawDataPart this_ptr_conv;
44032 this_ptr_conv.inner = untag_ptr(this_ptr);
44033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44035 this_ptr_conv.is_owned = false;
44036 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
44037 uint64_t ret_ref = 0;
44038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44043 void __attribute__((export_name("TS_RawDataPart_set_timestamp"))) TS_RawDataPart_set_timestamp(uint64_t this_ptr, uint64_t val) {
44044 LDKRawDataPart this_ptr_conv;
44045 this_ptr_conv.inner = untag_ptr(this_ptr);
44046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44048 this_ptr_conv.is_owned = false;
44049 LDKPositiveTimestamp val_conv;
44050 val_conv.inner = untag_ptr(val);
44051 val_conv.is_owned = ptr_is_owned(val);
44052 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
44053 val_conv = PositiveTimestamp_clone(&val_conv);
44054 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
44057 jboolean __attribute__((export_name("TS_RawDataPart_eq"))) TS_RawDataPart_eq(uint64_t a, uint64_t b) {
44058 LDKRawDataPart a_conv;
44059 a_conv.inner = untag_ptr(a);
44060 a_conv.is_owned = ptr_is_owned(a);
44061 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44062 a_conv.is_owned = false;
44063 LDKRawDataPart b_conv;
44064 b_conv.inner = untag_ptr(b);
44065 b_conv.is_owned = ptr_is_owned(b);
44066 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44067 b_conv.is_owned = false;
44068 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
44072 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
44073 LDKRawDataPart ret_var = RawDataPart_clone(arg);
44074 uint64_t ret_ref = 0;
44075 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44076 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44079 int64_t __attribute__((export_name("TS_RawDataPart_clone_ptr"))) TS_RawDataPart_clone_ptr(uint64_t arg) {
44080 LDKRawDataPart arg_conv;
44081 arg_conv.inner = untag_ptr(arg);
44082 arg_conv.is_owned = ptr_is_owned(arg);
44083 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44084 arg_conv.is_owned = false;
44085 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
44089 uint64_t __attribute__((export_name("TS_RawDataPart_clone"))) TS_RawDataPart_clone(uint64_t orig) {
44090 LDKRawDataPart orig_conv;
44091 orig_conv.inner = untag_ptr(orig);
44092 orig_conv.is_owned = ptr_is_owned(orig);
44093 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44094 orig_conv.is_owned = false;
44095 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
44096 uint64_t ret_ref = 0;
44097 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44098 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44102 int64_t __attribute__((export_name("TS_RawDataPart_hash"))) TS_RawDataPart_hash(uint64_t o) {
44103 LDKRawDataPart o_conv;
44104 o_conv.inner = untag_ptr(o);
44105 o_conv.is_owned = ptr_is_owned(o);
44106 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44107 o_conv.is_owned = false;
44108 int64_t ret_conv = RawDataPart_hash(&o_conv);
44112 void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
44113 LDKPositiveTimestamp this_obj_conv;
44114 this_obj_conv.inner = untag_ptr(this_obj);
44115 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44117 PositiveTimestamp_free(this_obj_conv);
44120 jboolean __attribute__((export_name("TS_PositiveTimestamp_eq"))) TS_PositiveTimestamp_eq(uint64_t a, uint64_t b) {
44121 LDKPositiveTimestamp a_conv;
44122 a_conv.inner = untag_ptr(a);
44123 a_conv.is_owned = ptr_is_owned(a);
44124 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44125 a_conv.is_owned = false;
44126 LDKPositiveTimestamp b_conv;
44127 b_conv.inner = untag_ptr(b);
44128 b_conv.is_owned = ptr_is_owned(b);
44129 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44130 b_conv.is_owned = false;
44131 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
44135 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
44136 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
44137 uint64_t ret_ref = 0;
44138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44142 int64_t __attribute__((export_name("TS_PositiveTimestamp_clone_ptr"))) TS_PositiveTimestamp_clone_ptr(uint64_t arg) {
44143 LDKPositiveTimestamp arg_conv;
44144 arg_conv.inner = untag_ptr(arg);
44145 arg_conv.is_owned = ptr_is_owned(arg);
44146 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44147 arg_conv.is_owned = false;
44148 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
44152 uint64_t __attribute__((export_name("TS_PositiveTimestamp_clone"))) TS_PositiveTimestamp_clone(uint64_t orig) {
44153 LDKPositiveTimestamp orig_conv;
44154 orig_conv.inner = untag_ptr(orig);
44155 orig_conv.is_owned = ptr_is_owned(orig);
44156 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44157 orig_conv.is_owned = false;
44158 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
44159 uint64_t ret_ref = 0;
44160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44165 int64_t __attribute__((export_name("TS_PositiveTimestamp_hash"))) TS_PositiveTimestamp_hash(uint64_t o) {
44166 LDKPositiveTimestamp o_conv;
44167 o_conv.inner = untag_ptr(o);
44168 o_conv.is_owned = ptr_is_owned(o);
44169 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44170 o_conv.is_owned = false;
44171 int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
44175 uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
44176 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
44177 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
44181 uint32_t __attribute__((export_name("TS_SiPrefix_milli"))) TS_SiPrefix_milli() {
44182 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
44186 uint32_t __attribute__((export_name("TS_SiPrefix_micro"))) TS_SiPrefix_micro() {
44187 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
44191 uint32_t __attribute__((export_name("TS_SiPrefix_nano"))) TS_SiPrefix_nano() {
44192 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
44196 uint32_t __attribute__((export_name("TS_SiPrefix_pico"))) TS_SiPrefix_pico() {
44197 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
44201 jboolean __attribute__((export_name("TS_SiPrefix_eq"))) TS_SiPrefix_eq(uint64_t a, uint64_t b) {
44202 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
44203 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
44204 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
44208 int64_t __attribute__((export_name("TS_SiPrefix_hash"))) TS_SiPrefix_hash(uint64_t o) {
44209 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
44210 int64_t ret_conv = SiPrefix_hash(o_conv);
44214 int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
44215 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
44216 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
44220 uint32_t __attribute__((export_name("TS_Currency_clone"))) TS_Currency_clone(uint64_t orig) {
44221 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
44222 uint32_t ret_conv = LDKCurrency_to_js(Currency_clone(orig_conv));
44226 uint32_t __attribute__((export_name("TS_Currency_bitcoin"))) TS_Currency_bitcoin() {
44227 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
44231 uint32_t __attribute__((export_name("TS_Currency_bitcoin_testnet"))) TS_Currency_bitcoin_testnet() {
44232 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
44236 uint32_t __attribute__((export_name("TS_Currency_regtest"))) TS_Currency_regtest() {
44237 uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
44241 uint32_t __attribute__((export_name("TS_Currency_simnet"))) TS_Currency_simnet() {
44242 uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
44246 uint32_t __attribute__((export_name("TS_Currency_signet"))) TS_Currency_signet() {
44247 uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
44251 int64_t __attribute__((export_name("TS_Currency_hash"))) TS_Currency_hash(uint64_t o) {
44252 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
44253 int64_t ret_conv = Currency_hash(o_conv);
44257 jboolean __attribute__((export_name("TS_Currency_eq"))) TS_Currency_eq(uint64_t a, uint64_t b) {
44258 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
44259 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
44260 jboolean ret_conv = Currency_eq(a_conv, b_conv);
44264 void __attribute__((export_name("TS_Sha256_free"))) TS_Sha256_free(uint64_t this_obj) {
44265 LDKSha256 this_obj_conv;
44266 this_obj_conv.inner = untag_ptr(this_obj);
44267 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44269 Sha256_free(this_obj_conv);
44272 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
44273 LDKSha256 ret_var = Sha256_clone(arg);
44274 uint64_t ret_ref = 0;
44275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44279 int64_t __attribute__((export_name("TS_Sha256_clone_ptr"))) TS_Sha256_clone_ptr(uint64_t arg) {
44280 LDKSha256 arg_conv;
44281 arg_conv.inner = untag_ptr(arg);
44282 arg_conv.is_owned = ptr_is_owned(arg);
44283 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44284 arg_conv.is_owned = false;
44285 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
44289 uint64_t __attribute__((export_name("TS_Sha256_clone"))) TS_Sha256_clone(uint64_t orig) {
44290 LDKSha256 orig_conv;
44291 orig_conv.inner = untag_ptr(orig);
44292 orig_conv.is_owned = ptr_is_owned(orig);
44293 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44294 orig_conv.is_owned = false;
44295 LDKSha256 ret_var = Sha256_clone(&orig_conv);
44296 uint64_t ret_ref = 0;
44297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44302 int64_t __attribute__((export_name("TS_Sha256_hash"))) TS_Sha256_hash(uint64_t o) {
44304 o_conv.inner = untag_ptr(o);
44305 o_conv.is_owned = ptr_is_owned(o);
44306 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44307 o_conv.is_owned = false;
44308 int64_t ret_conv = Sha256_hash(&o_conv);
44312 jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, uint64_t b) {
44314 a_conv.inner = untag_ptr(a);
44315 a_conv.is_owned = ptr_is_owned(a);
44316 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44317 a_conv.is_owned = false;
44319 b_conv.inner = untag_ptr(b);
44320 b_conv.is_owned = ptr_is_owned(b);
44321 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44322 b_conv.is_owned = false;
44323 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
44327 void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) {
44328 LDKDescription this_obj_conv;
44329 this_obj_conv.inner = untag_ptr(this_obj);
44330 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44332 Description_free(this_obj_conv);
44335 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
44336 LDKDescription ret_var = Description_clone(arg);
44337 uint64_t ret_ref = 0;
44338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44342 int64_t __attribute__((export_name("TS_Description_clone_ptr"))) TS_Description_clone_ptr(uint64_t arg) {
44343 LDKDescription arg_conv;
44344 arg_conv.inner = untag_ptr(arg);
44345 arg_conv.is_owned = ptr_is_owned(arg);
44346 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44347 arg_conv.is_owned = false;
44348 int64_t ret_conv = Description_clone_ptr(&arg_conv);
44352 uint64_t __attribute__((export_name("TS_Description_clone"))) TS_Description_clone(uint64_t orig) {
44353 LDKDescription orig_conv;
44354 orig_conv.inner = untag_ptr(orig);
44355 orig_conv.is_owned = ptr_is_owned(orig);
44356 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44357 orig_conv.is_owned = false;
44358 LDKDescription ret_var = Description_clone(&orig_conv);
44359 uint64_t ret_ref = 0;
44360 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44361 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44365 int64_t __attribute__((export_name("TS_Description_hash"))) TS_Description_hash(uint64_t o) {
44366 LDKDescription o_conv;
44367 o_conv.inner = untag_ptr(o);
44368 o_conv.is_owned = ptr_is_owned(o);
44369 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44370 o_conv.is_owned = false;
44371 int64_t ret_conv = Description_hash(&o_conv);
44375 jboolean __attribute__((export_name("TS_Description_eq"))) TS_Description_eq(uint64_t a, uint64_t b) {
44376 LDKDescription a_conv;
44377 a_conv.inner = untag_ptr(a);
44378 a_conv.is_owned = ptr_is_owned(a);
44379 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44380 a_conv.is_owned = false;
44381 LDKDescription b_conv;
44382 b_conv.inner = untag_ptr(b);
44383 b_conv.is_owned = ptr_is_owned(b);
44384 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44385 b_conv.is_owned = false;
44386 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
44390 void __attribute__((export_name("TS_PayeePubKey_free"))) TS_PayeePubKey_free(uint64_t this_obj) {
44391 LDKPayeePubKey this_obj_conv;
44392 this_obj_conv.inner = untag_ptr(this_obj);
44393 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44395 PayeePubKey_free(this_obj_conv);
44398 int8_tArray __attribute__((export_name("TS_PayeePubKey_get_a"))) TS_PayeePubKey_get_a(uint64_t this_ptr) {
44399 LDKPayeePubKey this_ptr_conv;
44400 this_ptr_conv.inner = untag_ptr(this_ptr);
44401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44403 this_ptr_conv.is_owned = false;
44404 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
44405 memcpy(ret_arr->elems, PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
44409 void __attribute__((export_name("TS_PayeePubKey_set_a"))) TS_PayeePubKey_set_a(uint64_t this_ptr, int8_tArray val) {
44410 LDKPayeePubKey this_ptr_conv;
44411 this_ptr_conv.inner = untag_ptr(this_ptr);
44412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44414 this_ptr_conv.is_owned = false;
44415 LDKPublicKey val_ref;
44416 CHECK(val->arr_len == 33);
44417 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
44418 PayeePubKey_set_a(&this_ptr_conv, val_ref);
44421 uint64_t __attribute__((export_name("TS_PayeePubKey_new"))) TS_PayeePubKey_new(int8_tArray a_arg) {
44422 LDKPublicKey a_arg_ref;
44423 CHECK(a_arg->arr_len == 33);
44424 memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg);
44425 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
44426 uint64_t ret_ref = 0;
44427 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44428 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44432 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
44433 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
44434 uint64_t ret_ref = 0;
44435 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44436 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44439 int64_t __attribute__((export_name("TS_PayeePubKey_clone_ptr"))) TS_PayeePubKey_clone_ptr(uint64_t arg) {
44440 LDKPayeePubKey arg_conv;
44441 arg_conv.inner = untag_ptr(arg);
44442 arg_conv.is_owned = ptr_is_owned(arg);
44443 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44444 arg_conv.is_owned = false;
44445 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
44449 uint64_t __attribute__((export_name("TS_PayeePubKey_clone"))) TS_PayeePubKey_clone(uint64_t orig) {
44450 LDKPayeePubKey orig_conv;
44451 orig_conv.inner = untag_ptr(orig);
44452 orig_conv.is_owned = ptr_is_owned(orig);
44453 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44454 orig_conv.is_owned = false;
44455 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
44456 uint64_t ret_ref = 0;
44457 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44458 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44462 int64_t __attribute__((export_name("TS_PayeePubKey_hash"))) TS_PayeePubKey_hash(uint64_t o) {
44463 LDKPayeePubKey o_conv;
44464 o_conv.inner = untag_ptr(o);
44465 o_conv.is_owned = ptr_is_owned(o);
44466 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44467 o_conv.is_owned = false;
44468 int64_t ret_conv = PayeePubKey_hash(&o_conv);
44472 jboolean __attribute__((export_name("TS_PayeePubKey_eq"))) TS_PayeePubKey_eq(uint64_t a, uint64_t b) {
44473 LDKPayeePubKey a_conv;
44474 a_conv.inner = untag_ptr(a);
44475 a_conv.is_owned = ptr_is_owned(a);
44476 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44477 a_conv.is_owned = false;
44478 LDKPayeePubKey b_conv;
44479 b_conv.inner = untag_ptr(b);
44480 b_conv.is_owned = ptr_is_owned(b);
44481 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44482 b_conv.is_owned = false;
44483 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
44487 void __attribute__((export_name("TS_ExpiryTime_free"))) TS_ExpiryTime_free(uint64_t this_obj) {
44488 LDKExpiryTime this_obj_conv;
44489 this_obj_conv.inner = untag_ptr(this_obj);
44490 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44492 ExpiryTime_free(this_obj_conv);
44495 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
44496 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
44497 uint64_t ret_ref = 0;
44498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44502 int64_t __attribute__((export_name("TS_ExpiryTime_clone_ptr"))) TS_ExpiryTime_clone_ptr(uint64_t arg) {
44503 LDKExpiryTime arg_conv;
44504 arg_conv.inner = untag_ptr(arg);
44505 arg_conv.is_owned = ptr_is_owned(arg);
44506 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44507 arg_conv.is_owned = false;
44508 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
44512 uint64_t __attribute__((export_name("TS_ExpiryTime_clone"))) TS_ExpiryTime_clone(uint64_t orig) {
44513 LDKExpiryTime orig_conv;
44514 orig_conv.inner = untag_ptr(orig);
44515 orig_conv.is_owned = ptr_is_owned(orig);
44516 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44517 orig_conv.is_owned = false;
44518 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
44519 uint64_t ret_ref = 0;
44520 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44521 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44525 int64_t __attribute__((export_name("TS_ExpiryTime_hash"))) TS_ExpiryTime_hash(uint64_t o) {
44526 LDKExpiryTime o_conv;
44527 o_conv.inner = untag_ptr(o);
44528 o_conv.is_owned = ptr_is_owned(o);
44529 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44530 o_conv.is_owned = false;
44531 int64_t ret_conv = ExpiryTime_hash(&o_conv);
44535 jboolean __attribute__((export_name("TS_ExpiryTime_eq"))) TS_ExpiryTime_eq(uint64_t a, uint64_t b) {
44536 LDKExpiryTime a_conv;
44537 a_conv.inner = untag_ptr(a);
44538 a_conv.is_owned = ptr_is_owned(a);
44539 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44540 a_conv.is_owned = false;
44541 LDKExpiryTime b_conv;
44542 b_conv.inner = untag_ptr(b);
44543 b_conv.is_owned = ptr_is_owned(b);
44544 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44545 b_conv.is_owned = false;
44546 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
44550 void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
44551 LDKMinFinalCltvExpiry this_obj_conv;
44552 this_obj_conv.inner = untag_ptr(this_obj);
44553 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44555 MinFinalCltvExpiry_free(this_obj_conv);
44558 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
44559 LDKMinFinalCltvExpiry this_ptr_conv;
44560 this_ptr_conv.inner = untag_ptr(this_ptr);
44561 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44563 this_ptr_conv.is_owned = false;
44564 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
44568 void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
44569 LDKMinFinalCltvExpiry this_ptr_conv;
44570 this_ptr_conv.inner = untag_ptr(this_ptr);
44571 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44573 this_ptr_conv.is_owned = false;
44574 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
44577 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
44578 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
44579 uint64_t ret_ref = 0;
44580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44585 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
44586 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
44587 uint64_t ret_ref = 0;
44588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44592 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
44593 LDKMinFinalCltvExpiry arg_conv;
44594 arg_conv.inner = untag_ptr(arg);
44595 arg_conv.is_owned = ptr_is_owned(arg);
44596 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44597 arg_conv.is_owned = false;
44598 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
44602 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
44603 LDKMinFinalCltvExpiry orig_conv;
44604 orig_conv.inner = untag_ptr(orig);
44605 orig_conv.is_owned = ptr_is_owned(orig);
44606 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44607 orig_conv.is_owned = false;
44608 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
44609 uint64_t ret_ref = 0;
44610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44615 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
44616 LDKMinFinalCltvExpiry o_conv;
44617 o_conv.inner = untag_ptr(o);
44618 o_conv.is_owned = ptr_is_owned(o);
44619 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44620 o_conv.is_owned = false;
44621 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
44625 jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
44626 LDKMinFinalCltvExpiry a_conv;
44627 a_conv.inner = untag_ptr(a);
44628 a_conv.is_owned = ptr_is_owned(a);
44629 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44630 a_conv.is_owned = false;
44631 LDKMinFinalCltvExpiry b_conv;
44632 b_conv.inner = untag_ptr(b);
44633 b_conv.is_owned = ptr_is_owned(b);
44634 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44635 b_conv.is_owned = false;
44636 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
44640 void __attribute__((export_name("TS_Fallback_free"))) TS_Fallback_free(uint64_t this_ptr) {
44641 if (!ptr_is_owned(this_ptr)) return;
44642 void* this_ptr_ptr = untag_ptr(this_ptr);
44643 CHECK_ACCESS(this_ptr_ptr);
44644 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
44645 FREE(untag_ptr(this_ptr));
44646 Fallback_free(this_ptr_conv);
44649 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
44650 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
44651 *ret_copy = Fallback_clone(arg);
44652 uint64_t ret_ref = tag_ptr(ret_copy, true);
44655 int64_t __attribute__((export_name("TS_Fallback_clone_ptr"))) TS_Fallback_clone_ptr(uint64_t arg) {
44656 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
44657 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
44661 uint64_t __attribute__((export_name("TS_Fallback_clone"))) TS_Fallback_clone(uint64_t orig) {
44662 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
44663 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
44664 *ret_copy = Fallback_clone(orig_conv);
44665 uint64_t ret_ref = tag_ptr(ret_copy, true);
44669 uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
44671 LDKCVec_u8Z program_ref;
44672 program_ref.datalen = program->arr_len;
44673 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
44674 memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
44675 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
44676 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
44677 uint64_t ret_ref = tag_ptr(ret_copy, true);
44681 uint64_t __attribute__((export_name("TS_Fallback_pub_key_hash"))) TS_Fallback_pub_key_hash(int8_tArray a) {
44682 LDKTwentyBytes a_ref;
44683 CHECK(a->arr_len == 20);
44684 memcpy(a_ref.data, a->elems, 20); FREE(a);
44685 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
44686 *ret_copy = Fallback_pub_key_hash(a_ref);
44687 uint64_t ret_ref = tag_ptr(ret_copy, true);
44691 uint64_t __attribute__((export_name("TS_Fallback_script_hash"))) TS_Fallback_script_hash(int8_tArray a) {
44692 LDKTwentyBytes a_ref;
44693 CHECK(a->arr_len == 20);
44694 memcpy(a_ref.data, a->elems, 20); FREE(a);
44695 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
44696 *ret_copy = Fallback_script_hash(a_ref);
44697 uint64_t ret_ref = tag_ptr(ret_copy, true);
44701 int64_t __attribute__((export_name("TS_Fallback_hash"))) TS_Fallback_hash(uint64_t o) {
44702 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
44703 int64_t ret_conv = Fallback_hash(o_conv);
44707 jboolean __attribute__((export_name("TS_Fallback_eq"))) TS_Fallback_eq(uint64_t a, uint64_t b) {
44708 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
44709 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
44710 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
44714 void __attribute__((export_name("TS_InvoiceSignature_free"))) TS_InvoiceSignature_free(uint64_t this_obj) {
44715 LDKInvoiceSignature this_obj_conv;
44716 this_obj_conv.inner = untag_ptr(this_obj);
44717 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44719 InvoiceSignature_free(this_obj_conv);
44722 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
44723 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
44724 uint64_t ret_ref = 0;
44725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44729 int64_t __attribute__((export_name("TS_InvoiceSignature_clone_ptr"))) TS_InvoiceSignature_clone_ptr(uint64_t arg) {
44730 LDKInvoiceSignature arg_conv;
44731 arg_conv.inner = untag_ptr(arg);
44732 arg_conv.is_owned = ptr_is_owned(arg);
44733 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44734 arg_conv.is_owned = false;
44735 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
44739 uint64_t __attribute__((export_name("TS_InvoiceSignature_clone"))) TS_InvoiceSignature_clone(uint64_t orig) {
44740 LDKInvoiceSignature orig_conv;
44741 orig_conv.inner = untag_ptr(orig);
44742 orig_conv.is_owned = ptr_is_owned(orig);
44743 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44744 orig_conv.is_owned = false;
44745 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
44746 uint64_t ret_ref = 0;
44747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44752 int64_t __attribute__((export_name("TS_InvoiceSignature_hash"))) TS_InvoiceSignature_hash(uint64_t o) {
44753 LDKInvoiceSignature o_conv;
44754 o_conv.inner = untag_ptr(o);
44755 o_conv.is_owned = ptr_is_owned(o);
44756 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44757 o_conv.is_owned = false;
44758 int64_t ret_conv = InvoiceSignature_hash(&o_conv);
44762 jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
44763 LDKInvoiceSignature a_conv;
44764 a_conv.inner = untag_ptr(a);
44765 a_conv.is_owned = ptr_is_owned(a);
44766 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44767 a_conv.is_owned = false;
44768 LDKInvoiceSignature b_conv;
44769 b_conv.inner = untag_ptr(b);
44770 b_conv.is_owned = ptr_is_owned(b);
44771 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44772 b_conv.is_owned = false;
44773 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
44777 void __attribute__((export_name("TS_PrivateRoute_free"))) TS_PrivateRoute_free(uint64_t this_obj) {
44778 LDKPrivateRoute this_obj_conv;
44779 this_obj_conv.inner = untag_ptr(this_obj);
44780 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44782 PrivateRoute_free(this_obj_conv);
44785 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
44786 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
44787 uint64_t ret_ref = 0;
44788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44792 int64_t __attribute__((export_name("TS_PrivateRoute_clone_ptr"))) TS_PrivateRoute_clone_ptr(uint64_t arg) {
44793 LDKPrivateRoute arg_conv;
44794 arg_conv.inner = untag_ptr(arg);
44795 arg_conv.is_owned = ptr_is_owned(arg);
44796 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44797 arg_conv.is_owned = false;
44798 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
44802 uint64_t __attribute__((export_name("TS_PrivateRoute_clone"))) TS_PrivateRoute_clone(uint64_t orig) {
44803 LDKPrivateRoute orig_conv;
44804 orig_conv.inner = untag_ptr(orig);
44805 orig_conv.is_owned = ptr_is_owned(orig);
44806 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44807 orig_conv.is_owned = false;
44808 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
44809 uint64_t ret_ref = 0;
44810 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44811 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44815 int64_t __attribute__((export_name("TS_PrivateRoute_hash"))) TS_PrivateRoute_hash(uint64_t o) {
44816 LDKPrivateRoute o_conv;
44817 o_conv.inner = untag_ptr(o);
44818 o_conv.is_owned = ptr_is_owned(o);
44819 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44820 o_conv.is_owned = false;
44821 int64_t ret_conv = PrivateRoute_hash(&o_conv);
44825 jboolean __attribute__((export_name("TS_PrivateRoute_eq"))) TS_PrivateRoute_eq(uint64_t a, uint64_t b) {
44826 LDKPrivateRoute a_conv;
44827 a_conv.inner = untag_ptr(a);
44828 a_conv.is_owned = ptr_is_owned(a);
44829 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44830 a_conv.is_owned = false;
44831 LDKPrivateRoute b_conv;
44832 b_conv.inner = untag_ptr(b);
44833 b_conv.is_owned = ptr_is_owned(b);
44834 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44835 b_conv.is_owned = false;
44836 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
44840 uint64_t __attribute__((export_name("TS_SignedRawInvoice_into_parts"))) TS_SignedRawInvoice_into_parts(uint64_t this_arg) {
44841 LDKSignedRawInvoice this_arg_conv;
44842 this_arg_conv.inner = untag_ptr(this_arg);
44843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44845 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
44846 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
44847 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
44848 return tag_ptr(ret_conv, true);
44851 uint64_t __attribute__((export_name("TS_SignedRawInvoice_raw_invoice"))) TS_SignedRawInvoice_raw_invoice(uint64_t this_arg) {
44852 LDKSignedRawInvoice this_arg_conv;
44853 this_arg_conv.inner = untag_ptr(this_arg);
44854 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44856 this_arg_conv.is_owned = false;
44857 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
44858 uint64_t ret_ref = 0;
44859 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44860 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44864 int8_tArray __attribute__((export_name("TS_SignedRawInvoice_signable_hash"))) TS_SignedRawInvoice_signable_hash(uint64_t this_arg) {
44865 LDKSignedRawInvoice this_arg_conv;
44866 this_arg_conv.inner = untag_ptr(this_arg);
44867 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44869 this_arg_conv.is_owned = false;
44870 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
44871 memcpy(ret_arr->elems, *SignedRawInvoice_signable_hash(&this_arg_conv), 32);
44875 uint64_t __attribute__((export_name("TS_SignedRawInvoice_signature"))) TS_SignedRawInvoice_signature(uint64_t this_arg) {
44876 LDKSignedRawInvoice this_arg_conv;
44877 this_arg_conv.inner = untag_ptr(this_arg);
44878 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44880 this_arg_conv.is_owned = false;
44881 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
44882 uint64_t ret_ref = 0;
44883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44888 uint64_t __attribute__((export_name("TS_SignedRawInvoice_recover_payee_pub_key"))) TS_SignedRawInvoice_recover_payee_pub_key(uint64_t this_arg) {
44889 LDKSignedRawInvoice this_arg_conv;
44890 this_arg_conv.inner = untag_ptr(this_arg);
44891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44893 this_arg_conv.is_owned = false;
44894 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
44895 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
44896 return tag_ptr(ret_conv, true);
44899 jboolean __attribute__((export_name("TS_SignedRawInvoice_check_signature"))) TS_SignedRawInvoice_check_signature(uint64_t this_arg) {
44900 LDKSignedRawInvoice this_arg_conv;
44901 this_arg_conv.inner = untag_ptr(this_arg);
44902 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44904 this_arg_conv.is_owned = false;
44905 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
44909 int8_tArray __attribute__((export_name("TS_RawInvoice_signable_hash"))) TS_RawInvoice_signable_hash(uint64_t this_arg) {
44910 LDKRawInvoice this_arg_conv;
44911 this_arg_conv.inner = untag_ptr(this_arg);
44912 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44914 this_arg_conv.is_owned = false;
44915 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
44916 memcpy(ret_arr->elems, RawInvoice_signable_hash(&this_arg_conv).data, 32);
44920 uint64_t __attribute__((export_name("TS_RawInvoice_payment_hash"))) TS_RawInvoice_payment_hash(uint64_t this_arg) {
44921 LDKRawInvoice this_arg_conv;
44922 this_arg_conv.inner = untag_ptr(this_arg);
44923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44925 this_arg_conv.is_owned = false;
44926 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
44927 uint64_t ret_ref = 0;
44928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44933 uint64_t __attribute__((export_name("TS_RawInvoice_description"))) TS_RawInvoice_description(uint64_t this_arg) {
44934 LDKRawInvoice this_arg_conv;
44935 this_arg_conv.inner = untag_ptr(this_arg);
44936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44938 this_arg_conv.is_owned = false;
44939 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
44940 uint64_t ret_ref = 0;
44941 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44942 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44946 uint64_t __attribute__((export_name("TS_RawInvoice_payee_pub_key"))) TS_RawInvoice_payee_pub_key(uint64_t this_arg) {
44947 LDKRawInvoice this_arg_conv;
44948 this_arg_conv.inner = untag_ptr(this_arg);
44949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44951 this_arg_conv.is_owned = false;
44952 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
44953 uint64_t ret_ref = 0;
44954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44955 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44959 uint64_t __attribute__((export_name("TS_RawInvoice_description_hash"))) TS_RawInvoice_description_hash(uint64_t this_arg) {
44960 LDKRawInvoice this_arg_conv;
44961 this_arg_conv.inner = untag_ptr(this_arg);
44962 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44964 this_arg_conv.is_owned = false;
44965 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
44966 uint64_t ret_ref = 0;
44967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44972 uint64_t __attribute__((export_name("TS_RawInvoice_expiry_time"))) TS_RawInvoice_expiry_time(uint64_t this_arg) {
44973 LDKRawInvoice this_arg_conv;
44974 this_arg_conv.inner = untag_ptr(this_arg);
44975 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44977 this_arg_conv.is_owned = false;
44978 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
44979 uint64_t ret_ref = 0;
44980 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44981 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44985 uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
44986 LDKRawInvoice this_arg_conv;
44987 this_arg_conv.inner = untag_ptr(this_arg);
44988 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44990 this_arg_conv.is_owned = false;
44991 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
44992 uint64_t ret_ref = 0;
44993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44998 int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_RawInvoice_payment_secret(uint64_t this_arg) {
44999 LDKRawInvoice this_arg_conv;
45000 this_arg_conv.inner = untag_ptr(this_arg);
45001 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45003 this_arg_conv.is_owned = false;
45004 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
45005 memcpy(ret_arr->elems, RawInvoice_payment_secret(&this_arg_conv).data, 32);
45009 uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) {
45010 LDKRawInvoice this_arg_conv;
45011 this_arg_conv.inner = untag_ptr(this_arg);
45012 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45014 this_arg_conv.is_owned = false;
45015 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
45016 uint64_t ret_ref = 0;
45017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45022 uint64_tArray __attribute__((export_name("TS_RawInvoice_private_routes"))) TS_RawInvoice_private_routes(uint64_t this_arg) {
45023 LDKRawInvoice this_arg_conv;
45024 this_arg_conv.inner = untag_ptr(this_arg);
45025 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45027 this_arg_conv.is_owned = false;
45028 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
45029 uint64_tArray ret_arr = NULL;
45030 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
45031 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
45032 for (size_t o = 0; o < ret_var.datalen; o++) {
45033 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
45034 uint64_t ret_conv_14_ref = 0;
45035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
45036 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
45037 ret_arr_ptr[o] = ret_conv_14_ref;
45040 FREE(ret_var.data);
45044 uint64_t __attribute__((export_name("TS_RawInvoice_amount_pico_btc"))) TS_RawInvoice_amount_pico_btc(uint64_t this_arg) {
45045 LDKRawInvoice this_arg_conv;
45046 this_arg_conv.inner = untag_ptr(this_arg);
45047 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45049 this_arg_conv.is_owned = false;
45050 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
45051 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
45052 uint64_t ret_ref = tag_ptr(ret_copy, true);
45056 uint32_t __attribute__((export_name("TS_RawInvoice_currency"))) TS_RawInvoice_currency(uint64_t this_arg) {
45057 LDKRawInvoice this_arg_conv;
45058 this_arg_conv.inner = untag_ptr(this_arg);
45059 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45061 this_arg_conv.is_owned = false;
45062 uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv));
45066 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_unix_timestamp"))) TS_PositiveTimestamp_from_unix_timestamp(int64_t unix_seconds) {
45067 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
45068 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
45069 return tag_ptr(ret_conv, true);
45072 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_duration_since_epoch"))) TS_PositiveTimestamp_from_duration_since_epoch(int64_t duration) {
45073 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
45074 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
45075 return tag_ptr(ret_conv, true);
45078 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_unix_timestamp"))) TS_PositiveTimestamp_as_unix_timestamp(uint64_t this_arg) {
45079 LDKPositiveTimestamp this_arg_conv;
45080 this_arg_conv.inner = untag_ptr(this_arg);
45081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45083 this_arg_conv.is_owned = false;
45084 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
45088 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoch"))) TS_PositiveTimestamp_as_duration_since_epoch(uint64_t this_arg) {
45089 LDKPositiveTimestamp this_arg_conv;
45090 this_arg_conv.inner = untag_ptr(this_arg);
45091 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45093 this_arg_conv.is_owned = false;
45094 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
45098 uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) {
45099 LDKInvoice this_arg_conv;
45100 this_arg_conv.inner = untag_ptr(this_arg);
45101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45103 this_arg_conv = Invoice_clone(&this_arg_conv);
45104 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
45105 uint64_t ret_ref = 0;
45106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45111 uint64_t __attribute__((export_name("TS_Invoice_check_signature"))) TS_Invoice_check_signature(uint64_t this_arg) {
45112 LDKInvoice this_arg_conv;
45113 this_arg_conv.inner = untag_ptr(this_arg);
45114 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45116 this_arg_conv.is_owned = false;
45117 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
45118 *ret_conv = Invoice_check_signature(&this_arg_conv);
45119 return tag_ptr(ret_conv, true);
45122 uint64_t __attribute__((export_name("TS_Invoice_from_signed"))) TS_Invoice_from_signed(uint64_t signed_invoice) {
45123 LDKSignedRawInvoice signed_invoice_conv;
45124 signed_invoice_conv.inner = untag_ptr(signed_invoice);
45125 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
45126 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
45127 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
45128 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
45129 *ret_conv = Invoice_from_signed(signed_invoice_conv);
45130 return tag_ptr(ret_conv, true);
45133 int64_t __attribute__((export_name("TS_Invoice_duration_since_epoch"))) TS_Invoice_duration_since_epoch(uint64_t this_arg) {
45134 LDKInvoice this_arg_conv;
45135 this_arg_conv.inner = untag_ptr(this_arg);
45136 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45138 this_arg_conv.is_owned = false;
45139 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
45143 int8_tArray __attribute__((export_name("TS_Invoice_payment_hash"))) TS_Invoice_payment_hash(uint64_t this_arg) {
45144 LDKInvoice this_arg_conv;
45145 this_arg_conv.inner = untag_ptr(this_arg);
45146 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45148 this_arg_conv.is_owned = false;
45149 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
45150 memcpy(ret_arr->elems, *Invoice_payment_hash(&this_arg_conv), 32);
45154 int8_tArray __attribute__((export_name("TS_Invoice_payee_pub_key"))) TS_Invoice_payee_pub_key(uint64_t this_arg) {
45155 LDKInvoice this_arg_conv;
45156 this_arg_conv.inner = untag_ptr(this_arg);
45157 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45159 this_arg_conv.is_owned = false;
45160 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
45161 memcpy(ret_arr->elems, Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33);
45165 int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoice_payment_secret(uint64_t this_arg) {
45166 LDKInvoice this_arg_conv;
45167 this_arg_conv.inner = untag_ptr(this_arg);
45168 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45170 this_arg_conv.is_owned = false;
45171 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
45172 memcpy(ret_arr->elems, *Invoice_payment_secret(&this_arg_conv), 32);
45176 uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) {
45177 LDKInvoice this_arg_conv;
45178 this_arg_conv.inner = untag_ptr(this_arg);
45179 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45181 this_arg_conv.is_owned = false;
45182 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
45183 uint64_t ret_ref = 0;
45184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45189 int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS_Invoice_recover_payee_pub_key(uint64_t this_arg) {
45190 LDKInvoice this_arg_conv;
45191 this_arg_conv.inner = untag_ptr(this_arg);
45192 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45194 this_arg_conv.is_owned = false;
45195 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
45196 memcpy(ret_arr->elems, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33);
45200 int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) {
45201 LDKInvoice this_arg_conv;
45202 this_arg_conv.inner = untag_ptr(this_arg);
45203 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45205 this_arg_conv.is_owned = false;
45206 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
45210 jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) {
45211 LDKInvoice this_arg_conv;
45212 this_arg_conv.inner = untag_ptr(this_arg);
45213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45215 this_arg_conv.is_owned = false;
45216 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
45220 int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
45221 LDKInvoice this_arg_conv;
45222 this_arg_conv.inner = untag_ptr(this_arg);
45223 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45225 this_arg_conv.is_owned = false;
45226 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
45230 uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) {
45231 LDKInvoice this_arg_conv;
45232 this_arg_conv.inner = untag_ptr(this_arg);
45233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45235 this_arg_conv.is_owned = false;
45236 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
45237 uint64_tArray ret_arr = NULL;
45238 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
45239 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
45240 for (size_t o = 0; o < ret_var.datalen; o++) {
45241 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
45242 uint64_t ret_conv_14_ref = 0;
45243 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
45244 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
45245 ret_arr_ptr[o] = ret_conv_14_ref;
45248 FREE(ret_var.data);
45252 uint64_tArray __attribute__((export_name("TS_Invoice_route_hints"))) TS_Invoice_route_hints(uint64_t this_arg) {
45253 LDKInvoice this_arg_conv;
45254 this_arg_conv.inner = untag_ptr(this_arg);
45255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45257 this_arg_conv.is_owned = false;
45258 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
45259 uint64_tArray ret_arr = NULL;
45260 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
45261 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
45262 for (size_t l = 0; l < ret_var.datalen; l++) {
45263 LDKRouteHint ret_conv_11_var = ret_var.data[l];
45264 uint64_t ret_conv_11_ref = 0;
45265 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
45266 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
45267 ret_arr_ptr[l] = ret_conv_11_ref;
45270 FREE(ret_var.data);
45274 uint32_t __attribute__((export_name("TS_Invoice_currency"))) TS_Invoice_currency(uint64_t this_arg) {
45275 LDKInvoice this_arg_conv;
45276 this_arg_conv.inner = untag_ptr(this_arg);
45277 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45279 this_arg_conv.is_owned = false;
45280 uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv));
45284 uint64_t __attribute__((export_name("TS_Invoice_amount_milli_satoshis"))) TS_Invoice_amount_milli_satoshis(uint64_t this_arg) {
45285 LDKInvoice this_arg_conv;
45286 this_arg_conv.inner = untag_ptr(this_arg);
45287 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45289 this_arg_conv.is_owned = false;
45290 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
45291 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
45292 uint64_t ret_ref = tag_ptr(ret_copy, true);
45296 uint64_t __attribute__((export_name("TS_Description_new"))) TS_Description_new(jstring description) {
45297 LDKStr description_conv = str_ref_to_owned_c(description);
45298 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
45299 *ret_conv = Description_new(description_conv);
45300 return tag_ptr(ret_conv, true);
45303 jstring __attribute__((export_name("TS_Description_into_inner"))) TS_Description_into_inner(uint64_t this_arg) {
45304 LDKDescription this_arg_conv;
45305 this_arg_conv.inner = untag_ptr(this_arg);
45306 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45308 this_arg_conv = Description_clone(&this_arg_conv);
45309 LDKStr ret_str = Description_into_inner(this_arg_conv);
45310 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
45315 uint64_t __attribute__((export_name("TS_ExpiryTime_from_seconds"))) TS_ExpiryTime_from_seconds(int64_t seconds) {
45316 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
45317 uint64_t ret_ref = 0;
45318 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45319 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45323 uint64_t __attribute__((export_name("TS_ExpiryTime_from_duration"))) TS_ExpiryTime_from_duration(int64_t duration) {
45324 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
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 int64_t __attribute__((export_name("TS_ExpiryTime_as_seconds"))) TS_ExpiryTime_as_seconds(uint64_t this_arg) {
45332 LDKExpiryTime this_arg_conv;
45333 this_arg_conv.inner = untag_ptr(this_arg);
45334 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45336 this_arg_conv.is_owned = false;
45337 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
45341 int64_t __attribute__((export_name("TS_ExpiryTime_as_duration"))) TS_ExpiryTime_as_duration(uint64_t this_arg) {
45342 LDKExpiryTime this_arg_conv;
45343 this_arg_conv.inner = untag_ptr(this_arg);
45344 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45346 this_arg_conv.is_owned = false;
45347 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
45351 uint64_t __attribute__((export_name("TS_PrivateRoute_new"))) TS_PrivateRoute_new(uint64_t hops) {
45352 LDKRouteHint hops_conv;
45353 hops_conv.inner = untag_ptr(hops);
45354 hops_conv.is_owned = ptr_is_owned(hops);
45355 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
45356 hops_conv = RouteHint_clone(&hops_conv);
45357 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
45358 *ret_conv = PrivateRoute_new(hops_conv);
45359 return tag_ptr(ret_conv, true);
45362 uint64_t __attribute__((export_name("TS_PrivateRoute_into_inner"))) TS_PrivateRoute_into_inner(uint64_t this_arg) {
45363 LDKPrivateRoute this_arg_conv;
45364 this_arg_conv.inner = untag_ptr(this_arg);
45365 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45367 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
45368 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
45369 uint64_t ret_ref = 0;
45370 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45371 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45375 uint32_t __attribute__((export_name("TS_CreationError_clone"))) TS_CreationError_clone(uint64_t orig) {
45376 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
45377 uint32_t ret_conv = LDKCreationError_to_js(CreationError_clone(orig_conv));
45381 uint32_t __attribute__((export_name("TS_CreationError_description_too_long"))) TS_CreationError_description_too_long() {
45382 uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
45386 uint32_t __attribute__((export_name("TS_CreationError_route_too_long"))) TS_CreationError_route_too_long() {
45387 uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
45391 uint32_t __attribute__((export_name("TS_CreationError_timestamp_out_of_bounds"))) TS_CreationError_timestamp_out_of_bounds() {
45392 uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
45396 uint32_t __attribute__((export_name("TS_CreationError_invalid_amount"))) TS_CreationError_invalid_amount() {
45397 uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
45401 uint32_t __attribute__((export_name("TS_CreationError_missing_route_hints"))) TS_CreationError_missing_route_hints() {
45402 uint32_t ret_conv = LDKCreationError_to_js(CreationError_missing_route_hints());
45406 jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
45407 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
45408 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
45409 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
45413 jstring __attribute__((export_name("TS_CreationError_to_str"))) TS_CreationError_to_str(uint64_t o) {
45414 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
45415 LDKStr ret_str = CreationError_to_str(o_conv);
45416 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
45421 uint32_t __attribute__((export_name("TS_SemanticError_clone"))) TS_SemanticError_clone(uint64_t orig) {
45422 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
45423 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_clone(orig_conv));
45427 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_hash"))) TS_SemanticError_no_payment_hash() {
45428 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
45432 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_hashes"))) TS_SemanticError_multiple_payment_hashes() {
45433 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
45437 uint32_t __attribute__((export_name("TS_SemanticError_no_description"))) TS_SemanticError_no_description() {
45438 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
45442 uint32_t __attribute__((export_name("TS_SemanticError_multiple_descriptions"))) TS_SemanticError_multiple_descriptions() {
45443 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
45447 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_secret"))) TS_SemanticError_no_payment_secret() {
45448 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_secret());
45452 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_secrets"))) TS_SemanticError_multiple_payment_secrets() {
45453 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
45457 uint32_t __attribute__((export_name("TS_SemanticError_invalid_features"))) TS_SemanticError_invalid_features() {
45458 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
45462 uint32_t __attribute__((export_name("TS_SemanticError_invalid_recovery_id"))) TS_SemanticError_invalid_recovery_id() {
45463 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
45467 uint32_t __attribute__((export_name("TS_SemanticError_invalid_signature"))) TS_SemanticError_invalid_signature() {
45468 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
45472 uint32_t __attribute__((export_name("TS_SemanticError_imprecise_amount"))) TS_SemanticError_imprecise_amount() {
45473 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_imprecise_amount());
45477 jboolean __attribute__((export_name("TS_SemanticError_eq"))) TS_SemanticError_eq(uint64_t a, uint64_t b) {
45478 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
45479 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
45480 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
45484 jstring __attribute__((export_name("TS_SemanticError_to_str"))) TS_SemanticError_to_str(uint64_t o) {
45485 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
45486 LDKStr ret_str = SemanticError_to_str(o_conv);
45487 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
45492 void __attribute__((export_name("TS_SignOrCreationError_free"))) TS_SignOrCreationError_free(uint64_t this_ptr) {
45493 if (!ptr_is_owned(this_ptr)) return;
45494 void* this_ptr_ptr = untag_ptr(this_ptr);
45495 CHECK_ACCESS(this_ptr_ptr);
45496 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
45497 FREE(untag_ptr(this_ptr));
45498 SignOrCreationError_free(this_ptr_conv);
45501 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
45502 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
45503 *ret_copy = SignOrCreationError_clone(arg);
45504 uint64_t ret_ref = tag_ptr(ret_copy, true);
45507 int64_t __attribute__((export_name("TS_SignOrCreationError_clone_ptr"))) TS_SignOrCreationError_clone_ptr(uint64_t arg) {
45508 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
45509 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
45513 uint64_t __attribute__((export_name("TS_SignOrCreationError_clone"))) TS_SignOrCreationError_clone(uint64_t orig) {
45514 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
45515 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
45516 *ret_copy = SignOrCreationError_clone(orig_conv);
45517 uint64_t ret_ref = tag_ptr(ret_copy, true);
45521 uint64_t __attribute__((export_name("TS_SignOrCreationError_sign_error"))) TS_SignOrCreationError_sign_error() {
45522 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
45523 *ret_copy = SignOrCreationError_sign_error();
45524 uint64_t ret_ref = tag_ptr(ret_copy, true);
45528 uint64_t __attribute__((export_name("TS_SignOrCreationError_creation_error"))) TS_SignOrCreationError_creation_error(uint32_t a) {
45529 LDKCreationError a_conv = LDKCreationError_from_js(a);
45530 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
45531 *ret_copy = SignOrCreationError_creation_error(a_conv);
45532 uint64_t ret_ref = tag_ptr(ret_copy, true);
45536 jboolean __attribute__((export_name("TS_SignOrCreationError_eq"))) TS_SignOrCreationError_eq(uint64_t a, uint64_t b) {
45537 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
45538 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
45539 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
45543 jstring __attribute__((export_name("TS_SignOrCreationError_to_str"))) TS_SignOrCreationError_to_str(uint64_t o) {
45544 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
45545 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
45546 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
45551 void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
45552 LDKInvoicePayer this_obj_conv;
45553 this_obj_conv.inner = untag_ptr(this_obj);
45554 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45556 InvoicePayer_free(this_obj_conv);
45559 void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
45560 if (!ptr_is_owned(this_ptr)) return;
45561 void* this_ptr_ptr = untag_ptr(this_ptr);
45562 CHECK_ACCESS(this_ptr_ptr);
45563 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
45564 FREE(untag_ptr(this_ptr));
45565 Payer_free(this_ptr_conv);
45568 void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
45569 if (!ptr_is_owned(this_ptr)) return;
45570 void* this_ptr_ptr = untag_ptr(this_ptr);
45571 CHECK_ACCESS(this_ptr_ptr);
45572 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
45573 FREE(untag_ptr(this_ptr));
45574 Router_free(this_ptr_conv);
45577 void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
45578 if (!ptr_is_owned(this_ptr)) return;
45579 void* this_ptr_ptr = untag_ptr(this_ptr);
45580 CHECK_ACCESS(this_ptr_ptr);
45581 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
45582 FREE(untag_ptr(this_ptr));
45583 Retry_free(this_ptr_conv);
45586 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
45587 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
45588 *ret_copy = Retry_clone(arg);
45589 uint64_t ret_ref = tag_ptr(ret_copy, true);
45592 int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
45593 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
45594 int64_t ret_conv = Retry_clone_ptr(arg_conv);
45598 uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
45599 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
45600 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
45601 *ret_copy = Retry_clone(orig_conv);
45602 uint64_t ret_ref = tag_ptr(ret_copy, true);
45606 uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
45607 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
45608 *ret_copy = Retry_attempts(a);
45609 uint64_t ret_ref = tag_ptr(ret_copy, true);
45613 jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
45614 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
45615 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
45616 jboolean ret_conv = Retry_eq(a_conv, b_conv);
45620 int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
45621 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
45622 int64_t ret_conv = Retry_hash(o_conv);
45626 void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
45627 if (!ptr_is_owned(this_ptr)) return;
45628 void* this_ptr_ptr = untag_ptr(this_ptr);
45629 CHECK_ACCESS(this_ptr_ptr);
45630 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
45631 FREE(untag_ptr(this_ptr));
45632 PaymentError_free(this_ptr_conv);
45635 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
45636 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
45637 *ret_copy = PaymentError_clone(arg);
45638 uint64_t ret_ref = tag_ptr(ret_copy, true);
45641 int64_t __attribute__((export_name("TS_PaymentError_clone_ptr"))) TS_PaymentError_clone_ptr(uint64_t arg) {
45642 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
45643 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
45647 uint64_t __attribute__((export_name("TS_PaymentError_clone"))) TS_PaymentError_clone(uint64_t orig) {
45648 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
45649 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
45650 *ret_copy = PaymentError_clone(orig_conv);
45651 uint64_t ret_ref = tag_ptr(ret_copy, true);
45655 uint64_t __attribute__((export_name("TS_PaymentError_invoice"))) TS_PaymentError_invoice(jstring a) {
45656 LDKStr a_conv = str_ref_to_owned_c(a);
45657 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
45658 *ret_copy = PaymentError_invoice(a_conv);
45659 uint64_t ret_ref = tag_ptr(ret_copy, true);
45663 uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
45664 LDKLightningError 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 = LightningError_clone(&a_conv);
45669 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
45670 *ret_copy = PaymentError_routing(a_conv);
45671 uint64_t ret_ref = tag_ptr(ret_copy, true);
45675 uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
45676 void* a_ptr = untag_ptr(a);
45677 CHECK_ACCESS(a_ptr);
45678 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
45679 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
45680 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
45681 *ret_copy = PaymentError_sending(a_conv);
45682 uint64_t ret_ref = tag_ptr(ret_copy, true);
45686 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) {
45687 void* payer_ptr = untag_ptr(payer);
45688 CHECK_ACCESS(payer_ptr);
45689 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
45690 if (payer_conv.free == LDKPayer_JCalls_free) {
45691 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45692 LDKPayer_JCalls_cloned(&payer_conv);
45694 void* router_ptr = untag_ptr(router);
45695 CHECK_ACCESS(router_ptr);
45696 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
45697 if (router_conv.free == LDKRouter_JCalls_free) {
45698 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45699 LDKRouter_JCalls_cloned(&router_conv);
45701 void* logger_ptr = untag_ptr(logger);
45702 CHECK_ACCESS(logger_ptr);
45703 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
45704 if (logger_conv.free == LDKLogger_JCalls_free) {
45705 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45706 LDKLogger_JCalls_cloned(&logger_conv);
45708 void* event_handler_ptr = untag_ptr(event_handler);
45709 CHECK_ACCESS(event_handler_ptr);
45710 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
45711 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
45712 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45713 LDKEventHandler_JCalls_cloned(&event_handler_conv);
45715 void* retry_ptr = untag_ptr(retry);
45716 CHECK_ACCESS(retry_ptr);
45717 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
45718 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
45719 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, logger_conv, event_handler_conv, retry_conv);
45720 uint64_t ret_ref = 0;
45721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45726 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
45727 LDKInvoicePayer this_arg_conv;
45728 this_arg_conv.inner = untag_ptr(this_arg);
45729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45731 this_arg_conv.is_owned = false;
45732 LDKInvoice invoice_conv;
45733 invoice_conv.inner = untag_ptr(invoice);
45734 invoice_conv.is_owned = ptr_is_owned(invoice);
45735 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
45736 invoice_conv.is_owned = false;
45737 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
45738 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
45739 return tag_ptr(ret_conv, true);
45742 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) {
45743 LDKInvoicePayer this_arg_conv;
45744 this_arg_conv.inner = untag_ptr(this_arg);
45745 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45747 this_arg_conv.is_owned = false;
45748 LDKInvoice invoice_conv;
45749 invoice_conv.inner = untag_ptr(invoice);
45750 invoice_conv.is_owned = ptr_is_owned(invoice);
45751 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
45752 invoice_conv.is_owned = false;
45753 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
45754 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
45755 return tag_ptr(ret_conv, true);
45758 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) {
45759 LDKInvoicePayer this_arg_conv;
45760 this_arg_conv.inner = untag_ptr(this_arg);
45761 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45763 this_arg_conv.is_owned = false;
45764 LDKPublicKey pubkey_ref;
45765 CHECK(pubkey->arr_len == 33);
45766 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
45767 LDKThirtyTwoBytes payment_preimage_ref;
45768 CHECK(payment_preimage->arr_len == 32);
45769 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
45770 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
45771 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
45772 return tag_ptr(ret_conv, true);
45775 void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
45776 LDKInvoicePayer this_arg_conv;
45777 this_arg_conv.inner = untag_ptr(this_arg);
45778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45780 this_arg_conv.is_owned = false;
45781 unsigned char payment_hash_arr[32];
45782 CHECK(payment_hash->arr_len == 32);
45783 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
45784 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
45785 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
45788 uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
45789 LDKInvoicePayer this_arg_conv;
45790 this_arg_conv.inner = untag_ptr(this_arg);
45791 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45793 this_arg_conv.is_owned = false;
45794 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
45795 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
45796 return tag_ptr(ret_ret, true);
45799 void __attribute__((export_name("TS_InFlightHtlcs_free"))) TS_InFlightHtlcs_free(uint64_t this_obj) {
45800 LDKInFlightHtlcs this_obj_conv;
45801 this_obj_conv.inner = untag_ptr(this_obj);
45802 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45804 InFlightHtlcs_free(this_obj_conv);
45807 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) {
45808 LDKInFlightHtlcs this_arg_conv;
45809 this_arg_conv.inner = untag_ptr(this_arg);
45810 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45812 this_arg_conv.is_owned = false;
45813 LDKNodeId source_conv;
45814 source_conv.inner = untag_ptr(source);
45815 source_conv.is_owned = ptr_is_owned(source);
45816 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
45817 source_conv.is_owned = false;
45818 LDKNodeId target_conv;
45819 target_conv.inner = untag_ptr(target);
45820 target_conv.is_owned = ptr_is_owned(target);
45821 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
45822 target_conv.is_owned = false;
45823 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
45824 *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
45825 uint64_t ret_ref = tag_ptr(ret_copy, true);
45829 int8_tArray __attribute__((export_name("TS_InFlightHtlcs_write"))) TS_InFlightHtlcs_write(uint64_t obj) {
45830 LDKInFlightHtlcs obj_conv;
45831 obj_conv.inner = untag_ptr(obj);
45832 obj_conv.is_owned = ptr_is_owned(obj);
45833 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45834 obj_conv.is_owned = false;
45835 LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
45836 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
45837 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
45838 CVec_u8Z_free(ret_var);
45842 uint64_t __attribute__((export_name("TS_InFlightHtlcs_read"))) TS_InFlightHtlcs_read(int8_tArray ser) {
45843 LDKu8slice ser_ref;
45844 ser_ref.datalen = ser->arr_len;
45845 ser_ref.data = ser->elems;
45846 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
45847 *ret_conv = InFlightHtlcs_read(ser_ref);
45849 return tag_ptr(ret_conv, true);
45852 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, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
45853 LDKChannelManager channelmanager_conv;
45854 channelmanager_conv.inner = untag_ptr(channelmanager);
45855 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
45856 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
45857 channelmanager_conv.is_owned = false;
45858 void* keys_manager_ptr = untag_ptr(keys_manager);
45859 CHECK_ACCESS(keys_manager_ptr);
45860 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
45861 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
45862 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45863 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
45865 LDKCurrency network_conv = LDKCurrency_from_js(network);
45866 void* amt_msat_ptr = untag_ptr(amt_msat);
45867 CHECK_ACCESS(amt_msat_ptr);
45868 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
45869 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
45870 LDKSha256 description_hash_conv;
45871 description_hash_conv.inner = untag_ptr(description_hash);
45872 description_hash_conv.is_owned = ptr_is_owned(description_hash);
45873 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
45874 description_hash_conv = Sha256_clone(&description_hash_conv);
45875 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
45876 *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
45877 return tag_ptr(ret_conv, true);
45880 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, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
45881 LDKChannelManager channelmanager_conv;
45882 channelmanager_conv.inner = untag_ptr(channelmanager);
45883 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
45884 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
45885 channelmanager_conv.is_owned = false;
45886 void* keys_manager_ptr = untag_ptr(keys_manager);
45887 CHECK_ACCESS(keys_manager_ptr);
45888 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
45889 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
45890 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45891 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
45893 LDKCurrency network_conv = LDKCurrency_from_js(network);
45894 void* amt_msat_ptr = untag_ptr(amt_msat);
45895 CHECK_ACCESS(amt_msat_ptr);
45896 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
45897 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
45898 LDKStr description_conv = str_ref_to_owned_c(description);
45899 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
45900 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
45901 return tag_ptr(ret_conv, true);
45904 void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
45905 LDKDefaultRouter this_obj_conv;
45906 this_obj_conv.inner = untag_ptr(this_obj);
45907 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45908 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45909 DefaultRouter_free(this_obj_conv);
45912 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) {
45913 LDKNetworkGraph network_graph_conv;
45914 network_graph_conv.inner = untag_ptr(network_graph);
45915 network_graph_conv.is_owned = ptr_is_owned(network_graph);
45916 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
45917 network_graph_conv.is_owned = false;
45918 void* logger_ptr = untag_ptr(logger);
45919 CHECK_ACCESS(logger_ptr);
45920 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
45921 if (logger_conv.free == LDKLogger_JCalls_free) {
45922 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45923 LDKLogger_JCalls_cloned(&logger_conv);
45925 LDKThirtyTwoBytes random_seed_bytes_ref;
45926 CHECK(random_seed_bytes->arr_len == 32);
45927 memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
45928 void* scorer_ptr = untag_ptr(scorer);
45929 CHECK_ACCESS(scorer_ptr);
45930 LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
45931 if (scorer_conv.free == LDKLockableScore_JCalls_free) {
45932 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45933 LDKLockableScore_JCalls_cloned(&scorer_conv);
45935 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
45936 uint64_t ret_ref = 0;
45937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45942 uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
45943 LDKDefaultRouter this_arg_conv;
45944 this_arg_conv.inner = untag_ptr(this_arg);
45945 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45947 this_arg_conv.is_owned = false;
45948 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
45949 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
45950 return tag_ptr(ret_ret, true);
45953 uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
45954 LDKChannelManager this_arg_conv;
45955 this_arg_conv.inner = untag_ptr(this_arg);
45956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45958 this_arg_conv.is_owned = false;
45959 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
45960 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
45961 return tag_ptr(ret_ret, true);
45964 uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {
45965 LDKStr s_conv = str_ref_to_owned_c(s);
45966 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
45967 *ret_conv = SiPrefix_from_str(s_conv);
45968 return tag_ptr(ret_conv, true);
45971 uint64_t __attribute__((export_name("TS_Invoice_from_str"))) TS_Invoice_from_str(jstring s) {
45972 LDKStr s_conv = str_ref_to_owned_c(s);
45973 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
45974 *ret_conv = Invoice_from_str(s_conv);
45975 return tag_ptr(ret_conv, true);
45978 uint64_t __attribute__((export_name("TS_SignedRawInvoice_from_str"))) TS_SignedRawInvoice_from_str(jstring s) {
45979 LDKStr s_conv = str_ref_to_owned_c(s);
45980 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
45981 *ret_conv = SignedRawInvoice_from_str(s_conv);
45982 return tag_ptr(ret_conv, true);
45985 jstring __attribute__((export_name("TS_ParseError_to_str"))) TS_ParseError_to_str(uint64_t o) {
45986 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
45987 LDKStr ret_str = ParseError_to_str(o_conv);
45988 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
45993 jstring __attribute__((export_name("TS_ParseOrSemanticError_to_str"))) TS_ParseOrSemanticError_to_str(uint64_t o) {
45994 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
45995 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
45996 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46001 jstring __attribute__((export_name("TS_Invoice_to_str"))) TS_Invoice_to_str(uint64_t o) {
46003 o_conv.inner = untag_ptr(o);
46004 o_conv.is_owned = ptr_is_owned(o);
46005 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46006 o_conv.is_owned = false;
46007 LDKStr ret_str = Invoice_to_str(&o_conv);
46008 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46013 jstring __attribute__((export_name("TS_SignedRawInvoice_to_str"))) TS_SignedRawInvoice_to_str(uint64_t o) {
46014 LDKSignedRawInvoice o_conv;
46015 o_conv.inner = untag_ptr(o);
46016 o_conv.is_owned = ptr_is_owned(o);
46017 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46018 o_conv.is_owned = false;
46019 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
46020 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46025 jstring __attribute__((export_name("TS_Currency_to_str"))) TS_Currency_to_str(uint64_t o) {
46026 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
46027 LDKStr ret_str = Currency_to_str(o_conv);
46028 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
46033 jstring __attribute__((export_name("TS_SiPrefix_to_str"))) TS_SiPrefix_to_str(uint64_t o) {
46034 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
46035 LDKStr ret_str = SiPrefix_to_str(o_conv);
46036 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);