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 uint32_t __attribute__((export_name("TS_LDKBech32Error_ty_from_ptr"))) TS_LDKBech32Error_ty_from_ptr(uint64_t ptr) {
431 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
433 case LDKBech32Error_MissingSeparator: return 0;
434 case LDKBech32Error_InvalidChecksum: return 1;
435 case LDKBech32Error_InvalidLength: return 2;
436 case LDKBech32Error_InvalidChar: return 3;
437 case LDKBech32Error_InvalidData: return 4;
438 case LDKBech32Error_InvalidPadding: return 5;
439 case LDKBech32Error_MixedCase: return 6;
443 int32_t __attribute__((export_name("TS_LDKBech32Error_InvalidChar_get_invalid_char"))) TS_LDKBech32Error_InvalidChar_get_invalid_char(uint64_t ptr) {
444 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
445 assert(obj->tag == LDKBech32Error_InvalidChar);
446 int32_t invalid_char_conv = obj->invalid_char;
447 return invalid_char_conv;
449 int8_t __attribute__((export_name("TS_LDKBech32Error_InvalidData_get_invalid_data"))) TS_LDKBech32Error_InvalidData_get_invalid_data(uint64_t ptr) {
450 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
451 assert(obj->tag == LDKBech32Error_InvalidData);
452 int8_t invalid_data_conv = obj->invalid_data;
453 return invalid_data_conv;
455 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
456 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
457 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
460 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) {
461 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
462 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
463 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
464 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
465 CVec_u8Z_free(ret_var);
469 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) {
470 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
471 int64_t ret_conv = TxOut_get_value(thing_conv);
475 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
476 CHECK(owner->result_ok);
477 return *owner->contents.result;
479 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_ok"))) TS_CResult_NoneNoneZ_get_ok(uint64_t owner) {
480 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
481 CResult_NoneNoneZ_get_ok(owner_conv);
484 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
485 CHECK(!owner->result_ok);
486 return *owner->contents.err;
488 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_err"))) TS_CResult_NoneNoneZ_get_err(uint64_t owner) {
489 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
490 CResult_NoneNoneZ_get_err(owner_conv);
493 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
494 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
495 ret.is_owned = false;
498 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(uint64_t owner) {
499 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
500 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
501 uint64_t ret_ref = 0;
502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
507 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
508 LDKDecodeError ret = *owner->contents.err;
509 ret.is_owned = false;
512 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
513 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
514 LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
515 uint64_t ret_ref = 0;
516 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
517 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
521 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
522 CHECK(owner->result_ok);
523 return *owner->contents.result;
525 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
526 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
527 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
528 memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
532 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
533 CHECK(!owner->result_ok);
534 return *owner->contents.err;
536 uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
537 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
538 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
542 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
543 CHECK(owner->result_ok);
544 return *owner->contents.result;
546 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
547 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
548 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
549 memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
553 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
554 CHECK(!owner->result_ok);
555 return *owner->contents.err;
557 uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
558 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
559 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
563 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
564 LDKTxCreationKeys ret = *owner->contents.result;
565 ret.is_owned = false;
568 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint64_t owner) {
569 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
570 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
571 uint64_t ret_ref = 0;
572 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
573 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
577 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
578 LDKDecodeError ret = *owner->contents.err;
579 ret.is_owned = false;
582 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
583 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
584 LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
585 uint64_t ret_ref = 0;
586 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
587 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
591 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
592 LDKChannelPublicKeys ret = *owner->contents.result;
593 ret.is_owned = false;
596 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint64_t owner) {
597 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
598 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
599 uint64_t ret_ref = 0;
600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
605 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
606 LDKDecodeError ret = *owner->contents.err;
607 ret.is_owned = false;
610 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
611 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
612 LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
613 uint64_t ret_ref = 0;
614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
619 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
620 LDKTxCreationKeys ret = *owner->contents.result;
621 ret.is_owned = false;
624 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
625 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
626 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
627 uint64_t ret_ref = 0;
628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
633 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
634 CHECK(!owner->result_ok);
635 return *owner->contents.err;
637 uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
638 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
639 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
643 uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
644 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
646 case LDKCOption_u32Z_Some: return 0;
647 case LDKCOption_u32Z_None: return 1;
651 int32_t __attribute__((export_name("TS_LDKCOption_u32Z_Some_get_some"))) TS_LDKCOption_u32Z_Some_get_some(uint64_t ptr) {
652 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
653 assert(obj->tag == LDKCOption_u32Z_Some);
654 int32_t some_conv = obj->some;
657 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
658 LDKHTLCOutputInCommitment ret = *owner->contents.result;
659 ret.is_owned = false;
662 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint64_t owner) {
663 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
664 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
665 uint64_t ret_ref = 0;
666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
671 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
672 LDKDecodeError ret = *owner->contents.err;
673 ret.is_owned = false;
676 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
677 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
678 LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
679 uint64_t ret_ref = 0;
680 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
681 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
685 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
686 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
687 ret.is_owned = false;
690 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
691 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
692 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
693 uint64_t ret_ref = 0;
694 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
695 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
699 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
700 LDKDecodeError ret = *owner->contents.err;
701 ret.is_owned = false;
704 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
705 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
706 LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
707 uint64_t ret_ref = 0;
708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
713 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
714 LDKChannelTransactionParameters ret = *owner->contents.result;
715 ret.is_owned = false;
718 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
719 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
720 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
721 uint64_t ret_ref = 0;
722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
727 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
728 LDKDecodeError ret = *owner->contents.err;
729 ret.is_owned = false;
732 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
733 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
734 LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
735 uint64_t ret_ref = 0;
736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
741 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
742 LDKHolderCommitmentTransaction ret = *owner->contents.result;
743 ret.is_owned = false;
746 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
747 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
748 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
749 uint64_t ret_ref = 0;
750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
755 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
756 LDKDecodeError ret = *owner->contents.err;
757 ret.is_owned = false;
760 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
761 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
762 LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
763 uint64_t ret_ref = 0;
764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
769 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
770 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
771 ret.is_owned = false;
774 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
775 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
776 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
777 uint64_t ret_ref = 0;
778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
783 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
784 LDKDecodeError ret = *owner->contents.err;
785 ret.is_owned = false;
788 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
789 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
790 LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
791 uint64_t ret_ref = 0;
792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
797 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
798 LDKTrustedClosingTransaction ret = *owner->contents.result;
799 ret.is_owned = false;
802 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint64_t owner) {
803 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
804 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
805 uint64_t ret_ref = 0;
806 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
807 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
811 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
812 CHECK(!owner->result_ok);
813 return *owner->contents.err;
815 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_err"))) TS_CResult_TrustedClosingTransactionNoneZ_get_err(uint64_t owner) {
816 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
817 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
820 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
821 LDKCommitmentTransaction ret = *owner->contents.result;
822 ret.is_owned = false;
825 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
826 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
827 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
828 uint64_t ret_ref = 0;
829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
834 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
835 LDKDecodeError ret = *owner->contents.err;
836 ret.is_owned = false;
839 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
840 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
841 LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
842 uint64_t ret_ref = 0;
843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
848 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
849 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
850 ret.is_owned = false;
853 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint64_t owner) {
854 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
855 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
856 uint64_t ret_ref = 0;
857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
862 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
863 CHECK(!owner->result_ok);
864 return *owner->contents.err;
866 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_err(uint64_t owner) {
867 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
868 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
871 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
872 CHECK(owner->result_ok);
873 return *owner->contents.result;
875 ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) TS_CResult_CVec_SignatureZNoneZ_get_ok(uint64_t owner) {
876 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
877 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
878 ptrArray ret_arr = NULL;
879 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
880 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
881 for (size_t m = 0; m < ret_var.datalen; m++) {
882 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
883 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
884 ret_arr_ptr[m] = ret_conv_12_arr;
890 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
891 CHECK(!owner->result_ok);
892 return *owner->contents.err;
894 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_err"))) TS_CResult_CVec_SignatureZNoneZ_get_err(uint64_t owner) {
895 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
896 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
899 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
900 LDKShutdownScript ret = *owner->contents.result;
901 ret.is_owned = false;
904 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint64_t owner) {
905 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
906 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
907 uint64_t ret_ref = 0;
908 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
909 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
913 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
914 LDKDecodeError ret = *owner->contents.err;
915 ret.is_owned = false;
918 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
919 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
920 LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
921 uint64_t ret_ref = 0;
922 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
923 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
927 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
928 LDKShutdownScript ret = *owner->contents.result;
929 ret.is_owned = false;
932 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint64_t owner) {
933 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
934 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
935 uint64_t ret_ref = 0;
936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
941 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
942 LDKInvalidShutdownScript ret = *owner->contents.err;
943 ret.is_owned = false;
946 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint64_t owner) {
947 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
948 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
949 uint64_t ret_ref = 0;
950 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
951 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
955 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
956 LDKRouteHop ret = *owner->contents.result;
957 ret.is_owned = false;
960 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
961 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
962 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
963 uint64_t ret_ref = 0;
964 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
965 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
969 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
970 LDKDecodeError ret = *owner->contents.err;
971 ret.is_owned = false;
974 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
975 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
976 LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
977 uint64_t ret_ref = 0;
978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
983 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
984 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
985 for (size_t i = 0; i < ret.datalen; i++) {
986 ret.data[i] = RouteHop_clone(&orig->data[i]);
990 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
991 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
992 for (size_t i = 0; i < ret.datalen; i++) {
993 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
997 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
998 LDKRoute ret = *owner->contents.result;
999 ret.is_owned = false;
1002 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint64_t owner) {
1003 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1004 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
1005 uint64_t ret_ref = 0;
1006 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1007 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1011 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1012 LDKDecodeError ret = *owner->contents.err;
1013 ret.is_owned = false;
1016 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
1017 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1018 LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
1019 uint64_t ret_ref = 0;
1020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1025 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1026 LDKRouteParameters ret = *owner->contents.result;
1027 ret.is_owned = false;
1030 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint64_t owner) {
1031 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1032 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1033 uint64_t ret_ref = 0;
1034 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1035 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1039 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1040 LDKDecodeError ret = *owner->contents.err;
1041 ret.is_owned = false;
1044 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
1045 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1046 LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1047 uint64_t ret_ref = 0;
1048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1053 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1054 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1055 for (size_t i = 0; i < ret.datalen; i++) {
1056 ret.data[i] = RouteHint_clone(&orig->data[i]);
1060 uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
1061 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1063 case LDKCOption_u64Z_Some: return 0;
1064 case LDKCOption_u64Z_None: return 1;
1068 int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
1069 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1070 assert(obj->tag == LDKCOption_u64Z_Some);
1071 int64_t some_conv = obj->some;
1074 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1075 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1076 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1079 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1080 LDKPaymentParameters ret = *owner->contents.result;
1081 ret.is_owned = false;
1084 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_get_ok(uint64_t owner) {
1085 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1086 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1087 uint64_t ret_ref = 0;
1088 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1089 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1093 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1094 LDKDecodeError ret = *owner->contents.err;
1095 ret.is_owned = false;
1098 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
1099 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1100 LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1101 uint64_t ret_ref = 0;
1102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1107 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1108 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1109 for (size_t i = 0; i < ret.datalen; i++) {
1110 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1114 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1115 LDKRouteHint ret = *owner->contents.result;
1116 ret.is_owned = false;
1119 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint64_t owner) {
1120 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1121 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1122 uint64_t ret_ref = 0;
1123 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1124 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1128 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1129 LDKDecodeError ret = *owner->contents.err;
1130 ret.is_owned = false;
1133 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
1134 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1135 LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
1136 uint64_t ret_ref = 0;
1137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1142 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1143 LDKRouteHintHop ret = *owner->contents.result;
1144 ret.is_owned = false;
1147 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint64_t owner) {
1148 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1149 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1150 uint64_t ret_ref = 0;
1151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1156 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1157 LDKDecodeError ret = *owner->contents.err;
1158 ret.is_owned = false;
1161 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
1162 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1163 LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1164 uint64_t ret_ref = 0;
1165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1170 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1171 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1172 for (size_t i = 0; i < ret.datalen; i++) {
1173 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1177 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1178 LDKRoute ret = *owner->contents.result;
1179 ret.is_owned = false;
1182 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
1183 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1184 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1185 uint64_t ret_ref = 0;
1186 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1187 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1191 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1192 LDKLightningError ret = *owner->contents.err;
1193 ret.is_owned = false;
1196 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
1197 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1198 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1199 uint64_t ret_ref = 0;
1200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1205 uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) {
1206 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1208 case LDKPaymentPurpose_InvoicePayment: return 0;
1209 case LDKPaymentPurpose_SpontaneousPayment: return 1;
1213 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) {
1214 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1215 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1216 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1217 memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32);
1218 return payment_preimage_arr;
1220 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) {
1221 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1222 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1223 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
1224 memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32);
1225 return payment_secret_arr;
1227 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) {
1228 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1229 assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment);
1230 int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__);
1231 memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32);
1232 return spontaneous_payment_arr;
1234 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1235 CHECK(owner->result_ok);
1236 return PaymentPurpose_clone(&*owner->contents.result);
1238 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) {
1239 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1240 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1241 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1242 uint64_t ret_ref = tag_ptr(ret_copy, true);
1246 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1247 LDKDecodeError ret = *owner->contents.err;
1248 ret.is_owned = false;
1251 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
1252 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1253 LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1254 uint64_t ret_ref = 0;
1255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1260 uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) {
1261 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1263 case LDKClosureReason_CounterpartyForceClosed: return 0;
1264 case LDKClosureReason_HolderForceClosed: return 1;
1265 case LDKClosureReason_CooperativeClosure: return 2;
1266 case LDKClosureReason_CommitmentTxConfirmed: return 3;
1267 case LDKClosureReason_FundingTimedOut: return 4;
1268 case LDKClosureReason_ProcessingError: return 5;
1269 case LDKClosureReason_DisconnectedPeer: return 6;
1270 case LDKClosureReason_OutdatedChannelManager: return 7;
1274 jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) {
1275 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1276 assert(obj->tag == LDKClosureReason_CounterpartyForceClosed);
1277 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1278 jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len);
1279 return peer_msg_conv;
1281 jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) {
1282 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1283 assert(obj->tag == LDKClosureReason_ProcessingError);
1284 LDKStr err_str = obj->processing_error.err;
1285 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
1288 uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) {
1289 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1291 case LDKCOption_ClosureReasonZ_Some: return 0;
1292 case LDKCOption_ClosureReasonZ_None: return 1;
1296 uint64_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint64_t ptr) {
1297 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1298 assert(obj->tag == LDKCOption_ClosureReasonZ_Some);
1299 uint64_t some_ref = tag_ptr(&obj->some, false);
1302 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1303 CHECK(owner->result_ok);
1304 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1306 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint64_t owner) {
1307 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1308 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1309 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1310 uint64_t ret_ref = tag_ptr(ret_copy, true);
1314 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1315 LDKDecodeError ret = *owner->contents.err;
1316 ret.is_owned = false;
1319 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
1320 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1321 LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1322 uint64_t ret_ref = 0;
1323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1328 uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LDKHTLCDestination_ty_from_ptr(uint64_t ptr) {
1329 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1331 case LDKHTLCDestination_NextHopChannel: return 0;
1332 case LDKHTLCDestination_UnknownNextHop: return 1;
1333 case LDKHTLCDestination_FailedPayment: return 2;
1337 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_node_id"))) TS_LDKHTLCDestination_NextHopChannel_get_node_id(uint64_t ptr) {
1338 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1339 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1340 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1341 memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33);
1344 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) {
1345 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1346 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1347 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1348 memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32);
1349 return channel_id_arr;
1351 int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) {
1352 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1353 assert(obj->tag == LDKHTLCDestination_UnknownNextHop);
1354 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
1355 return requested_forward_scid_conv;
1357 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
1358 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1359 assert(obj->tag == LDKHTLCDestination_FailedPayment);
1360 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1361 memcpy(payment_hash_arr->elems, obj->failed_payment.payment_hash.data, 32);
1362 return payment_hash_arr;
1364 uint32_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_ty_from_ptr"))) TS_LDKCOption_HTLCDestinationZ_ty_from_ptr(uint64_t ptr) {
1365 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1367 case LDKCOption_HTLCDestinationZ_Some: return 0;
1368 case LDKCOption_HTLCDestinationZ_None: return 1;
1372 uint64_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_Some_get_some"))) TS_LDKCOption_HTLCDestinationZ_Some_get_some(uint64_t ptr) {
1373 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1374 assert(obj->tag == LDKCOption_HTLCDestinationZ_Some);
1375 uint64_t some_ref = tag_ptr(&obj->some, false);
1378 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1379 CHECK(owner->result_ok);
1380 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
1382 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(uint64_t owner) {
1383 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1384 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
1385 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
1386 uint64_t ret_ref = tag_ptr(ret_copy, true);
1390 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1391 LDKDecodeError ret = *owner->contents.err;
1392 ret.is_owned = false;
1395 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
1396 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1397 LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
1398 uint64_t ret_ref = 0;
1399 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1400 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1404 uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
1405 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1407 case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
1408 case LDKNetworkUpdate_ChannelFailure: return 1;
1409 case LDKNetworkUpdate_NodeFailure: return 2;
1413 uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
1414 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1415 assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
1416 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
1417 uint64_t msg_ref = 0;
1418 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1419 msg_ref = tag_ptr(msg_var.inner, false);
1422 int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
1423 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1424 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1425 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
1426 return short_channel_id_conv;
1428 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
1429 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1430 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1431 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
1432 return is_permanent_conv;
1434 int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
1435 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1436 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1437 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1438 memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
1441 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
1442 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1443 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1444 jboolean is_permanent_conv = obj->node_failure.is_permanent;
1445 return is_permanent_conv;
1447 uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
1448 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1450 case LDKCOption_NetworkUpdateZ_Some: return 0;
1451 case LDKCOption_NetworkUpdateZ_None: return 1;
1455 uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
1456 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1457 assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
1458 uint64_t some_ref = tag_ptr(&obj->some, false);
1461 uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
1462 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1464 case LDKSpendableOutputDescriptor_StaticOutput: return 0;
1465 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: return 1;
1466 case LDKSpendableOutputDescriptor_StaticPaymentOutput: return 2;
1470 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(uint64_t ptr) {
1471 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1472 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1473 LDKOutPoint outpoint_var = obj->static_output.outpoint;
1474 uint64_t outpoint_ref = 0;
1475 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
1476 outpoint_ref = tag_ptr(outpoint_var.inner, false);
1477 return outpoint_ref;
1479 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint64_t ptr) {
1480 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1481 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1482 LDKTxOut* output_ref = &obj->static_output.output;
1483 return tag_ptr(output_ref, false);
1485 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint64_t ptr) {
1486 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1487 assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput);
1488 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
1489 uint64_t delayed_payment_output_ref = 0;
1490 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
1491 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
1492 return delayed_payment_output_ref;
1494 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint64_t ptr) {
1495 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1496 assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput);
1497 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
1498 uint64_t static_payment_output_ref = 0;
1499 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
1500 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
1501 return static_payment_output_ref;
1503 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
1504 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
1505 for (size_t i = 0; i < ret.datalen; i++) {
1506 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
1510 uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_from_ptr(uint64_t ptr) {
1511 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1513 case LDKEvent_FundingGenerationReady: return 0;
1514 case LDKEvent_PaymentReceived: return 1;
1515 case LDKEvent_PaymentClaimed: return 2;
1516 case LDKEvent_PaymentSent: return 3;
1517 case LDKEvent_PaymentFailed: return 4;
1518 case LDKEvent_PaymentPathSuccessful: return 5;
1519 case LDKEvent_PaymentPathFailed: return 6;
1520 case LDKEvent_ProbeSuccessful: return 7;
1521 case LDKEvent_ProbeFailed: return 8;
1522 case LDKEvent_PendingHTLCsForwardable: return 9;
1523 case LDKEvent_SpendableOutputs: return 10;
1524 case LDKEvent_PaymentForwarded: return 11;
1525 case LDKEvent_ChannelClosed: return 12;
1526 case LDKEvent_DiscardFunding: return 13;
1527 case LDKEvent_OpenChannelRequest: return 14;
1528 case LDKEvent_HTLCHandlingFailed: return 15;
1532 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) {
1533 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1534 assert(obj->tag == LDKEvent_FundingGenerationReady);
1535 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1536 memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32);
1537 return temporary_channel_id_arr;
1539 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) {
1540 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1541 assert(obj->tag == LDKEvent_FundingGenerationReady);
1542 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1543 memcpy(counterparty_node_id_arr->elems, obj->funding_generation_ready.counterparty_node_id.compressed_form, 33);
1544 return counterparty_node_id_arr;
1546 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis"))) TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(uint64_t ptr) {
1547 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1548 assert(obj->tag == LDKEvent_FundingGenerationReady);
1549 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
1550 return channel_value_satoshis_conv;
1552 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_output_script"))) TS_LDKEvent_FundingGenerationReady_get_output_script(uint64_t ptr) {
1553 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1554 assert(obj->tag == LDKEvent_FundingGenerationReady);
1555 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
1556 int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__);
1557 memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
1558 return output_script_arr;
1560 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
1561 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1562 assert(obj->tag == LDKEvent_FundingGenerationReady);
1563 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
1564 return user_channel_id_conv;
1566 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
1567 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1568 assert(obj->tag == LDKEvent_PaymentReceived);
1569 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1570 memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
1571 return payment_hash_arr;
1573 int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
1574 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1575 assert(obj->tag == LDKEvent_PaymentReceived);
1576 int64_t amount_msat_conv = obj->payment_received.amount_msat;
1577 return amount_msat_conv;
1579 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
1580 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1581 assert(obj->tag == LDKEvent_PaymentReceived);
1582 uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
1585 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
1586 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1587 assert(obj->tag == LDKEvent_PaymentClaimed);
1588 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1589 memcpy(payment_hash_arr->elems, obj->payment_claimed.payment_hash.data, 32);
1590 return payment_hash_arr;
1592 int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_amount_msat"))) TS_LDKEvent_PaymentClaimed_get_amount_msat(uint64_t ptr) {
1593 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1594 assert(obj->tag == LDKEvent_PaymentClaimed);
1595 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
1596 return amount_msat_conv;
1598 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_purpose"))) TS_LDKEvent_PaymentClaimed_get_purpose(uint64_t ptr) {
1599 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1600 assert(obj->tag == LDKEvent_PaymentClaimed);
1601 uint64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
1604 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint64_t ptr) {
1605 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1606 assert(obj->tag == LDKEvent_PaymentSent);
1607 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1608 memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32);
1609 return payment_id_arr;
1611 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint64_t ptr) {
1612 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1613 assert(obj->tag == LDKEvent_PaymentSent);
1614 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1615 memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32);
1616 return payment_preimage_arr;
1618 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint64_t ptr) {
1619 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1620 assert(obj->tag == LDKEvent_PaymentSent);
1621 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1622 memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32);
1623 return payment_hash_arr;
1625 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint64_t ptr) {
1626 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1627 assert(obj->tag == LDKEvent_PaymentSent);
1628 uint64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
1629 return fee_paid_msat_ref;
1631 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint64_t ptr) {
1632 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1633 assert(obj->tag == LDKEvent_PaymentFailed);
1634 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1635 memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32);
1636 return payment_id_arr;
1638 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint64_t ptr) {
1639 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1640 assert(obj->tag == LDKEvent_PaymentFailed);
1641 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1642 memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32);
1643 return payment_hash_arr;
1645 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) {
1646 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1647 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1648 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1649 memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32);
1650 return payment_id_arr;
1652 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint64_t ptr) {
1653 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1654 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1655 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1656 memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32);
1657 return payment_hash_arr;
1659 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) {
1660 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1661 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1662 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
1663 uint64_tArray path_arr = NULL;
1664 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1665 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1666 for (size_t k = 0; k < path_var.datalen; k++) {
1667 LDKRouteHop path_conv_10_var = path_var.data[k];
1668 uint64_t path_conv_10_ref = 0;
1669 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1670 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1671 path_arr_ptr[k] = path_conv_10_ref;
1676 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) {
1677 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1678 assert(obj->tag == LDKEvent_PaymentPathFailed);
1679 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1680 memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32);
1681 return payment_id_arr;
1683 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint64_t ptr) {
1684 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1685 assert(obj->tag == LDKEvent_PaymentPathFailed);
1686 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1687 memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
1688 return payment_hash_arr;
1690 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest"))) TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest(uint64_t ptr) {
1691 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1692 assert(obj->tag == LDKEvent_PaymentPathFailed);
1693 jboolean rejected_by_dest_conv = obj->payment_path_failed.rejected_by_dest;
1694 return rejected_by_dest_conv;
1696 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
1697 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1698 assert(obj->tag == LDKEvent_PaymentPathFailed);
1699 uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
1700 return network_update_ref;
1702 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
1703 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1704 assert(obj->tag == LDKEvent_PaymentPathFailed);
1705 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
1706 return all_paths_failed_conv;
1708 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
1709 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1710 assert(obj->tag == LDKEvent_PaymentPathFailed);
1711 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
1712 uint64_tArray path_arr = NULL;
1713 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1714 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1715 for (size_t k = 0; k < path_var.datalen; k++) {
1716 LDKRouteHop path_conv_10_var = path_var.data[k];
1717 uint64_t path_conv_10_ref = 0;
1718 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1719 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1720 path_arr_ptr[k] = path_conv_10_ref;
1725 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) {
1726 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1727 assert(obj->tag == LDKEvent_PaymentPathFailed);
1728 uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
1729 return short_channel_id_ref;
1731 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) {
1732 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1733 assert(obj->tag == LDKEvent_PaymentPathFailed);
1734 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
1735 uint64_t retry_ref = 0;
1736 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
1737 retry_ref = tag_ptr(retry_var.inner, false);
1740 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) {
1741 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1742 assert(obj->tag == LDKEvent_ProbeSuccessful);
1743 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1744 memcpy(payment_id_arr->elems, obj->probe_successful.payment_id.data, 32);
1745 return payment_id_arr;
1747 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_hash"))) TS_LDKEvent_ProbeSuccessful_get_payment_hash(uint64_t ptr) {
1748 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1749 assert(obj->tag == LDKEvent_ProbeSuccessful);
1750 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1751 memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32);
1752 return payment_hash_arr;
1754 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) {
1755 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1756 assert(obj->tag == LDKEvent_ProbeSuccessful);
1757 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
1758 uint64_tArray path_arr = NULL;
1759 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1760 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1761 for (size_t k = 0; k < path_var.datalen; k++) {
1762 LDKRouteHop path_conv_10_var = path_var.data[k];
1763 uint64_t path_conv_10_ref = 0;
1764 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1765 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1766 path_arr_ptr[k] = path_conv_10_ref;
1771 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) {
1772 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1773 assert(obj->tag == LDKEvent_ProbeFailed);
1774 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1775 memcpy(payment_id_arr->elems, obj->probe_failed.payment_id.data, 32);
1776 return payment_id_arr;
1778 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash"))) TS_LDKEvent_ProbeFailed_get_payment_hash(uint64_t ptr) {
1779 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1780 assert(obj->tag == LDKEvent_ProbeFailed);
1781 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1782 memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32);
1783 return payment_hash_arr;
1785 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) {
1786 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1787 assert(obj->tag == LDKEvent_ProbeFailed);
1788 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
1789 uint64_tArray path_arr = NULL;
1790 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1791 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1792 for (size_t k = 0; k < path_var.datalen; k++) {
1793 LDKRouteHop path_conv_10_var = path_var.data[k];
1794 uint64_t path_conv_10_ref = 0;
1795 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1796 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1797 path_arr_ptr[k] = path_conv_10_ref;
1802 uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) {
1803 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1804 assert(obj->tag == LDKEvent_ProbeFailed);
1805 uint64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
1806 return short_channel_id_ref;
1808 int64_t __attribute__((export_name("TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable"))) TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(uint64_t ptr) {
1809 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1810 assert(obj->tag == LDKEvent_PendingHTLCsForwardable);
1811 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
1812 return time_forwardable_conv;
1814 uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
1815 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1816 assert(obj->tag == LDKEvent_SpendableOutputs);
1817 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
1818 uint64_tArray outputs_arr = NULL;
1819 outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__);
1820 uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8);
1821 for (size_t b = 0; b < outputs_var.datalen; b++) {
1822 uint64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
1823 outputs_arr_ptr[b] = outputs_conv_27_ref;
1828 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) {
1829 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1830 assert(obj->tag == LDKEvent_PaymentForwarded);
1831 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1832 memcpy(prev_channel_id_arr->elems, obj->payment_forwarded.prev_channel_id.data, 32);
1833 return prev_channel_id_arr;
1835 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) {
1836 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1837 assert(obj->tag == LDKEvent_PaymentForwarded);
1838 int8_tArray next_channel_id_arr = init_int8_tArray(32, __LINE__);
1839 memcpy(next_channel_id_arr->elems, obj->payment_forwarded.next_channel_id.data, 32);
1840 return next_channel_id_arr;
1842 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) {
1843 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1844 assert(obj->tag == LDKEvent_PaymentForwarded);
1845 uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
1846 return fee_earned_msat_ref;
1848 jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) {
1849 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1850 assert(obj->tag == LDKEvent_PaymentForwarded);
1851 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
1852 return claim_from_onchain_tx_conv;
1854 int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
1855 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1856 assert(obj->tag == LDKEvent_ChannelClosed);
1857 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1858 memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
1859 return channel_id_arr;
1861 int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
1862 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1863 assert(obj->tag == LDKEvent_ChannelClosed);
1864 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
1865 return user_channel_id_conv;
1867 uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
1868 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1869 assert(obj->tag == LDKEvent_ChannelClosed);
1870 uint64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
1873 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) {
1874 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1875 assert(obj->tag == LDKEvent_DiscardFunding);
1876 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1877 memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32);
1878 return channel_id_arr;
1880 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) {
1881 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1882 assert(obj->tag == LDKEvent_DiscardFunding);
1883 LDKTransaction transaction_var = obj->discard_funding.transaction;
1884 int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__);
1885 memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen);
1886 return transaction_arr;
1888 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) {
1889 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1890 assert(obj->tag == LDKEvent_OpenChannelRequest);
1891 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1892 memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32);
1893 return temporary_channel_id_arr;
1895 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) {
1896 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1897 assert(obj->tag == LDKEvent_OpenChannelRequest);
1898 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1899 memcpy(counterparty_node_id_arr->elems, obj->open_channel_request.counterparty_node_id.compressed_form, 33);
1900 return counterparty_node_id_arr;
1902 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_funding_satoshis"))) TS_LDKEvent_OpenChannelRequest_get_funding_satoshis(uint64_t ptr) {
1903 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1904 assert(obj->tag == LDKEvent_OpenChannelRequest);
1905 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
1906 return funding_satoshis_conv;
1908 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_push_msat"))) TS_LDKEvent_OpenChannelRequest_get_push_msat(uint64_t ptr) {
1909 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1910 assert(obj->tag == LDKEvent_OpenChannelRequest);
1911 int64_t push_msat_conv = obj->open_channel_request.push_msat;
1912 return push_msat_conv;
1914 uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_type"))) TS_LDKEvent_OpenChannelRequest_get_channel_type(uint64_t ptr) {
1915 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1916 assert(obj->tag == LDKEvent_OpenChannelRequest);
1917 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
1918 uint64_t channel_type_ref = 0;
1919 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
1920 channel_type_ref = tag_ptr(channel_type_var.inner, false);
1921 return channel_type_ref;
1923 int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) {
1924 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1925 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1926 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1927 memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32);
1928 return prev_channel_id_arr;
1930 uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) {
1931 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1932 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1933 uint64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
1934 return failed_next_destination_ref;
1936 uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDKCOption_EventZ_ty_from_ptr(uint64_t ptr) {
1937 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1939 case LDKCOption_EventZ_Some: return 0;
1940 case LDKCOption_EventZ_None: return 1;
1944 uint64_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint64_t ptr) {
1945 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1946 assert(obj->tag == LDKCOption_EventZ_Some);
1947 uint64_t some_ref = tag_ptr(&obj->some, false);
1950 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1951 CHECK(owner->result_ok);
1952 return COption_EventZ_clone(&*owner->contents.result);
1954 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ok"))) TS_CResult_COption_EventZDecodeErrorZ_get_ok(uint64_t owner) {
1955 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1956 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
1957 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
1958 uint64_t ret_ref = tag_ptr(ret_copy, true);
1962 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1963 LDKDecodeError ret = *owner->contents.err;
1964 ret.is_owned = false;
1967 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
1968 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1969 LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
1970 uint64_t ret_ref = 0;
1971 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1972 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1976 uint32_t __attribute__((export_name("TS_LDKErrorAction_ty_from_ptr"))) TS_LDKErrorAction_ty_from_ptr(uint64_t ptr) {
1977 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1979 case LDKErrorAction_DisconnectPeer: return 0;
1980 case LDKErrorAction_IgnoreError: return 1;
1981 case LDKErrorAction_IgnoreAndLog: return 2;
1982 case LDKErrorAction_IgnoreDuplicateGossip: return 3;
1983 case LDKErrorAction_SendErrorMessage: return 4;
1984 case LDKErrorAction_SendWarningMessage: return 5;
1988 uint64_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg"))) TS_LDKErrorAction_DisconnectPeer_get_msg(uint64_t ptr) {
1989 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1990 assert(obj->tag == LDKErrorAction_DisconnectPeer);
1991 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
1992 uint64_t msg_ref = 0;
1993 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1994 msg_ref = tag_ptr(msg_var.inner, false);
1997 uint32_t __attribute__((export_name("TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log"))) TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(uint64_t ptr) {
1998 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1999 assert(obj->tag == LDKErrorAction_IgnoreAndLog);
2000 uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
2001 return ignore_and_log_conv;
2003 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg"))) TS_LDKErrorAction_SendErrorMessage_get_msg(uint64_t ptr) {
2004 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2005 assert(obj->tag == LDKErrorAction_SendErrorMessage);
2006 LDKErrorMessage msg_var = obj->send_error_message.msg;
2007 uint64_t msg_ref = 0;
2008 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2009 msg_ref = tag_ptr(msg_var.inner, false);
2012 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_msg"))) TS_LDKErrorAction_SendWarningMessage_get_msg(uint64_t ptr) {
2013 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2014 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2015 LDKWarningMessage msg_var = obj->send_warning_message.msg;
2016 uint64_t msg_ref = 0;
2017 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2018 msg_ref = tag_ptr(msg_var.inner, false);
2021 uint32_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_log_level"))) TS_LDKErrorAction_SendWarningMessage_get_log_level(uint64_t ptr) {
2022 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2023 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2024 uint32_t log_level_conv = LDKLevel_to_js(obj->send_warning_message.log_level);
2025 return log_level_conv;
2027 uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint64_t ptr) {
2028 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2030 case LDKMessageSendEvent_SendAcceptChannel: return 0;
2031 case LDKMessageSendEvent_SendOpenChannel: return 1;
2032 case LDKMessageSendEvent_SendFundingCreated: return 2;
2033 case LDKMessageSendEvent_SendFundingSigned: return 3;
2034 case LDKMessageSendEvent_SendChannelReady: return 4;
2035 case LDKMessageSendEvent_SendAnnouncementSignatures: return 5;
2036 case LDKMessageSendEvent_UpdateHTLCs: return 6;
2037 case LDKMessageSendEvent_SendRevokeAndACK: return 7;
2038 case LDKMessageSendEvent_SendClosingSigned: return 8;
2039 case LDKMessageSendEvent_SendShutdown: return 9;
2040 case LDKMessageSendEvent_SendChannelReestablish: return 10;
2041 case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 11;
2042 case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 12;
2043 case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
2044 case LDKMessageSendEvent_SendChannelUpdate: return 14;
2045 case LDKMessageSendEvent_HandleError: return 15;
2046 case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
2047 case LDKMessageSendEvent_SendShortIdsQuery: return 17;
2048 case LDKMessageSendEvent_SendReplyChannelRange: return 18;
2049 case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
2053 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint64_t ptr) {
2054 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2055 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2056 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2057 memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33);
2060 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_msg"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(uint64_t ptr) {
2061 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2062 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2063 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2064 uint64_t msg_ref = 0;
2065 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2066 msg_ref = tag_ptr(msg_var.inner, false);
2069 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint64_t ptr) {
2070 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2071 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2072 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2073 memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33);
2076 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_msg"))) TS_LDKMessageSendEvent_SendOpenChannel_get_msg(uint64_t ptr) {
2077 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2078 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2079 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2080 uint64_t msg_ref = 0;
2081 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2082 msg_ref = tag_ptr(msg_var.inner, false);
2085 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint64_t ptr) {
2086 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2087 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2088 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2089 memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33);
2092 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_msg"))) TS_LDKMessageSendEvent_SendFundingCreated_get_msg(uint64_t ptr) {
2093 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2094 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2095 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2096 uint64_t msg_ref = 0;
2097 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2098 msg_ref = tag_ptr(msg_var.inner, false);
2101 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint64_t ptr) {
2102 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2103 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2104 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2105 memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33);
2108 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_msg"))) TS_LDKMessageSendEvent_SendFundingSigned_get_msg(uint64_t ptr) {
2109 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2110 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2111 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2112 uint64_t msg_ref = 0;
2113 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2114 msg_ref = tag_ptr(msg_var.inner, false);
2117 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReady_get_node_id(uint64_t ptr) {
2118 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2119 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2120 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2121 memcpy(node_id_arr->elems, obj->send_channel_ready.node_id.compressed_form, 33);
2124 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_msg"))) TS_LDKMessageSendEvent_SendChannelReady_get_msg(uint64_t ptr) {
2125 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2126 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2127 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2128 uint64_t msg_ref = 0;
2129 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2130 msg_ref = tag_ptr(msg_var.inner, false);
2133 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint64_t ptr) {
2134 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2135 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2136 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2137 memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33);
2140 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(uint64_t ptr) {
2141 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2142 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2143 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2144 uint64_t msg_ref = 0;
2145 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2146 msg_ref = tag_ptr(msg_var.inner, false);
2149 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint64_t ptr) {
2150 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2151 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2152 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2153 memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33);
2156 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_updates"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(uint64_t ptr) {
2157 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2158 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2159 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2160 uint64_t updates_ref = 0;
2161 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2162 updates_ref = tag_ptr(updates_var.inner, false);
2165 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint64_t ptr) {
2166 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2167 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2168 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2169 memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33);
2172 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(uint64_t ptr) {
2173 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2174 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2175 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2176 uint64_t msg_ref = 0;
2177 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2178 msg_ref = tag_ptr(msg_var.inner, false);
2181 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint64_t ptr) {
2182 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2183 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2184 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2185 memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33);
2188 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_msg"))) TS_LDKMessageSendEvent_SendClosingSigned_get_msg(uint64_t ptr) {
2189 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2190 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2191 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2192 uint64_t msg_ref = 0;
2193 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2194 msg_ref = tag_ptr(msg_var.inner, false);
2197 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint64_t ptr) {
2198 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2199 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2200 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2201 memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33);
2204 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg"))) TS_LDKMessageSendEvent_SendShutdown_get_msg(uint64_t ptr) {
2205 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2206 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2207 LDKShutdown msg_var = obj->send_shutdown.msg;
2208 uint64_t msg_ref = 0;
2209 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2210 msg_ref = tag_ptr(msg_var.inner, false);
2213 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint64_t ptr) {
2214 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2215 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2216 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2217 memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33);
2220 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_msg"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(uint64_t ptr) {
2221 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2222 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2223 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2224 uint64_t msg_ref = 0;
2225 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2226 msg_ref = tag_ptr(msg_var.inner, false);
2229 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
2230 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2231 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2232 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2233 uint64_t msg_ref = 0;
2234 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2235 msg_ref = tag_ptr(msg_var.inner, false);
2238 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint64_t ptr) {
2239 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2240 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2241 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2242 uint64_t update_msg_ref = 0;
2243 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2244 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2245 return update_msg_ref;
2247 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint64_t ptr) {
2248 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2249 assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement);
2250 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
2251 uint64_t msg_ref = 0;
2252 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2253 msg_ref = tag_ptr(msg_var.inner, false);
2256 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
2257 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2258 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
2259 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2260 uint64_t msg_ref = 0;
2261 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2262 msg_ref = tag_ptr(msg_var.inner, false);
2265 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint64_t ptr) {
2266 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2267 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2268 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2269 memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33);
2272 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(uint64_t ptr) {
2273 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2274 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2275 LDKChannelUpdate msg_var = obj->send_channel_update.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_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint64_t ptr) {
2282 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2283 assert(obj->tag == LDKMessageSendEvent_HandleError);
2284 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2285 memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33);
2288 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint64_t ptr) {
2289 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2290 assert(obj->tag == LDKMessageSendEvent_HandleError);
2291 uint64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2294 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint64_t ptr) {
2295 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2296 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2297 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2298 memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33);
2301 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(uint64_t ptr) {
2302 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2303 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2304 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2305 uint64_t msg_ref = 0;
2306 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2307 msg_ref = tag_ptr(msg_var.inner, false);
2310 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint64_t ptr) {
2311 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2312 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2313 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2314 memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33);
2317 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(uint64_t ptr) {
2318 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2319 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2320 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2321 uint64_t msg_ref = 0;
2322 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2323 msg_ref = tag_ptr(msg_var.inner, false);
2326 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint64_t ptr) {
2327 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2328 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2329 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2330 memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33);
2333 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg(uint64_t ptr) {
2334 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2335 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2336 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2337 uint64_t msg_ref = 0;
2338 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2339 msg_ref = tag_ptr(msg_var.inner, false);
2342 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(uint64_t ptr) {
2343 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2344 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2345 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2346 memcpy(node_id_arr->elems, obj->send_gossip_timestamp_filter.node_id.compressed_form, 33);
2349 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(uint64_t ptr) {
2350 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2351 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2352 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2353 uint64_t msg_ref = 0;
2354 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2355 msg_ref = tag_ptr(msg_var.inner, false);
2358 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2359 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2360 for (size_t i = 0; i < ret.datalen; i++) {
2361 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2365 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2366 CHECK(owner->result_ok);
2367 return TxOut_clone(&*owner->contents.result);
2369 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
2370 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2371 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
2372 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
2373 return tag_ptr(ret_ref, true);
2376 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2377 CHECK(!owner->result_ok);
2378 return AccessError_clone(&*owner->contents.err);
2380 uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
2381 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2382 uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
2386 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2389 uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) {
2390 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2391 uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2395 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2398 int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) {
2399 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2400 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2401 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
2402 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
2406 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2407 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2408 for (size_t i = 0; i < ret.datalen; i++) {
2409 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2413 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
2414 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
2415 for (size_t i = 0; i < ret.datalen; i++) {
2416 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
2420 static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2421 CHECK(owner->result_ok);
2422 return *owner->contents.result;
2424 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) {
2425 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2426 CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
2429 static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2430 CHECK(!owner->result_ok);
2431 return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
2433 uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) {
2434 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2435 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
2439 uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
2440 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2442 case LDKMonitorEvent_HTLCEvent: return 0;
2443 case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
2444 case LDKMonitorEvent_UpdateCompleted: return 2;
2445 case LDKMonitorEvent_UpdateFailed: return 3;
2449 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) {
2450 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2451 assert(obj->tag == LDKMonitorEvent_HTLCEvent);
2452 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2453 uint64_t htlc_event_ref = 0;
2454 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2455 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2456 return htlc_event_ref;
2458 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) {
2459 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2460 assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed);
2461 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2462 uint64_t commitment_tx_confirmed_ref = 0;
2463 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2464 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2465 return commitment_tx_confirmed_ref;
2467 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) {
2468 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2469 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2470 LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
2471 uint64_t funding_txo_ref = 0;
2472 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2473 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2474 return funding_txo_ref;
2476 int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) {
2477 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2478 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2479 int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
2480 return monitor_update_id_conv;
2482 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
2483 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2484 assert(obj->tag == LDKMonitorEvent_UpdateFailed);
2485 LDKOutPoint update_failed_var = obj->update_failed;
2486 uint64_t update_failed_ref = 0;
2487 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2488 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2489 return update_failed_ref;
2491 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2492 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2493 for (size_t i = 0; i < ret.datalen; i++) {
2494 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2498 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2499 LDKOutPoint ret = owner->a;
2500 ret.is_owned = false;
2503 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) {
2504 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2505 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2506 uint64_t ret_ref = 0;
2507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2512 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2513 return CVec_MonitorEventZ_clone(&owner->b);
2515 uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) {
2516 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2517 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2518 uint64_tArray ret_arr = NULL;
2519 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
2520 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
2521 for (size_t o = 0; o < ret_var.datalen; o++) {
2522 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2523 *ret_conv_14_copy = ret_var.data[o];
2524 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2525 ret_arr_ptr[o] = ret_conv_14_ref;
2532 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2535 int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) {
2536 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2537 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
2538 memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33);
2542 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
2543 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
2544 for (size_t i = 0; i < ret.datalen; i++) {
2545 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
2549 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(uint64_t ptr) {
2550 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2552 case LDKCOption_C2Tuple_usizeTransactionZZ_Some: return 0;
2553 case LDKCOption_C2Tuple_usizeTransactionZZ_None: return 1;
2557 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(uint64_t ptr) {
2558 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2559 assert(obj->tag == LDKCOption_C2Tuple_usizeTransactionZZ_Some);
2560 LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
2561 *some_conv = obj->some;
2562 *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv);
2563 return tag_ptr(some_conv, true);
2565 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2566 LDKFixedPenaltyScorer ret = *owner->contents.result;
2567 ret.is_owned = false;
2570 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) {
2571 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2572 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
2573 uint64_t ret_ref = 0;
2574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2579 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2580 LDKDecodeError ret = *owner->contents.err;
2581 ret.is_owned = false;
2584 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
2585 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2586 LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
2587 uint64_t ret_ref = 0;
2588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2593 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2596 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) {
2597 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2598 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
2602 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2605 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) {
2606 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2607 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
2611 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) {
2612 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2614 case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0;
2615 case LDKCOption_C2Tuple_u64u64ZZ_None: return 1;
2619 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) {
2620 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2621 assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some);
2622 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2623 *some_conv = obj->some;
2624 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
2625 return tag_ptr(some_conv, true);
2627 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
2628 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
2629 for (size_t i = 0; i < ret.datalen; i++) {
2630 ret.data[i] = NodeId_clone(&orig->data[i]);
2634 typedef struct LDKLogger_JCalls {
2635 atomic_size_t refcnt;
2636 uint32_t instance_ptr;
2638 static void LDKLogger_JCalls_free(void* this_arg) {
2639 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2640 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2644 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
2645 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2646 LDKRecord record_var = *record;
2647 uint64_t record_ref = 0;
2648 record_var = Record_clone(&record_var);
2649 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
2650 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
2651 js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0);
2653 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
2654 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
2655 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2657 static inline LDKLogger LDKLogger_init (JSValue o) {
2658 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
2659 atomic_init(&calls->refcnt, 1);
2660 calls->instance_ptr = o;
2663 .this_arg = (void*) calls,
2664 .log = log_LDKLogger_jcall,
2665 .free = LDKLogger_JCalls_free,
2669 uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) {
2670 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
2671 *res_ptr = LDKLogger_init(o);
2672 return tag_ptr(res_ptr, true);
2674 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2675 LDKProbabilisticScorer ret = *owner->contents.result;
2676 ret.is_owned = false;
2679 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) {
2680 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2681 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
2682 uint64_t ret_ref = 0;
2683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2688 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2689 LDKDecodeError ret = *owner->contents.err;
2690 ret.is_owned = false;
2693 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
2694 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2695 LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
2696 uint64_t ret_ref = 0;
2697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2702 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2703 LDKInitFeatures ret = *owner->contents.result;
2704 ret.is_owned = false;
2707 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2708 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2709 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
2710 uint64_t ret_ref = 0;
2711 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2712 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2716 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2717 LDKDecodeError ret = *owner->contents.err;
2718 ret.is_owned = false;
2721 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2722 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2723 LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
2724 uint64_t ret_ref = 0;
2725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2730 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2731 LDKChannelFeatures ret = *owner->contents.result;
2732 ret.is_owned = false;
2735 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2736 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2737 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
2738 uint64_t ret_ref = 0;
2739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2744 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2745 LDKDecodeError ret = *owner->contents.err;
2746 ret.is_owned = false;
2749 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2750 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2751 LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
2752 uint64_t ret_ref = 0;
2753 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2754 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2758 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2759 LDKNodeFeatures ret = *owner->contents.result;
2760 ret.is_owned = false;
2763 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2764 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2765 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
2766 uint64_t ret_ref = 0;
2767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2772 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2773 LDKDecodeError ret = *owner->contents.err;
2774 ret.is_owned = false;
2777 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2778 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2779 LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
2780 uint64_t ret_ref = 0;
2781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2786 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2787 LDKInvoiceFeatures ret = *owner->contents.result;
2788 ret.is_owned = false;
2791 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2792 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2793 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
2794 uint64_t ret_ref = 0;
2795 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2796 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2800 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2801 LDKDecodeError ret = *owner->contents.err;
2802 ret.is_owned = false;
2805 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2806 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2807 LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
2808 uint64_t ret_ref = 0;
2809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2810 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2814 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2815 LDKChannelTypeFeatures ret = *owner->contents.result;
2816 ret.is_owned = false;
2819 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2820 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2821 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
2822 uint64_t ret_ref = 0;
2823 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2824 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2828 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2829 LDKDecodeError ret = *owner->contents.err;
2830 ret.is_owned = false;
2833 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2834 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2835 LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
2836 uint64_t ret_ref = 0;
2837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2838 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2842 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2843 LDKNodeId ret = *owner->contents.result;
2844 ret.is_owned = false;
2847 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) {
2848 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2849 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
2850 uint64_t ret_ref = 0;
2851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2856 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2857 LDKDecodeError ret = *owner->contents.err;
2858 ret.is_owned = false;
2861 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
2862 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2863 LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
2864 uint64_t ret_ref = 0;
2865 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2866 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2870 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2871 CHECK(owner->result_ok);
2872 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
2874 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) {
2875 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2876 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
2877 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
2878 uint64_t ret_ref = tag_ptr(ret_copy, true);
2882 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2883 LDKDecodeError ret = *owner->contents.err;
2884 ret.is_owned = false;
2887 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
2888 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2889 LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
2890 uint64_t ret_ref = 0;
2891 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2892 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2896 typedef struct LDKAccess_JCalls {
2897 atomic_size_t refcnt;
2898 uint32_t instance_ptr;
2900 static void LDKAccess_JCalls_free(void* this_arg) {
2901 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2902 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2906 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
2907 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2908 int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
2909 memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
2910 int64_t short_channel_id_conv = short_channel_id;
2911 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, short_channel_id_conv, 0, 0, 0, 0);
2912 void* ret_ptr = untag_ptr(ret);
2913 CHECK_ACCESS(ret_ptr);
2914 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
2915 FREE(untag_ptr(ret));
2918 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
2919 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
2920 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2922 static inline LDKAccess LDKAccess_init (JSValue o) {
2923 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
2924 atomic_init(&calls->refcnt, 1);
2925 calls->instance_ptr = o;
2928 .this_arg = (void*) calls,
2929 .get_utxo = get_utxo_LDKAccess_jcall,
2930 .free = LDKAccess_JCalls_free,
2934 uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
2935 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
2936 *res_ptr = LDKAccess_init(o);
2937 return tag_ptr(res_ptr, true);
2939 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) {
2940 void* this_arg_ptr = untag_ptr(this_arg);
2941 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2942 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
2943 unsigned char genesis_hash_arr[32];
2944 CHECK(genesis_hash->arr_len == 32);
2945 memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
2946 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
2947 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2948 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
2949 return tag_ptr(ret_conv, true);
2952 uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
2953 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2955 case LDKCOption_AccessZ_Some: return 0;
2956 case LDKCOption_AccessZ_None: return 1;
2960 uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
2961 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2962 assert(obj->tag == LDKCOption_AccessZ_Some);
2963 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
2964 *some_ret = obj->some;
2965 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2966 if ((*some_ret).free == LDKAccess_JCalls_free) {
2967 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2968 LDKAccess_JCalls_cloned(&(*some_ret));
2970 return tag_ptr(some_ret, true);
2972 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2973 CHECK(owner->result_ok);
2974 return *owner->contents.result;
2976 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) {
2977 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2978 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
2982 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2983 LDKLightningError ret = *owner->contents.err;
2984 ret.is_owned = false;
2987 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) {
2988 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2989 LDKLightningError ret_var = CResult_boolLightningErrorZ_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 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
2997 LDKChannelAnnouncement ret = owner->a;
2998 ret.is_owned = false;
3001 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) {
3002 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3003 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
3004 uint64_t ret_ref = 0;
3005 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3006 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3010 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3011 LDKChannelUpdate ret = owner->b;
3012 ret.is_owned = false;
3015 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) {
3016 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3017 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
3018 uint64_t ret_ref = 0;
3019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3024 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3025 LDKChannelUpdate ret = owner->c;
3026 ret.is_owned = false;
3029 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) {
3030 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3031 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
3032 uint64_t ret_ref = 0;
3033 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3034 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3038 static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
3039 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
3040 for (size_t i = 0; i < ret.datalen; i++) {
3041 ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]);
3045 static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
3046 LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
3047 for (size_t i = 0; i < ret.datalen; i++) {
3048 ret.data[i] = NodeAnnouncement_clone(&orig->data[i]);
3052 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3053 CHECK(owner->result_ok);
3054 return *owner->contents.result;
3056 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_ok"))) TS_CResult_NoneLightningErrorZ_get_ok(uint64_t owner) {
3057 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3058 CResult_NoneLightningErrorZ_get_ok(owner_conv);
3061 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3062 LDKLightningError ret = *owner->contents.err;
3063 ret.is_owned = false;
3066 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint64_t owner) {
3067 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3068 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3069 uint64_t ret_ref = 0;
3070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3075 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3076 LDKChannelUpdateInfo ret = *owner->contents.result;
3077 ret.is_owned = false;
3080 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(uint64_t owner) {
3081 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3082 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3083 uint64_t ret_ref = 0;
3084 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3085 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3089 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3090 LDKDecodeError ret = *owner->contents.err;
3091 ret.is_owned = false;
3094 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
3095 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3096 LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3097 uint64_t ret_ref = 0;
3098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3103 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3104 LDKChannelInfo ret = *owner->contents.result;
3105 ret.is_owned = false;
3108 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint64_t owner) {
3109 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3110 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3111 uint64_t ret_ref = 0;
3112 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3113 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3117 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3118 LDKDecodeError ret = *owner->contents.err;
3119 ret.is_owned = false;
3122 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
3123 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3124 LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3125 uint64_t ret_ref = 0;
3126 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3127 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3131 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3132 LDKRoutingFees ret = *owner->contents.result;
3133 ret.is_owned = false;
3136 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint64_t owner) {
3137 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3138 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3139 uint64_t ret_ref = 0;
3140 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3141 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3145 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3146 LDKDecodeError ret = *owner->contents.err;
3147 ret.is_owned = false;
3150 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
3151 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3152 LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3153 uint64_t ret_ref = 0;
3154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3159 uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetAddress_ty_from_ptr(uint64_t ptr) {
3160 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3162 case LDKNetAddress_IPv4: return 0;
3163 case LDKNetAddress_IPv6: return 1;
3164 case LDKNetAddress_OnionV2: return 2;
3165 case LDKNetAddress_OnionV3: return 3;
3166 case LDKNetAddress_Hostname: return 4;
3170 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint64_t ptr) {
3171 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3172 assert(obj->tag == LDKNetAddress_IPv4);
3173 int8_tArray addr_arr = init_int8_tArray(4, __LINE__);
3174 memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4);
3177 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNetAddress_IPv4_get_port(uint64_t ptr) {
3178 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3179 assert(obj->tag == LDKNetAddress_IPv4);
3180 int16_t port_conv = obj->i_pv4.port;
3183 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint64_t ptr) {
3184 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3185 assert(obj->tag == LDKNetAddress_IPv6);
3186 int8_tArray addr_arr = init_int8_tArray(16, __LINE__);
3187 memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16);
3190 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNetAddress_IPv6_get_port(uint64_t ptr) {
3191 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3192 assert(obj->tag == LDKNetAddress_IPv6);
3193 int16_t port_conv = obj->i_pv6.port;
3196 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint64_t ptr) {
3197 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3198 assert(obj->tag == LDKNetAddress_OnionV2);
3199 int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__);
3200 memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12);
3201 return onion_v2_arr;
3203 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint64_t ptr) {
3204 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3205 assert(obj->tag == LDKNetAddress_OnionV3);
3206 int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__);
3207 memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32);
3208 return ed25519_pubkey_arr;
3210 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_checksum"))) TS_LDKNetAddress_OnionV3_get_checksum(uint64_t ptr) {
3211 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3212 assert(obj->tag == LDKNetAddress_OnionV3);
3213 int16_t checksum_conv = obj->onion_v3.checksum;
3214 return checksum_conv;
3216 int8_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_version"))) TS_LDKNetAddress_OnionV3_get_version(uint64_t ptr) {
3217 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3218 assert(obj->tag == LDKNetAddress_OnionV3);
3219 int8_t version_conv = obj->onion_v3.version;
3220 return version_conv;
3222 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_port"))) TS_LDKNetAddress_OnionV3_get_port(uint64_t ptr) {
3223 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3224 assert(obj->tag == LDKNetAddress_OnionV3);
3225 int16_t port_conv = obj->onion_v3.port;
3228 uint64_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_hostname"))) TS_LDKNetAddress_Hostname_get_hostname(uint64_t ptr) {
3229 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3230 assert(obj->tag == LDKNetAddress_Hostname);
3231 LDKHostname hostname_var = obj->hostname.hostname;
3232 uint64_t hostname_ref = 0;
3233 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3234 hostname_ref = tag_ptr(hostname_var.inner, false);
3235 return hostname_ref;
3237 int16_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_port"))) TS_LDKNetAddress_Hostname_get_port(uint64_t ptr) {
3238 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3239 assert(obj->tag == LDKNetAddress_Hostname);
3240 int16_t port_conv = obj->hostname.port;
3243 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3244 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3245 for (size_t i = 0; i < ret.datalen; i++) {
3246 ret.data[i] = NetAddress_clone(&orig->data[i]);
3250 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3251 LDKNodeAnnouncementInfo ret = *owner->contents.result;
3252 ret.is_owned = false;
3255 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint64_t owner) {
3256 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3257 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3258 uint64_t ret_ref = 0;
3259 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3260 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3264 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3265 LDKDecodeError ret = *owner->contents.err;
3266 ret.is_owned = false;
3269 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
3270 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3271 LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3272 uint64_t ret_ref = 0;
3273 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3274 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3278 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3279 LDKNodeAlias ret = *owner->contents.result;
3280 ret.is_owned = false;
3283 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok"))) TS_CResult_NodeAliasDecodeErrorZ_get_ok(uint64_t owner) {
3284 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3285 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3286 uint64_t ret_ref = 0;
3287 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3288 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3292 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3293 LDKDecodeError ret = *owner->contents.err;
3294 ret.is_owned = false;
3297 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
3298 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3299 LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
3300 uint64_t ret_ref = 0;
3301 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3302 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3306 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3307 LDKNodeInfo ret = *owner->contents.result;
3308 ret.is_owned = false;
3311 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint64_t owner) {
3312 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3313 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
3314 uint64_t ret_ref = 0;
3315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3320 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3321 LDKDecodeError ret = *owner->contents.err;
3322 ret.is_owned = false;
3325 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
3326 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3327 LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
3328 uint64_t ret_ref = 0;
3329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3334 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3335 LDKNetworkGraph ret = *owner->contents.result;
3336 ret.is_owned = false;
3339 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint64_t owner) {
3340 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3341 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
3342 uint64_t ret_ref = 0;
3343 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3344 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3348 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3349 LDKDecodeError ret = *owner->contents.err;
3350 ret.is_owned = false;
3353 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
3354 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3355 LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
3356 uint64_t ret_ref = 0;
3357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3362 uint32_t __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr"))) TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(uint64_t ptr) {
3363 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3365 case LDKCOption_CVec_NetAddressZZ_Some: return 0;
3366 case LDKCOption_CVec_NetAddressZZ_None: return 1;
3370 uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_get_some"))) TS_LDKCOption_CVec_NetAddressZZ_Some_get_some(uint64_t ptr) {
3371 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3372 assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some);
3373 LDKCVec_NetAddressZ some_var = obj->some;
3374 uint64_tArray some_arr = NULL;
3375 some_arr = init_uint64_tArray(some_var.datalen, __LINE__);
3376 uint64_t *some_arr_ptr = (uint64_t*)(((uint8_t*)some_arr) + 8);
3377 for (size_t m = 0; m < some_var.datalen; m++) {
3378 uint64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
3379 some_arr_ptr[m] = some_conv_12_ref;
3384 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3385 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
3386 ret.is_owned = false;
3389 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3390 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3391 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3392 uint64_t ret_ref = 0;
3393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3398 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3399 LDKDecodeError ret = *owner->contents.err;
3400 ret.is_owned = false;
3403 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3404 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3405 LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3406 uint64_t ret_ref = 0;
3407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3412 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3413 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
3414 ret.is_owned = false;
3417 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3418 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3419 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3420 uint64_t ret_ref = 0;
3421 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3422 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3426 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3427 LDKDecodeError ret = *owner->contents.err;
3428 ret.is_owned = false;
3431 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3432 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3433 LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3434 uint64_t ret_ref = 0;
3435 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3436 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3440 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3441 CHECK(owner->result_ok);
3442 return SpendableOutputDescriptor_clone(&*owner->contents.result);
3444 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3445 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3446 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
3447 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3448 uint64_t ret_ref = tag_ptr(ret_copy, true);
3452 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3453 LDKDecodeError ret = *owner->contents.err;
3454 ret.is_owned = false;
3457 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3458 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3459 LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3460 uint64_t ret_ref = 0;
3461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3466 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
3467 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
3468 for (size_t i = 0; i < ret.datalen; i++) {
3469 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3473 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3476 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint64_t owner) {
3477 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3478 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3479 memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64);
3483 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3486 ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint64_t owner) {
3487 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3488 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
3489 ptrArray ret_arr = NULL;
3490 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
3491 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
3492 for (size_t m = 0; m < ret_var.datalen; m++) {
3493 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
3494 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
3495 ret_arr_ptr[m] = ret_conv_12_arr;
3501 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3502 CHECK(owner->result_ok);
3503 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
3505 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint64_t owner) {
3506 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3507 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3508 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
3509 return tag_ptr(ret_conv, true);
3512 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3513 CHECK(!owner->result_ok);
3514 return *owner->contents.err;
3516 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(uint64_t owner) {
3517 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3518 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
3521 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3522 CHECK(owner->result_ok);
3523 return *owner->contents.result;
3525 int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint64_t owner) {
3526 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3527 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3528 memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64);
3532 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3533 CHECK(!owner->result_ok);
3534 return *owner->contents.err;
3536 void __attribute__((export_name("TS_CResult_SignatureNoneZ_get_err"))) TS_CResult_SignatureNoneZ_get_err(uint64_t owner) {
3537 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3538 CResult_SignatureNoneZ_get_err(owner_conv);
3541 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3544 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
3545 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3546 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3547 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
3551 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3554 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
3555 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3556 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3557 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
3561 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3562 CHECK(owner->result_ok);
3563 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
3565 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
3566 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3567 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
3568 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
3569 return tag_ptr(ret_conv, true);
3572 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3573 CHECK(!owner->result_ok);
3574 return *owner->contents.err;
3576 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
3577 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3578 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
3581 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3582 CHECK(owner->result_ok);
3583 return *owner->contents.result;
3585 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
3586 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3587 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3588 memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
3592 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3593 CHECK(!owner->result_ok);
3594 return *owner->contents.err;
3596 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
3597 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3598 CResult_SecretKeyNoneZ_get_err(owner_conv);
3601 typedef struct LDKBaseSign_JCalls {
3602 atomic_size_t refcnt;
3603 uint32_t instance_ptr;
3604 } LDKBaseSign_JCalls;
3605 static void LDKBaseSign_JCalls_free(void* this_arg) {
3606 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3607 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3611 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3612 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3613 int64_t idx_conv = idx;
3614 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
3615 LDKPublicKey ret_ref;
3616 CHECK(ret->arr_len == 33);
3617 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
3620 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3621 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3622 int64_t idx_conv = idx;
3623 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
3624 LDKThirtyTwoBytes ret_ref;
3625 CHECK(ret->arr_len == 32);
3626 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3629 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
3630 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3631 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
3632 uint64_t holder_tx_ref = 0;
3633 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
3634 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
3635 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
3636 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3637 ptrArray preimages_arr = NULL;
3638 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3639 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3640 for (size_t m = 0; m < preimages_var.datalen; m++) {
3641 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3642 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3643 preimages_arr_ptr[m] = preimages_conv_12_arr;
3646 FREE(preimages_var.data);
3647 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3648 void* ret_ptr = untag_ptr(ret);
3649 CHECK_ACCESS(ret_ptr);
3650 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3651 FREE(untag_ptr(ret));
3654 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
3655 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3656 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
3657 LDKThirtyTwoBytes ret_ref;
3658 CHECK(ret->arr_len == 32);
3659 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3662 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
3663 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3664 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
3665 uint64_t commitment_tx_ref = 0;
3666 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
3667 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3668 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3669 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3670 ptrArray preimages_arr = NULL;
3671 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3672 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3673 for (size_t m = 0; m < preimages_var.datalen; m++) {
3674 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3675 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3676 preimages_arr_ptr[m] = preimages_conv_12_arr;
3679 FREE(preimages_var.data);
3680 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3681 void* ret_ptr = untag_ptr(ret);
3682 CHECK_ACCESS(ret_ptr);
3683 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3684 FREE(untag_ptr(ret));
3687 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
3688 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3689 int64_t idx_conv = idx;
3690 int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
3691 memcpy(secret_arr->elems, *secret, 32);
3692 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
3693 void* ret_ptr = untag_ptr(ret);
3694 CHECK_ACCESS(ret_ptr);
3695 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3696 FREE(untag_ptr(ret));
3699 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
3700 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3701 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
3702 uint64_t commitment_tx_ref = 0;
3703 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
3704 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3705 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3706 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
3707 void* ret_ptr = untag_ptr(ret);
3708 CHECK_ACCESS(ret_ptr);
3709 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3710 FREE(untag_ptr(ret));
3713 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]) {
3714 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3715 LDKTransaction justice_tx_var = justice_tx;
3716 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3717 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3718 Transaction_free(justice_tx_var);
3719 uint32_t input_conv = input;
3720 int64_t amount_conv = amount;
3721 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3722 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3723 uint32_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);
3724 void* ret_ptr = untag_ptr(ret);
3725 CHECK_ACCESS(ret_ptr);
3726 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3727 FREE(untag_ptr(ret));
3730 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) {
3731 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3732 LDKTransaction justice_tx_var = justice_tx;
3733 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3734 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3735 Transaction_free(justice_tx_var);
3736 uint32_t input_conv = input;
3737 int64_t amount_conv = amount;
3738 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3739 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3740 LDKHTLCOutputInCommitment htlc_var = *htlc;
3741 uint64_t htlc_ref = 0;
3742 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3743 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3744 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3745 uint32_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);
3746 void* ret_ptr = untag_ptr(ret);
3747 CHECK_ACCESS(ret_ptr);
3748 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3749 FREE(untag_ptr(ret));
3752 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) {
3753 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3754 LDKTransaction htlc_tx_var = htlc_tx;
3755 int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
3756 memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
3757 Transaction_free(htlc_tx_var);
3758 uint32_t input_conv = input;
3759 int64_t amount_conv = amount;
3760 int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__);
3761 memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33);
3762 LDKHTLCOutputInCommitment htlc_var = *htlc;
3763 uint64_t htlc_ref = 0;
3764 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3765 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3766 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3767 uint32_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);
3768 void* ret_ptr = untag_ptr(ret);
3769 CHECK_ACCESS(ret_ptr);
3770 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3771 FREE(untag_ptr(ret));
3774 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
3775 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3776 LDKClosingTransaction closing_tx_var = *closing_tx;
3777 uint64_t closing_tx_ref = 0;
3778 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
3779 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
3780 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
3781 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
3782 void* ret_ptr = untag_ptr(ret);
3783 CHECK_ACCESS(ret_ptr);
3784 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3785 FREE(untag_ptr(ret));
3788 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
3789 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3790 LDKUnsignedChannelAnnouncement msg_var = *msg;
3791 uint64_t msg_ref = 0;
3792 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
3793 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3794 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
3795 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0);
3796 void* ret_ptr = untag_ptr(ret);
3797 CHECK_ACCESS(ret_ptr);
3798 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
3799 FREE(untag_ptr(ret));
3802 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
3803 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3804 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
3805 uint64_t channel_parameters_ref = 0;
3806 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
3807 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
3808 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
3809 js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0);
3811 static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
3812 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
3813 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3815 static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
3816 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
3817 atomic_init(&calls->refcnt, 1);
3818 calls->instance_ptr = o;
3820 LDKChannelPublicKeys pubkeys_conv;
3821 pubkeys_conv.inner = untag_ptr(pubkeys);
3822 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
3823 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
3826 .this_arg = (void*) calls,
3827 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
3828 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
3829 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
3830 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
3831 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
3832 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
3833 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
3834 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
3835 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
3836 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
3837 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
3838 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
3839 .ready_channel = ready_channel_LDKBaseSign_jcall,
3840 .free = LDKBaseSign_JCalls_free,
3841 .pubkeys = pubkeys_conv,
3842 .set_pubkeys = NULL,
3846 uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
3847 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
3848 *res_ptr = LDKBaseSign_init(o, pubkeys);
3849 return tag_ptr(res_ptr, true);
3851 int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
3852 void* this_arg_ptr = untag_ptr(this_arg);
3853 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3854 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3855 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3856 memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
3860 int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
3861 void* this_arg_ptr = untag_ptr(this_arg);
3862 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3863 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3864 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3865 memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
3869 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) {
3870 void* this_arg_ptr = untag_ptr(this_arg);
3871 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3872 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3873 LDKHolderCommitmentTransaction holder_tx_conv;
3874 holder_tx_conv.inner = untag_ptr(holder_tx);
3875 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
3876 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
3877 holder_tx_conv.is_owned = false;
3878 LDKCVec_PaymentPreimageZ preimages_constr;
3879 preimages_constr.datalen = preimages->arr_len;
3880 if (preimages_constr.datalen > 0)
3881 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3883 preimages_constr.data = NULL;
3884 int8_tArray* preimages_vals = (void*) preimages->elems;
3885 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3886 int8_tArray preimages_conv_12 = preimages_vals[m];
3887 LDKThirtyTwoBytes preimages_conv_12_ref;
3888 CHECK(preimages_conv_12->arr_len == 32);
3889 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3890 preimages_constr.data[m] = preimages_conv_12_ref;
3893 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3894 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
3895 return tag_ptr(ret_conv, true);
3898 int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
3899 void* this_arg_ptr = untag_ptr(this_arg);
3900 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3901 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3902 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3903 memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
3907 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) {
3908 void* this_arg_ptr = untag_ptr(this_arg);
3909 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3910 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3911 LDKCommitmentTransaction commitment_tx_conv;
3912 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3913 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3914 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3915 commitment_tx_conv.is_owned = false;
3916 LDKCVec_PaymentPreimageZ preimages_constr;
3917 preimages_constr.datalen = preimages->arr_len;
3918 if (preimages_constr.datalen > 0)
3919 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3921 preimages_constr.data = NULL;
3922 int8_tArray* preimages_vals = (void*) preimages->elems;
3923 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3924 int8_tArray preimages_conv_12 = preimages_vals[m];
3925 LDKThirtyTwoBytes preimages_conv_12_ref;
3926 CHECK(preimages_conv_12->arr_len == 32);
3927 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3928 preimages_constr.data[m] = preimages_conv_12_ref;
3931 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3932 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
3933 return tag_ptr(ret_conv, true);
3936 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) {
3937 void* this_arg_ptr = untag_ptr(this_arg);
3938 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3939 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3940 unsigned char secret_arr[32];
3941 CHECK(secret->arr_len == 32);
3942 memcpy(secret_arr, secret->elems, 32); FREE(secret);
3943 unsigned char (*secret_ref)[32] = &secret_arr;
3944 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3945 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
3946 return tag_ptr(ret_conv, true);
3949 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) {
3950 void* this_arg_ptr = untag_ptr(this_arg);
3951 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3952 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3953 LDKHolderCommitmentTransaction commitment_tx_conv;
3954 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3955 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3956 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3957 commitment_tx_conv.is_owned = false;
3958 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3959 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
3960 return tag_ptr(ret_conv, true);
3963 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) {
3964 void* this_arg_ptr = untag_ptr(this_arg);
3965 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3966 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3967 LDKTransaction justice_tx_ref;
3968 justice_tx_ref.datalen = justice_tx->arr_len;
3969 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3970 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3971 justice_tx_ref.data_is_owned = true;
3972 unsigned char per_commitment_key_arr[32];
3973 CHECK(per_commitment_key->arr_len == 32);
3974 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3975 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3976 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3977 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
3978 return tag_ptr(ret_conv, true);
3981 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) {
3982 void* this_arg_ptr = untag_ptr(this_arg);
3983 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3984 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3985 LDKTransaction justice_tx_ref;
3986 justice_tx_ref.datalen = justice_tx->arr_len;
3987 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3988 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3989 justice_tx_ref.data_is_owned = true;
3990 unsigned char per_commitment_key_arr[32];
3991 CHECK(per_commitment_key->arr_len == 32);
3992 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3993 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3994 LDKHTLCOutputInCommitment htlc_conv;
3995 htlc_conv.inner = untag_ptr(htlc);
3996 htlc_conv.is_owned = ptr_is_owned(htlc);
3997 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
3998 htlc_conv.is_owned = false;
3999 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4000 *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);
4001 return tag_ptr(ret_conv, true);
4004 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) {
4005 void* this_arg_ptr = untag_ptr(this_arg);
4006 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4007 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4008 LDKTransaction htlc_tx_ref;
4009 htlc_tx_ref.datalen = htlc_tx->arr_len;
4010 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
4011 memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx);
4012 htlc_tx_ref.data_is_owned = true;
4013 LDKPublicKey per_commitment_point_ref;
4014 CHECK(per_commitment_point->arr_len == 33);
4015 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
4016 LDKHTLCOutputInCommitment htlc_conv;
4017 htlc_conv.inner = untag_ptr(htlc);
4018 htlc_conv.is_owned = ptr_is_owned(htlc);
4019 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4020 htlc_conv.is_owned = false;
4021 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4022 *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);
4023 return tag_ptr(ret_conv, true);
4026 uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
4027 void* this_arg_ptr = untag_ptr(this_arg);
4028 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4029 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4030 LDKClosingTransaction closing_tx_conv;
4031 closing_tx_conv.inner = untag_ptr(closing_tx);
4032 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
4033 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
4034 closing_tx_conv.is_owned = false;
4035 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4036 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
4037 return tag_ptr(ret_conv, true);
4040 uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
4041 void* this_arg_ptr = untag_ptr(this_arg);
4042 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4043 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4044 LDKUnsignedChannelAnnouncement msg_conv;
4045 msg_conv.inner = untag_ptr(msg);
4046 msg_conv.is_owned = ptr_is_owned(msg);
4047 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
4048 msg_conv.is_owned = false;
4049 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
4050 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
4051 return tag_ptr(ret_conv, true);
4054 void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
4055 void* this_arg_ptr = untag_ptr(this_arg);
4056 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4057 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4058 LDKChannelTransactionParameters channel_parameters_conv;
4059 channel_parameters_conv.inner = untag_ptr(channel_parameters);
4060 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
4061 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
4062 channel_parameters_conv.is_owned = false;
4063 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
4066 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
4067 if (this_arg->set_pubkeys != NULL)
4068 this_arg->set_pubkeys(this_arg);
4069 return this_arg->pubkeys;
4071 uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
4072 void* this_arg_ptr = untag_ptr(this_arg);
4073 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4074 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4075 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
4076 uint64_t ret_ref = 0;
4077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4078 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4082 typedef struct LDKSign_JCalls {
4083 atomic_size_t refcnt;
4084 uint32_t instance_ptr;
4085 LDKBaseSign_JCalls* BaseSign;
4087 static void LDKSign_JCalls_free(void* this_arg) {
4088 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4089 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4093 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
4094 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4095 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0);
4096 LDKCVec_u8Z ret_ref;
4097 ret_ref.datalen = ret->arr_len;
4098 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4099 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4102 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
4103 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
4104 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4105 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
4107 static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4108 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
4109 atomic_init(&calls->refcnt, 1);
4110 calls->instance_ptr = o;
4112 LDKChannelPublicKeys pubkeys_conv;
4113 pubkeys_conv.inner = untag_ptr(pubkeys);
4114 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4115 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4118 .this_arg = (void*) calls,
4119 .write = write_LDKSign_jcall,
4120 .cloned = LDKSign_JCalls_cloned,
4121 .free = LDKSign_JCalls_free,
4122 .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
4124 calls->BaseSign = ret.BaseSign.this_arg;
4127 uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4128 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
4129 *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
4130 return tag_ptr(res_ptr, true);
4132 int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
4133 void* this_arg_ptr = untag_ptr(this_arg);
4134 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4135 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
4136 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
4137 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4138 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4139 CVec_u8Z_free(ret_var);
4143 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4144 CHECK(owner->result_ok);
4145 return Sign_clone(&*owner->contents.result);
4147 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
4148 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4149 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
4150 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
4151 return tag_ptr(ret_ret, true);
4154 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4155 LDKDecodeError ret = *owner->contents.err;
4156 ret.is_owned = false;
4159 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
4160 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4161 LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
4162 uint64_t ret_ref = 0;
4163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4168 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4169 CHECK(owner->result_ok);
4170 return *owner->contents.result;
4172 int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
4173 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4174 int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
4175 memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
4179 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4180 CHECK(!owner->result_ok);
4181 return *owner->contents.err;
4183 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
4184 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4185 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
4188 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
4189 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
4190 for (size_t i = 0; i < ret.datalen; i++) {
4191 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
4195 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4196 CHECK(owner->result_ok);
4197 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
4199 ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok(uint64_t owner) {
4200 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4201 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
4202 ptrArray ret_arr = NULL;
4203 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
4204 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
4205 for (size_t m = 0; m < ret_var.datalen; m++) {
4206 LDKCVec_u8Z ret_conv_12_var = ret_var.data[m];
4207 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
4208 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
4209 CVec_u8Z_free(ret_conv_12_var);
4210 ret_arr_ptr[m] = ret_conv_12_arr;
4217 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4218 CHECK(!owner->result_ok);
4219 return *owner->contents.err;
4221 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_err(uint64_t owner) {
4222 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4223 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
4226 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4227 LDKInMemorySigner ret = *owner->contents.result;
4228 ret.is_owned = false;
4231 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint64_t owner) {
4232 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4233 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
4234 uint64_t ret_ref = 0;
4235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4240 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4241 LDKDecodeError ret = *owner->contents.err;
4242 ret.is_owned = false;
4245 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
4246 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4247 LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
4248 uint64_t ret_ref = 0;
4249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4254 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
4255 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
4256 for (size_t i = 0; i < ret.datalen; i++) {
4257 ret.data[i] = TxOut_clone(&orig->data[i]);
4261 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4262 CHECK(owner->result_ok);
4263 return *owner->contents.result;
4265 int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) {
4266 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4267 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
4268 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4269 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4273 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4274 CHECK(!owner->result_ok);
4275 return *owner->contents.err;
4277 void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) {
4278 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4279 CResult_TransactionNoneZ_get_err(owner_conv);
4282 uint32_t __attribute__((export_name("TS_LDKCOption_u16Z_ty_from_ptr"))) TS_LDKCOption_u16Z_ty_from_ptr(uint64_t ptr) {
4283 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4285 case LDKCOption_u16Z_Some: return 0;
4286 case LDKCOption_u16Z_None: return 1;
4290 int16_t __attribute__((export_name("TS_LDKCOption_u16Z_Some_get_some"))) TS_LDKCOption_u16Z_Some_get_some(uint64_t ptr) {
4291 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4292 assert(obj->tag == LDKCOption_u16Z_Some);
4293 int16_t some_conv = obj->some;
4296 uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
4297 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4299 case LDKAPIError_APIMisuseError: return 0;
4300 case LDKAPIError_FeeRateTooHigh: return 1;
4301 case LDKAPIError_RouteError: return 2;
4302 case LDKAPIError_ChannelUnavailable: return 3;
4303 case LDKAPIError_MonitorUpdateFailed: return 4;
4304 case LDKAPIError_IncompatibleShutdownScript: return 5;
4308 jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
4309 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4310 assert(obj->tag == LDKAPIError_APIMisuseError);
4311 LDKStr err_str = obj->api_misuse_error.err;
4312 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4315 jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
4316 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4317 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4318 LDKStr err_str = obj->fee_rate_too_high.err;
4319 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4322 int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
4323 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4324 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4325 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
4326 return feerate_conv;
4328 jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
4329 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4330 assert(obj->tag == LDKAPIError_RouteError);
4331 LDKStr err_str = obj->route_error.err;
4332 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4335 jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
4336 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4337 assert(obj->tag == LDKAPIError_ChannelUnavailable);
4338 LDKStr err_str = obj->channel_unavailable.err;
4339 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4342 uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
4343 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4344 assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
4345 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
4346 uint64_t script_ref = 0;
4347 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
4348 script_ref = tag_ptr(script_var.inner, false);
4351 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4352 CHECK(owner->result_ok);
4353 return *owner->contents.result;
4355 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
4356 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4357 CResult_NoneAPIErrorZ_get_ok(owner_conv);
4360 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4361 CHECK(!owner->result_ok);
4362 return APIError_clone(&*owner->contents.err);
4364 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
4365 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4366 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4367 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
4368 uint64_t ret_ref = tag_ptr(ret_copy, true);
4372 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
4373 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
4374 for (size_t i = 0; i < ret.datalen; i++) {
4375 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
4379 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
4380 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
4381 for (size_t i = 0; i < ret.datalen; i++) {
4382 ret.data[i] = APIError_clone(&orig->data[i]);
4386 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4387 CHECK(owner->result_ok);
4388 return ThirtyTwoBytes_clone(&*owner->contents.result);
4390 int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint64_t owner) {
4391 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4392 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4393 memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32);
4397 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4398 CHECK(!owner->result_ok);
4399 return APIError_clone(&*owner->contents.err);
4401 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_CResult__u832APIErrorZ_get_err(uint64_t owner) {
4402 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4403 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4404 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
4405 uint64_t ret_ref = tag_ptr(ret_copy, true);
4409 uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
4410 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4412 case LDKPaymentSendFailure_ParameterError: return 0;
4413 case LDKPaymentSendFailure_PathParameterError: return 1;
4414 case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
4415 case LDKPaymentSendFailure_PartialFailure: return 3;
4419 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint64_t ptr) {
4420 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4421 assert(obj->tag == LDKPaymentSendFailure_ParameterError);
4422 uint64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
4423 return parameter_error_ref;
4425 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint64_t ptr) {
4426 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4427 assert(obj->tag == LDKPaymentSendFailure_PathParameterError);
4428 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
4429 uint64_tArray path_parameter_error_arr = NULL;
4430 path_parameter_error_arr = init_uint64_tArray(path_parameter_error_var.datalen, __LINE__);
4431 uint64_t *path_parameter_error_arr_ptr = (uint64_t*)(((uint8_t*)path_parameter_error_arr) + 8);
4432 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
4433 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4434 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
4435 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
4436 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
4439 return path_parameter_error_arr;
4441 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
4442 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4443 assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
4444 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
4445 uint64_tArray all_failed_retry_safe_arr = NULL;
4446 all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
4447 uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
4448 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
4449 uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
4450 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
4453 return all_failed_retry_safe_arr;
4455 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
4456 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4457 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4458 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
4459 uint64_tArray results_arr = NULL;
4460 results_arr = init_uint64_tArray(results_var.datalen, __LINE__);
4461 uint64_t *results_arr_ptr = (uint64_t*)(((uint8_t*)results_arr) + 8);
4462 for (size_t w = 0; w < results_var.datalen; w++) {
4463 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4464 *results_conv_22_conv = results_var.data[w];
4465 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
4466 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
4471 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry"))) TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(uint64_t ptr) {
4472 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4473 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4474 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
4475 uint64_t failed_paths_retry_ref = 0;
4476 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
4477 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
4478 return failed_paths_retry_ref;
4480 int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint64_t ptr) {
4481 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4482 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4483 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
4484 memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
4485 return payment_id_arr;
4487 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4488 CHECK(owner->result_ok);
4489 return ThirtyTwoBytes_clone(&*owner->contents.result);
4491 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
4492 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4493 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4494 memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
4498 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4499 CHECK(!owner->result_ok);
4500 return PaymentSendFailure_clone(&*owner->contents.err);
4502 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
4503 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4504 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4505 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
4506 uint64_t ret_ref = tag_ptr(ret_copy, true);
4510 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4511 CHECK(owner->result_ok);
4512 return *owner->contents.result;
4514 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
4515 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4516 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
4519 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4520 CHECK(!owner->result_ok);
4521 return PaymentSendFailure_clone(&*owner->contents.err);
4523 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
4524 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4525 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4526 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
4527 uint64_t ret_ref = tag_ptr(ret_copy, true);
4531 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4532 return ThirtyTwoBytes_clone(&owner->a);
4534 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint64_t owner) {
4535 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4536 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4537 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32);
4541 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4542 return ThirtyTwoBytes_clone(&owner->b);
4544 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint64_t owner) {
4545 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4546 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4547 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32);
4551 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4552 CHECK(owner->result_ok);
4553 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
4555 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint64_t owner) {
4556 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4557 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
4558 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
4559 return tag_ptr(ret_conv, true);
4562 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4563 CHECK(!owner->result_ok);
4564 return PaymentSendFailure_clone(&*owner->contents.err);
4566 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(uint64_t owner) {
4567 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4568 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4569 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
4570 uint64_t ret_ref = tag_ptr(ret_copy, true);
4574 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
4575 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
4576 for (size_t i = 0; i < ret.datalen; i++) {
4577 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4581 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4582 return ThirtyTwoBytes_clone(&owner->a);
4584 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint64_t owner) {
4585 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4586 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4587 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32);
4591 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4592 return ThirtyTwoBytes_clone(&owner->b);
4594 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint64_t owner) {
4595 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4596 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4597 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32);
4601 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4602 CHECK(owner->result_ok);
4603 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4605 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint64_t owner) {
4606 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4607 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4608 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
4609 return tag_ptr(ret_conv, true);
4612 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4613 CHECK(!owner->result_ok);
4614 return *owner->contents.err;
4616 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint64_t owner) {
4617 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4618 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
4621 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4622 CHECK(owner->result_ok);
4623 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4625 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint64_t owner) {
4626 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4627 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4628 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
4629 return tag_ptr(ret_conv, true);
4632 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4633 CHECK(!owner->result_ok);
4634 return APIError_clone(&*owner->contents.err);
4636 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint64_t owner) {
4637 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4638 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4639 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
4640 uint64_t ret_ref = tag_ptr(ret_copy, true);
4644 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4645 CHECK(owner->result_ok);
4646 return ThirtyTwoBytes_clone(&*owner->contents.result);
4648 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint64_t owner) {
4649 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4650 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4651 memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32);
4655 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4656 CHECK(!owner->result_ok);
4657 return *owner->contents.err;
4659 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_err"))) TS_CResult_PaymentSecretNoneZ_get_err(uint64_t owner) {
4660 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4661 CResult_PaymentSecretNoneZ_get_err(owner_conv);
4664 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4665 CHECK(owner->result_ok);
4666 return ThirtyTwoBytes_clone(&*owner->contents.result);
4668 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint64_t owner) {
4669 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4670 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4671 memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32);
4675 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4676 CHECK(!owner->result_ok);
4677 return APIError_clone(&*owner->contents.err);
4679 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err"))) TS_CResult_PaymentSecretAPIErrorZ_get_err(uint64_t owner) {
4680 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4681 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4682 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
4683 uint64_t ret_ref = tag_ptr(ret_copy, true);
4687 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4688 CHECK(owner->result_ok);
4689 return ThirtyTwoBytes_clone(&*owner->contents.result);
4691 int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint64_t owner) {
4692 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4693 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4694 memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32);
4698 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4699 CHECK(!owner->result_ok);
4700 return APIError_clone(&*owner->contents.err);
4702 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_err"))) TS_CResult_PaymentPreimageAPIErrorZ_get_err(uint64_t owner) {
4703 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4704 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4705 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
4706 uint64_t ret_ref = tag_ptr(ret_copy, true);
4710 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4711 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
4712 ret.is_owned = false;
4715 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) {
4716 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4717 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
4718 uint64_t ret_ref = 0;
4719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4724 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4725 LDKDecodeError ret = *owner->contents.err;
4726 ret.is_owned = false;
4729 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
4730 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4731 LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
4732 uint64_t ret_ref = 0;
4733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4738 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4739 LDKChannelCounterparty ret = *owner->contents.result;
4740 ret.is_owned = false;
4743 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) {
4744 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4745 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
4746 uint64_t ret_ref = 0;
4747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4752 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4753 LDKDecodeError ret = *owner->contents.err;
4754 ret.is_owned = false;
4757 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
4758 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4759 LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
4760 uint64_t ret_ref = 0;
4761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4766 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4767 LDKChannelDetails ret = *owner->contents.result;
4768 ret.is_owned = false;
4771 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) {
4772 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4773 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
4774 uint64_t ret_ref = 0;
4775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4780 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4781 LDKDecodeError ret = *owner->contents.err;
4782 ret.is_owned = false;
4785 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
4786 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4787 LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
4788 uint64_t ret_ref = 0;
4789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4794 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4795 LDKPhantomRouteHints ret = *owner->contents.result;
4796 ret.is_owned = false;
4799 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(uint64_t owner) {
4800 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4801 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
4802 uint64_t ret_ref = 0;
4803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4808 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4809 LDKDecodeError ret = *owner->contents.err;
4810 ret.is_owned = false;
4813 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
4814 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4815 LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
4816 uint64_t ret_ref = 0;
4817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4822 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
4823 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
4824 for (size_t i = 0; i < ret.datalen; i++) {
4825 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
4829 typedef struct LDKWatch_JCalls {
4830 atomic_size_t refcnt;
4831 uint32_t instance_ptr;
4833 static void LDKWatch_JCalls_free(void* this_arg) {
4834 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4835 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4839 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
4840 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4841 LDKOutPoint funding_txo_var = funding_txo;
4842 uint64_t funding_txo_ref = 0;
4843 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4844 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4845 LDKChannelMonitor monitor_var = monitor;
4846 uint64_t monitor_ref = 0;
4847 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
4848 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
4849 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
4850 void* ret_ptr = untag_ptr(ret);
4851 CHECK_ACCESS(ret_ptr);
4852 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4853 FREE(untag_ptr(ret));
4856 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
4857 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4858 LDKOutPoint funding_txo_var = funding_txo;
4859 uint64_t funding_txo_ref = 0;
4860 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4861 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4862 LDKChannelMonitorUpdate update_var = update;
4863 uint64_t update_ref = 0;
4864 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
4865 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
4866 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0);
4867 void* ret_ptr = untag_ptr(ret);
4868 CHECK_ACCESS(ret_ptr);
4869 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4870 FREE(untag_ptr(ret));
4873 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
4874 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4875 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0);
4876 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
4877 ret_constr.datalen = ret->arr_len;
4878 if (ret_constr.datalen > 0)
4879 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
4881 ret_constr.data = NULL;
4882 uint64_t* ret_vals = ret->elems;
4883 for (size_t x = 0; x < ret_constr.datalen; x++) {
4884 uint64_t ret_conv_49 = ret_vals[x];
4885 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
4886 CHECK_ACCESS(ret_conv_49_ptr);
4887 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
4888 FREE(untag_ptr(ret_conv_49));
4889 ret_constr.data[x] = ret_conv_49_conv;
4894 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
4895 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
4896 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4898 static inline LDKWatch LDKWatch_init (JSValue o) {
4899 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
4900 atomic_init(&calls->refcnt, 1);
4901 calls->instance_ptr = o;
4904 .this_arg = (void*) calls,
4905 .watch_channel = watch_channel_LDKWatch_jcall,
4906 .update_channel = update_channel_LDKWatch_jcall,
4907 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
4908 .free = LDKWatch_JCalls_free,
4912 uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) {
4913 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
4914 *res_ptr = LDKWatch_init(o);
4915 return tag_ptr(res_ptr, true);
4917 uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
4918 void* this_arg_ptr = untag_ptr(this_arg);
4919 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4920 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4921 LDKOutPoint funding_txo_conv;
4922 funding_txo_conv.inner = untag_ptr(funding_txo);
4923 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4924 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4925 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4926 LDKChannelMonitor monitor_conv;
4927 monitor_conv.inner = untag_ptr(monitor);
4928 monitor_conv.is_owned = ptr_is_owned(monitor);
4929 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
4930 monitor_conv = ChannelMonitor_clone(&monitor_conv);
4931 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4932 *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
4933 return tag_ptr(ret_conv, true);
4936 uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
4937 void* this_arg_ptr = untag_ptr(this_arg);
4938 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4939 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4940 LDKOutPoint funding_txo_conv;
4941 funding_txo_conv.inner = untag_ptr(funding_txo);
4942 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4943 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4944 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4945 LDKChannelMonitorUpdate update_conv;
4946 update_conv.inner = untag_ptr(update);
4947 update_conv.is_owned = ptr_is_owned(update);
4948 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
4949 update_conv = ChannelMonitorUpdate_clone(&update_conv);
4950 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4951 *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
4952 return tag_ptr(ret_conv, true);
4955 uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
4956 void* this_arg_ptr = untag_ptr(this_arg);
4957 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4958 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4959 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
4960 uint64_tArray ret_arr = NULL;
4961 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
4962 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
4963 for (size_t x = 0; x < ret_var.datalen; x++) {
4964 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
4965 *ret_conv_49_conv = ret_var.data[x];
4966 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
4973 typedef struct LDKBroadcasterInterface_JCalls {
4974 atomic_size_t refcnt;
4975 uint32_t instance_ptr;
4976 } LDKBroadcasterInterface_JCalls;
4977 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
4978 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4979 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4983 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
4984 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4985 LDKTransaction tx_var = tx;
4986 int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
4987 memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
4988 Transaction_free(tx_var);
4989 js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
4991 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
4992 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
4993 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4995 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JSValue o) {
4996 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
4997 atomic_init(&calls->refcnt, 1);
4998 calls->instance_ptr = o;
5000 LDKBroadcasterInterface ret = {
5001 .this_arg = (void*) calls,
5002 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
5003 .free = LDKBroadcasterInterface_JCalls_free,
5007 uint64_t __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroadcasterInterface_new(JSValue o) {
5008 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
5009 *res_ptr = LDKBroadcasterInterface_init(o);
5010 return tag_ptr(res_ptr, true);
5012 void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint64_t this_arg, int8_tArray tx) {
5013 void* this_arg_ptr = untag_ptr(this_arg);
5014 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5015 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
5016 LDKTransaction tx_ref;
5017 tx_ref.datalen = tx->arr_len;
5018 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
5019 memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx);
5020 tx_ref.data_is_owned = true;
5021 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
5024 typedef struct LDKKeysInterface_JCalls {
5025 atomic_size_t refcnt;
5026 uint32_t instance_ptr;
5027 } LDKKeysInterface_JCalls;
5028 static void LDKKeysInterface_JCalls_free(void* this_arg) {
5029 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5030 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5034 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
5035 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5036 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5037 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0);
5038 void* ret_ptr = untag_ptr(ret);
5039 CHECK_ACCESS(ret_ptr);
5040 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
5041 FREE(untag_ptr(ret));
5044 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
5045 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5046 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, 0, 0, 0, 0, 0, 0);
5047 LDKCVec_u8Z ret_ref;
5048 ret_ref.datalen = ret->arr_len;
5049 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5050 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5053 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
5054 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5055 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
5056 LDKShutdownScript ret_conv;
5057 ret_conv.inner = untag_ptr(ret);
5058 ret_conv.is_owned = ptr_is_owned(ret);
5059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
5062 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
5063 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5064 jboolean inbound_conv = inbound;
5065 int64_t channel_value_satoshis_conv = channel_value_satoshis;
5066 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 23, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
5067 void* ret_ptr = untag_ptr(ret);
5068 CHECK_ACCESS(ret_ptr);
5069 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
5070 FREE(untag_ptr(ret));
5073 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
5074 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5075 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0);
5076 LDKThirtyTwoBytes ret_ref;
5077 CHECK(ret->arr_len == 32);
5078 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5081 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
5082 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5083 LDKu8slice reader_var = reader;
5084 int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
5085 memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
5086 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
5087 void* ret_ptr = untag_ptr(ret);
5088 CHECK_ACCESS(ret_ptr);
5089 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
5090 FREE(untag_ptr(ret));
5093 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
5094 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5095 LDKu8slice hrp_bytes_var = hrp_bytes;
5096 int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
5097 memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
5098 LDKCVec_u5Z invoice_data_var = invoice_data;
5099 ptrArray invoice_data_arr = NULL;
5100 invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
5101 int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
5102 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
5103 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
5104 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
5107 FREE(invoice_data_var.data);
5108 uint32_t receipient_conv = LDKRecipient_to_js(receipient);
5109 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0);
5110 void* ret_ptr = untag_ptr(ret);
5111 CHECK_ACCESS(ret_ptr);
5112 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
5113 FREE(untag_ptr(ret));
5116 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
5117 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5118 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0);
5119 LDKThirtyTwoBytes ret_ref;
5120 CHECK(ret->arr_len == 32);
5121 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5124 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
5125 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
5126 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5128 static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
5129 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
5130 atomic_init(&calls->refcnt, 1);
5131 calls->instance_ptr = o;
5133 LDKKeysInterface ret = {
5134 .this_arg = (void*) calls,
5135 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
5136 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
5137 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
5138 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
5139 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
5140 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
5141 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
5142 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
5143 .free = LDKKeysInterface_JCalls_free,
5147 uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
5148 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5149 *res_ptr = LDKKeysInterface_init(o);
5150 return tag_ptr(res_ptr, true);
5152 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
5153 void* this_arg_ptr = untag_ptr(this_arg);
5154 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5155 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5156 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5157 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
5158 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
5159 return tag_ptr(ret_conv, true);
5162 int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
5163 void* this_arg_ptr = untag_ptr(this_arg);
5164 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5165 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5166 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
5167 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5168 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5169 CVec_u8Z_free(ret_var);
5173 uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
5174 void* this_arg_ptr = untag_ptr(this_arg);
5175 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5176 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5177 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
5178 uint64_t ret_ref = 0;
5179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5184 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) {
5185 void* this_arg_ptr = untag_ptr(this_arg);
5186 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5187 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5188 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5189 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
5190 return tag_ptr(ret_ret, true);
5193 int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
5194 void* this_arg_ptr = untag_ptr(this_arg);
5195 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5196 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5197 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5198 memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
5202 uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
5203 void* this_arg_ptr = untag_ptr(this_arg);
5204 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5205 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5206 LDKu8slice reader_ref;
5207 reader_ref.datalen = reader->arr_len;
5208 reader_ref.data = reader->elems;
5209 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
5210 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
5212 return tag_ptr(ret_conv, true);
5215 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) {
5216 void* this_arg_ptr = untag_ptr(this_arg);
5217 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5218 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5219 LDKu8slice hrp_bytes_ref;
5220 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
5221 hrp_bytes_ref.data = hrp_bytes->elems;
5222 LDKCVec_u5Z invoice_data_constr;
5223 invoice_data_constr.datalen = invoice_data->arr_len;
5224 if (invoice_data_constr.datalen > 0)
5225 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
5227 invoice_data_constr.data = NULL;
5228 int8_t* invoice_data_vals = (void*) invoice_data->elems;
5229 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
5230 int8_t invoice_data_conv_7 = invoice_data_vals[h];
5232 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
5235 LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
5236 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
5237 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
5239 return tag_ptr(ret_conv, true);
5242 int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
5243 void* this_arg_ptr = untag_ptr(this_arg);
5244 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5245 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5246 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5247 memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
5251 typedef struct LDKFeeEstimator_JCalls {
5252 atomic_size_t refcnt;
5253 uint32_t instance_ptr;
5254 } LDKFeeEstimator_JCalls;
5255 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
5256 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5257 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5261 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
5262 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5263 uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
5264 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, confirmation_target_conv, 0, 0, 0, 0, 0);
5266 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
5267 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
5268 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5270 static inline LDKFeeEstimator LDKFeeEstimator_init (JSValue o) {
5271 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
5272 atomic_init(&calls->refcnt, 1);
5273 calls->instance_ptr = o;
5275 LDKFeeEstimator ret = {
5276 .this_arg = (void*) calls,
5277 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
5278 .free = LDKFeeEstimator_JCalls_free,
5282 uint64_t __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_new(JSValue o) {
5283 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
5284 *res_ptr = LDKFeeEstimator_init(o);
5285 return tag_ptr(res_ptr, true);
5287 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) {
5288 void* this_arg_ptr = untag_ptr(this_arg);
5289 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5290 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
5291 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
5292 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
5296 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5297 return ThirtyTwoBytes_clone(&owner->a);
5299 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint64_t owner) {
5300 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5301 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5302 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32);
5306 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5307 LDKChannelManager ret = owner->b;
5308 ret.is_owned = false;
5311 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint64_t owner) {
5312 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5313 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
5314 uint64_t ret_ref = 0;
5315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5320 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5321 CHECK(owner->result_ok);
5322 return &*owner->contents.result;
5324 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint64_t owner) {
5325 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5326 uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
5330 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5331 LDKDecodeError ret = *owner->contents.err;
5332 ret.is_owned = false;
5335 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
5336 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5337 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
5338 uint64_t ret_ref = 0;
5339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5344 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5345 LDKChannelConfig ret = *owner->contents.result;
5346 ret.is_owned = false;
5349 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint64_t owner) {
5350 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5351 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
5352 uint64_t ret_ref = 0;
5353 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5354 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5358 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5359 LDKDecodeError ret = *owner->contents.err;
5360 ret.is_owned = false;
5363 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
5364 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5365 LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
5366 uint64_t ret_ref = 0;
5367 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5368 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5372 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5373 LDKOutPoint ret = *owner->contents.result;
5374 ret.is_owned = false;
5377 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint64_t owner) {
5378 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5379 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
5380 uint64_t ret_ref = 0;
5381 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5382 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5386 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5387 LDKDecodeError ret = *owner->contents.err;
5388 ret.is_owned = false;
5391 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
5392 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5393 LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
5394 uint64_t ret_ref = 0;
5395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5400 typedef struct LDKType_JCalls {
5401 atomic_size_t refcnt;
5402 uint32_t instance_ptr;
5404 static void LDKType_JCalls_free(void* this_arg) {
5405 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5406 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5410 uint16_t type_id_LDKType_jcall(const void* this_arg) {
5411 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5412 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, 0, 0, 0, 0, 0, 0);
5414 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
5415 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5416 jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
5417 LDKStr ret_conv = str_ref_to_owned_c(ret);
5420 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
5421 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5422 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
5423 LDKCVec_u8Z ret_ref;
5424 ret_ref.datalen = ret->arr_len;
5425 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5426 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5429 static void LDKType_JCalls_cloned(LDKType* new_obj) {
5430 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
5431 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5433 static inline LDKType LDKType_init (JSValue o) {
5434 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
5435 atomic_init(&calls->refcnt, 1);
5436 calls->instance_ptr = o;
5439 .this_arg = (void*) calls,
5440 .type_id = type_id_LDKType_jcall,
5441 .debug_str = debug_str_LDKType_jcall,
5442 .write = write_LDKType_jcall,
5443 .cloned = LDKType_JCalls_cloned,
5444 .free = LDKType_JCalls_free,
5448 uint64_t __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) {
5449 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
5450 *res_ptr = LDKType_init(o);
5451 return tag_ptr(res_ptr, true);
5453 int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint64_t this_arg) {
5454 void* this_arg_ptr = untag_ptr(this_arg);
5455 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5456 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5457 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
5461 jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint64_t this_arg) {
5462 void* this_arg_ptr = untag_ptr(this_arg);
5463 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5464 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5465 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
5466 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5471 int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint64_t this_arg) {
5472 void* this_arg_ptr = untag_ptr(this_arg);
5473 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5474 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5475 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5476 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5477 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5478 CVec_u8Z_free(ret_var);
5482 uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_ty_from_ptr"))) TS_LDKCOption_TypeZ_ty_from_ptr(uint64_t ptr) {
5483 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5485 case LDKCOption_TypeZ_Some: return 0;
5486 case LDKCOption_TypeZ_None: return 1;
5490 uint64_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LDKCOption_TypeZ_Some_get_some(uint64_t ptr) {
5491 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5492 assert(obj->tag == LDKCOption_TypeZ_Some);
5493 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
5494 *some_ret = Type_clone(&obj->some);
5495 return tag_ptr(some_ret, true);
5497 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5498 CHECK(owner->result_ok);
5499 return COption_TypeZ_clone(&*owner->contents.result);
5501 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_get_ok(uint64_t owner) {
5502 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5503 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
5504 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
5505 uint64_t ret_ref = tag_ptr(ret_copy, true);
5509 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5510 LDKDecodeError ret = *owner->contents.err;
5511 ret.is_owned = false;
5514 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
5515 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5516 LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
5517 uint64_t ret_ref = 0;
5518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5523 uint32_t __attribute__((export_name("TS_LDKPaymentError_ty_from_ptr"))) TS_LDKPaymentError_ty_from_ptr(uint64_t ptr) {
5524 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5526 case LDKPaymentError_Invoice: return 0;
5527 case LDKPaymentError_Routing: return 1;
5528 case LDKPaymentError_Sending: return 2;
5532 jstring __attribute__((export_name("TS_LDKPaymentError_Invoice_get_invoice"))) TS_LDKPaymentError_Invoice_get_invoice(uint64_t ptr) {
5533 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5534 assert(obj->tag == LDKPaymentError_Invoice);
5535 LDKStr invoice_str = obj->invoice;
5536 jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
5537 return invoice_conv;
5539 uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
5540 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5541 assert(obj->tag == LDKPaymentError_Routing);
5542 LDKLightningError routing_var = obj->routing;
5543 uint64_t routing_ref = 0;
5544 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
5545 routing_ref = tag_ptr(routing_var.inner, false);
5548 uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
5549 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5550 assert(obj->tag == LDKPaymentError_Sending);
5551 uint64_t sending_ref = tag_ptr(&obj->sending, false);
5554 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5555 CHECK(owner->result_ok);
5556 return ThirtyTwoBytes_clone(&*owner->contents.result);
5558 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_ok"))) TS_CResult_PaymentIdPaymentErrorZ_get_ok(uint64_t owner) {
5559 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5560 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5561 memcpy(ret_arr->elems, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data, 32);
5565 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5566 CHECK(!owner->result_ok);
5567 return PaymentError_clone(&*owner->contents.err);
5569 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_err"))) TS_CResult_PaymentIdPaymentErrorZ_get_err(uint64_t owner) {
5570 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5571 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
5572 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
5573 uint64_t ret_ref = tag_ptr(ret_copy, true);
5577 uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
5578 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5580 case LDKParseError_Bech32Error: return 0;
5581 case LDKParseError_ParseAmountError: return 1;
5582 case LDKParseError_MalformedSignature: return 2;
5583 case LDKParseError_BadPrefix: return 3;
5584 case LDKParseError_UnknownCurrency: return 4;
5585 case LDKParseError_UnknownSiPrefix: return 5;
5586 case LDKParseError_MalformedHRP: return 6;
5587 case LDKParseError_TooShortDataPart: return 7;
5588 case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
5589 case LDKParseError_DescriptionDecodeError: return 9;
5590 case LDKParseError_PaddingError: return 10;
5591 case LDKParseError_IntegerOverflowError: return 11;
5592 case LDKParseError_InvalidSegWitProgramLength: return 12;
5593 case LDKParseError_InvalidPubKeyHashLength: return 13;
5594 case LDKParseError_InvalidScriptHashLength: return 14;
5595 case LDKParseError_InvalidRecoveryId: return 15;
5596 case LDKParseError_InvalidSliceLength: return 16;
5597 case LDKParseError_Skip: return 17;
5601 uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
5602 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5603 assert(obj->tag == LDKParseError_Bech32Error);
5604 uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
5605 return bech32_error_ref;
5607 int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
5608 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5609 assert(obj->tag == LDKParseError_ParseAmountError);
5610 /*obj->parse_amount_error*/
5613 uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
5614 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5615 assert(obj->tag == LDKParseError_MalformedSignature);
5616 uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
5617 return malformed_signature_conv;
5619 int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
5620 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5621 assert(obj->tag == LDKParseError_DescriptionDecodeError);
5622 /*obj->description_decode_error*/
5625 jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
5626 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5627 assert(obj->tag == LDKParseError_InvalidSliceLength);
5628 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
5629 jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
5630 return invalid_slice_length_conv;
5632 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5633 CHECK(owner->result_ok);
5634 return SiPrefix_clone(&*owner->contents.result);
5636 uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
5637 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5638 uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
5642 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5643 CHECK(!owner->result_ok);
5644 return ParseError_clone(&*owner->contents.err);
5646 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
5647 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5648 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5649 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
5650 uint64_t ret_ref = tag_ptr(ret_copy, true);
5654 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
5655 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5657 case LDKParseOrSemanticError_ParseError: return 0;
5658 case LDKParseOrSemanticError_SemanticError: return 1;
5662 uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
5663 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5664 assert(obj->tag == LDKParseOrSemanticError_ParseError);
5665 uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
5666 return parse_error_ref;
5668 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
5669 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5670 assert(obj->tag == LDKParseOrSemanticError_SemanticError);
5671 uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
5672 return semantic_error_conv;
5674 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5675 LDKInvoice ret = *owner->contents.result;
5676 ret.is_owned = false;
5679 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
5680 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5681 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
5682 uint64_t ret_ref = 0;
5683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5688 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5689 CHECK(!owner->result_ok);
5690 return ParseOrSemanticError_clone(&*owner->contents.err);
5692 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
5693 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5694 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
5695 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
5696 uint64_t ret_ref = tag_ptr(ret_copy, true);
5700 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5701 LDKSignedRawInvoice ret = *owner->contents.result;
5702 ret.is_owned = false;
5705 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
5706 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5707 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
5708 uint64_t ret_ref = 0;
5709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5710 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5714 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5715 CHECK(!owner->result_ok);
5716 return ParseError_clone(&*owner->contents.err);
5718 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
5719 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5720 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5721 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
5722 uint64_t ret_ref = tag_ptr(ret_copy, true);
5726 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5727 LDKRawInvoice ret = owner->a;
5728 ret.is_owned = false;
5731 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
5732 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5733 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
5734 uint64_t ret_ref = 0;
5735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5740 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5741 return ThirtyTwoBytes_clone(&owner->b);
5743 int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
5744 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5745 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5746 memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
5750 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5751 LDKInvoiceSignature ret = owner->c;
5752 ret.is_owned = false;
5755 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
5756 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5757 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
5758 uint64_t ret_ref = 0;
5759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5764 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5765 LDKPayeePubKey ret = *owner->contents.result;
5766 ret.is_owned = false;
5769 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
5770 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5771 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
5772 uint64_t ret_ref = 0;
5773 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5774 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5778 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5779 CHECK(!owner->result_ok);
5780 return *owner->contents.err;
5782 uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
5783 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5784 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
5788 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
5789 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
5790 for (size_t i = 0; i < ret.datalen; i++) {
5791 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
5795 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5796 LDKPositiveTimestamp ret = *owner->contents.result;
5797 ret.is_owned = false;
5800 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
5801 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5802 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
5803 uint64_t ret_ref = 0;
5804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5809 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5810 CHECK(!owner->result_ok);
5811 return CreationError_clone(&*owner->contents.err);
5813 uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
5814 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5815 uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
5819 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5820 CHECK(owner->result_ok);
5821 return *owner->contents.result;
5823 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
5824 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5825 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
5828 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5829 CHECK(!owner->result_ok);
5830 return SemanticError_clone(&*owner->contents.err);
5832 uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
5833 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5834 uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
5838 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5839 LDKInvoice ret = *owner->contents.result;
5840 ret.is_owned = false;
5843 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
5844 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5845 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
5846 uint64_t ret_ref = 0;
5847 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5848 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5852 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5853 CHECK(!owner->result_ok);
5854 return SemanticError_clone(&*owner->contents.err);
5856 uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
5857 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5858 uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
5862 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5863 LDKDescription ret = *owner->contents.result;
5864 ret.is_owned = false;
5867 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
5868 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5869 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
5870 uint64_t ret_ref = 0;
5871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5876 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5877 CHECK(!owner->result_ok);
5878 return CreationError_clone(&*owner->contents.err);
5880 uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
5881 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5882 uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
5886 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5887 LDKPrivateRoute ret = *owner->contents.result;
5888 ret.is_owned = false;
5891 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
5892 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5893 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
5894 uint64_t ret_ref = 0;
5895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5900 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5901 CHECK(!owner->result_ok);
5902 return CreationError_clone(&*owner->contents.err);
5904 uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
5905 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5906 uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
5910 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5911 CHECK(owner->result_ok);
5912 return *owner->contents.result;
5914 jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
5915 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5916 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
5917 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5921 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5922 CHECK(!owner->result_ok);
5923 return *owner->contents.err;
5925 uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
5926 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5927 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
5931 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5932 LDKChannelMonitorUpdate ret = *owner->contents.result;
5933 ret.is_owned = false;
5936 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
5937 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5938 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
5939 uint64_t ret_ref = 0;
5940 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5941 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5945 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5946 LDKDecodeError ret = *owner->contents.err;
5947 ret.is_owned = false;
5950 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
5951 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5952 LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
5953 uint64_t ret_ref = 0;
5954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5955 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5959 uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
5960 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5962 case LDKCOption_MonitorEventZ_Some: return 0;
5963 case LDKCOption_MonitorEventZ_None: return 1;
5967 uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
5968 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5969 assert(obj->tag == LDKCOption_MonitorEventZ_Some);
5970 uint64_t some_ref = tag_ptr(&obj->some, false);
5973 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5974 CHECK(owner->result_ok);
5975 return COption_MonitorEventZ_clone(&*owner->contents.result);
5977 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
5978 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5979 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
5980 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
5981 uint64_t ret_ref = tag_ptr(ret_copy, true);
5985 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5986 LDKDecodeError ret = *owner->contents.err;
5987 ret.is_owned = false;
5990 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
5991 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5992 LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
5993 uint64_t ret_ref = 0;
5994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5999 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6000 LDKHTLCUpdate ret = *owner->contents.result;
6001 ret.is_owned = false;
6004 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6005 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6006 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
6007 uint64_t ret_ref = 0;
6008 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6009 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6013 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6014 LDKDecodeError ret = *owner->contents.err;
6015 ret.is_owned = false;
6018 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
6019 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6020 LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
6021 uint64_t ret_ref = 0;
6022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6027 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6028 LDKOutPoint ret = owner->a;
6029 ret.is_owned = false;
6032 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
6033 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6034 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
6035 uint64_t ret_ref = 0;
6036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6041 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6042 return CVec_u8Z_clone(&owner->b);
6044 int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
6045 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6046 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
6047 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6048 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6049 CVec_u8Z_free(ret_var);
6053 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6056 int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
6057 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6058 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
6062 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6063 return CVec_u8Z_clone(&owner->b);
6065 int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
6066 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6067 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
6068 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6069 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6070 CVec_u8Z_free(ret_var);
6074 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
6075 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
6076 for (size_t i = 0; i < ret.datalen; i++) {
6077 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
6081 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6082 return ThirtyTwoBytes_clone(&owner->a);
6084 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint64_t owner) {
6085 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6086 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6087 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32);
6091 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6092 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
6094 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint64_t owner) {
6095 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6096 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
6097 uint64_tArray ret_arr = NULL;
6098 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6099 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6100 for (size_t v = 0; v < ret_var.datalen; v++) {
6101 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
6102 *ret_conv_21_conv = ret_var.data[v];
6103 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
6110 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
6111 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 };
6112 for (size_t i = 0; i < ret.datalen; i++) {
6113 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
6117 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
6118 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
6119 for (size_t i = 0; i < ret.datalen; i++) {
6120 ret.data[i] = Event_clone(&orig->data[i]);
6124 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6127 int32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_a"))) TS_C2Tuple_u32TxOutZ_get_a(uint64_t owner) {
6128 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6129 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
6133 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6134 return TxOut_clone(&owner->b);
6136 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_u32TxOutZ_get_b(uint64_t owner) {
6137 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6138 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
6139 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
6140 return tag_ptr(ret_ref, true);
6143 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
6144 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
6145 for (size_t i = 0; i < ret.datalen; i++) {
6146 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
6150 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6151 return ThirtyTwoBytes_clone(&owner->a);
6153 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint64_t owner) {
6154 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6155 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6156 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32);
6160 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6161 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
6163 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint64_t owner) {
6164 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6165 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
6166 uint64_tArray ret_arr = NULL;
6167 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6168 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6169 for (size_t u = 0; u < ret_var.datalen; u++) {
6170 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
6171 *ret_conv_20_conv = ret_var.data[u];
6172 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
6179 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
6180 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 };
6181 for (size_t i = 0; i < ret.datalen; i++) {
6182 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
6186 uint32_t __attribute__((export_name("TS_LDKBalance_ty_from_ptr"))) TS_LDKBalance_ty_from_ptr(uint64_t ptr) {
6187 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6189 case LDKBalance_ClaimableOnChannelClose: return 0;
6190 case LDKBalance_ClaimableAwaitingConfirmations: return 1;
6191 case LDKBalance_ContentiousClaimable: return 2;
6192 case LDKBalance_MaybeClaimableHTLCAwaitingTimeout: return 3;
6196 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(uint64_t ptr) {
6197 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6198 assert(obj->tag == LDKBalance_ClaimableOnChannelClose);
6199 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
6200 return claimable_amount_satoshis_conv;
6202 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(uint64_t ptr) {
6203 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6204 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6205 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
6206 return claimable_amount_satoshis_conv;
6208 int32_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(uint64_t ptr) {
6209 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6210 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6211 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
6212 return confirmation_height_conv;
6214 int64_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6215 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6216 assert(obj->tag == LDKBalance_ContentiousClaimable);
6217 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
6218 return claimable_amount_satoshis_conv;
6220 int32_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_timeout_height"))) TS_LDKBalance_ContentiousClaimable_get_timeout_height(uint64_t ptr) {
6221 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6222 assert(obj->tag == LDKBalance_ContentiousClaimable);
6223 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
6224 return timeout_height_conv;
6226 int64_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(uint64_t ptr) {
6227 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6228 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6229 int64_t claimable_amount_satoshis_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_amount_satoshis;
6230 return claimable_amount_satoshis_conv;
6232 int32_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height(uint64_t ptr) {
6233 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6234 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6235 int32_t claimable_height_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_height;
6236 return claimable_height_conv;
6238 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
6239 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
6240 for (size_t i = 0; i < ret.datalen; i++) {
6241 ret.data[i] = Balance_clone(&orig->data[i]);
6245 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6246 return ThirtyTwoBytes_clone(&owner->a);
6248 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint64_t owner) {
6249 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6250 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6251 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32);
6255 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6256 LDKChannelMonitor ret = owner->b;
6257 ret.is_owned = false;
6260 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint64_t owner) {
6261 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6262 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6263 uint64_t ret_ref = 0;
6264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6269 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6270 CHECK(owner->result_ok);
6271 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
6273 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint64_t owner) {
6274 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6275 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6276 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
6277 return tag_ptr(ret_conv, true);
6280 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6281 LDKDecodeError ret = *owner->contents.err;
6282 ret.is_owned = false;
6285 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
6286 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6287 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
6288 uint64_t ret_ref = 0;
6289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6294 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6297 int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint64_t owner) {
6298 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6299 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
6300 memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33);
6304 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6305 return Type_clone(&owner->b);
6307 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint64_t owner) {
6308 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6309 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
6310 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
6311 return tag_ptr(ret_ret, true);
6314 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
6315 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
6316 for (size_t i = 0; i < ret.datalen; i++) {
6317 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
6321 uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
6322 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6324 case LDKCOption_NetAddressZ_Some: return 0;
6325 case LDKCOption_NetAddressZ_None: return 1;
6329 uint64_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_Some_get_some"))) TS_LDKCOption_NetAddressZ_Some_get_some(uint64_t ptr) {
6330 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6331 assert(obj->tag == LDKCOption_NetAddressZ_Some);
6332 uint64_t some_ref = tag_ptr(&obj->some, false);
6335 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6336 CHECK(owner->result_ok);
6337 return CVec_u8Z_clone(&*owner->contents.result);
6339 int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint64_t owner) {
6340 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6341 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
6342 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6343 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6344 CVec_u8Z_free(ret_var);
6348 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6349 LDKPeerHandleError ret = *owner->contents.err;
6350 ret.is_owned = false;
6353 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint64_t owner) {
6354 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6355 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
6356 uint64_t ret_ref = 0;
6357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6362 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6363 CHECK(owner->result_ok);
6364 return *owner->contents.result;
6366 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_ok"))) TS_CResult_NonePeerHandleErrorZ_get_ok(uint64_t owner) {
6367 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6368 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
6371 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6372 LDKPeerHandleError ret = *owner->contents.err;
6373 ret.is_owned = false;
6376 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint64_t owner) {
6377 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6378 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
6379 uint64_t ret_ref = 0;
6380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6385 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6386 CHECK(owner->result_ok);
6387 return *owner->contents.result;
6389 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_ok"))) TS_CResult_boolPeerHandleErrorZ_get_ok(uint64_t owner) {
6390 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6391 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
6395 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6396 LDKPeerHandleError ret = *owner->contents.err;
6397 ret.is_owned = false;
6400 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint64_t owner) {
6401 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6402 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
6403 uint64_t ret_ref = 0;
6404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6409 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6410 CHECK(owner->result_ok);
6411 return *owner->contents.result;
6413 void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
6414 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6415 CResult_NoneErrorZ_get_ok(owner_conv);
6418 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6419 CHECK(!owner->result_ok);
6420 return *owner->contents.err;
6422 uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
6423 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6424 uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
6428 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6429 CHECK(owner->result_ok);
6430 return NetAddress_clone(&*owner->contents.result);
6432 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
6433 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6434 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
6435 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
6436 uint64_t ret_ref = tag_ptr(ret_copy, true);
6440 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6441 LDKDecodeError ret = *owner->contents.err;
6442 ret.is_owned = false;
6445 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
6446 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6447 LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
6448 uint64_t ret_ref = 0;
6449 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6450 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6454 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
6455 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
6456 for (size_t i = 0; i < ret.datalen; i++) {
6457 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
6461 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
6462 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
6463 for (size_t i = 0; i < ret.datalen; i++) {
6464 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
6468 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
6469 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
6470 for (size_t i = 0; i < ret.datalen; i++) {
6471 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
6475 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
6476 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
6477 for (size_t i = 0; i < ret.datalen; i++) {
6478 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
6482 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6483 LDKAcceptChannel ret = *owner->contents.result;
6484 ret.is_owned = false;
6487 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
6488 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6489 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
6490 uint64_t ret_ref = 0;
6491 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6492 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6496 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6497 LDKDecodeError ret = *owner->contents.err;
6498 ret.is_owned = false;
6501 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
6502 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6503 LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
6504 uint64_t ret_ref = 0;
6505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6510 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6511 LDKAnnouncementSignatures ret = *owner->contents.result;
6512 ret.is_owned = false;
6515 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
6516 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6517 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
6518 uint64_t ret_ref = 0;
6519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6524 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6525 LDKDecodeError ret = *owner->contents.err;
6526 ret.is_owned = false;
6529 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
6530 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6531 LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
6532 uint64_t ret_ref = 0;
6533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6538 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6539 LDKChannelReestablish ret = *owner->contents.result;
6540 ret.is_owned = false;
6543 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint64_t owner) {
6544 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6545 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
6546 uint64_t ret_ref = 0;
6547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6552 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6553 LDKDecodeError ret = *owner->contents.err;
6554 ret.is_owned = false;
6557 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
6558 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6559 LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
6560 uint64_t ret_ref = 0;
6561 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6562 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6566 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6567 LDKClosingSigned ret = *owner->contents.result;
6568 ret.is_owned = false;
6571 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6572 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6573 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
6574 uint64_t ret_ref = 0;
6575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6580 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6581 LDKDecodeError ret = *owner->contents.err;
6582 ret.is_owned = false;
6585 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
6586 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6587 LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
6588 uint64_t ret_ref = 0;
6589 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6590 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6594 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6595 LDKClosingSignedFeeRange ret = *owner->contents.result;
6596 ret.is_owned = false;
6599 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint64_t owner) {
6600 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6601 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
6602 uint64_t ret_ref = 0;
6603 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6604 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6608 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6609 LDKDecodeError ret = *owner->contents.err;
6610 ret.is_owned = false;
6613 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
6614 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6615 LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
6616 uint64_t ret_ref = 0;
6617 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6618 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6622 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6623 LDKCommitmentSigned ret = *owner->contents.result;
6624 ret.is_owned = false;
6627 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint64_t owner) {
6628 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6629 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
6630 uint64_t ret_ref = 0;
6631 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6632 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6636 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6637 LDKDecodeError ret = *owner->contents.err;
6638 ret.is_owned = false;
6641 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
6642 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6643 LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
6644 uint64_t ret_ref = 0;
6645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6650 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6651 LDKFundingCreated ret = *owner->contents.result;
6652 ret.is_owned = false;
6655 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint64_t owner) {
6656 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6657 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
6658 uint64_t ret_ref = 0;
6659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6664 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6665 LDKDecodeError ret = *owner->contents.err;
6666 ret.is_owned = false;
6669 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
6670 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6671 LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
6672 uint64_t ret_ref = 0;
6673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6678 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6679 LDKFundingSigned ret = *owner->contents.result;
6680 ret.is_owned = false;
6683 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6684 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6685 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
6686 uint64_t ret_ref = 0;
6687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6692 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6693 LDKDecodeError ret = *owner->contents.err;
6694 ret.is_owned = false;
6697 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
6698 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6699 LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
6700 uint64_t ret_ref = 0;
6701 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6702 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6706 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6707 LDKChannelReady ret = *owner->contents.result;
6708 ret.is_owned = false;
6711 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_get_ok(uint64_t owner) {
6712 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6713 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
6714 uint64_t ret_ref = 0;
6715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6720 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6721 LDKDecodeError ret = *owner->contents.err;
6722 ret.is_owned = false;
6725 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
6726 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6727 LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
6728 uint64_t ret_ref = 0;
6729 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6730 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6734 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6735 LDKInit ret = *owner->contents.result;
6736 ret.is_owned = false;
6739 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint64_t owner) {
6740 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6741 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
6742 uint64_t ret_ref = 0;
6743 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6744 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6748 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6749 LDKDecodeError ret = *owner->contents.err;
6750 ret.is_owned = false;
6753 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
6754 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6755 LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
6756 uint64_t ret_ref = 0;
6757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6762 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6763 LDKOpenChannel ret = *owner->contents.result;
6764 ret.is_owned = false;
6767 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint64_t owner) {
6768 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6769 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
6770 uint64_t ret_ref = 0;
6771 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6772 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6776 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6777 LDKDecodeError ret = *owner->contents.err;
6778 ret.is_owned = false;
6781 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
6782 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6783 LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
6784 uint64_t ret_ref = 0;
6785 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6786 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6790 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6791 LDKRevokeAndACK ret = *owner->contents.result;
6792 ret.is_owned = false;
6795 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint64_t owner) {
6796 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6797 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
6798 uint64_t ret_ref = 0;
6799 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6800 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6804 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6805 LDKDecodeError ret = *owner->contents.err;
6806 ret.is_owned = false;
6809 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
6810 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6811 LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
6812 uint64_t ret_ref = 0;
6813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6818 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6819 LDKShutdown ret = *owner->contents.result;
6820 ret.is_owned = false;
6823 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint64_t owner) {
6824 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6825 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
6826 uint64_t ret_ref = 0;
6827 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6828 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6832 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6833 LDKDecodeError ret = *owner->contents.err;
6834 ret.is_owned = false;
6837 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
6838 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6839 LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
6840 uint64_t ret_ref = 0;
6841 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6842 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6846 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6847 LDKUpdateFailHTLC ret = *owner->contents.result;
6848 ret.is_owned = false;
6851 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6852 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6853 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
6854 uint64_t ret_ref = 0;
6855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6860 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6861 LDKDecodeError ret = *owner->contents.err;
6862 ret.is_owned = false;
6865 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
6866 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6867 LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
6868 uint64_t ret_ref = 0;
6869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6874 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6875 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
6876 ret.is_owned = false;
6879 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6880 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6881 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
6882 uint64_t ret_ref = 0;
6883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6888 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6889 LDKDecodeError ret = *owner->contents.err;
6890 ret.is_owned = false;
6893 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
6894 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6895 LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
6896 uint64_t ret_ref = 0;
6897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6902 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6903 LDKUpdateFee ret = *owner->contents.result;
6904 ret.is_owned = false;
6907 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint64_t owner) {
6908 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6909 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
6910 uint64_t ret_ref = 0;
6911 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6912 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6916 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6917 LDKDecodeError ret = *owner->contents.err;
6918 ret.is_owned = false;
6921 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
6922 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6923 LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
6924 uint64_t ret_ref = 0;
6925 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6926 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6930 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6931 LDKUpdateFulfillHTLC ret = *owner->contents.result;
6932 ret.is_owned = false;
6935 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6936 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6937 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
6938 uint64_t ret_ref = 0;
6939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6944 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6945 LDKDecodeError ret = *owner->contents.err;
6946 ret.is_owned = false;
6949 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
6950 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6951 LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
6952 uint64_t ret_ref = 0;
6953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6954 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6958 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6959 LDKUpdateAddHTLC ret = *owner->contents.result;
6960 ret.is_owned = false;
6963 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6964 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6965 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
6966 uint64_t ret_ref = 0;
6967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6972 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6973 LDKDecodeError ret = *owner->contents.err;
6974 ret.is_owned = false;
6977 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
6978 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6979 LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
6980 uint64_t ret_ref = 0;
6981 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6982 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6986 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
6987 LDKPing ret = *owner->contents.result;
6988 ret.is_owned = false;
6991 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint64_t owner) {
6992 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
6993 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
6994 uint64_t ret_ref = 0;
6995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7000 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7001 LDKDecodeError ret = *owner->contents.err;
7002 ret.is_owned = false;
7005 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
7006 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7007 LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
7008 uint64_t ret_ref = 0;
7009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7014 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7015 LDKPong ret = *owner->contents.result;
7016 ret.is_owned = false;
7019 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint64_t owner) {
7020 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7021 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
7022 uint64_t ret_ref = 0;
7023 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7024 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7028 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7029 LDKDecodeError ret = *owner->contents.err;
7030 ret.is_owned = false;
7033 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
7034 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7035 LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
7036 uint64_t ret_ref = 0;
7037 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7038 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7042 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7043 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
7044 ret.is_owned = false;
7047 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7048 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7049 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7050 uint64_t ret_ref = 0;
7051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7056 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7057 LDKDecodeError ret = *owner->contents.err;
7058 ret.is_owned = false;
7061 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7062 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7063 LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7064 uint64_t ret_ref = 0;
7065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7070 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7071 LDKChannelAnnouncement ret = *owner->contents.result;
7072 ret.is_owned = false;
7075 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7076 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7077 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7078 uint64_t ret_ref = 0;
7079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7084 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7085 LDKDecodeError ret = *owner->contents.err;
7086 ret.is_owned = false;
7089 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7090 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7091 LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7092 uint64_t ret_ref = 0;
7093 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7094 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7098 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7099 LDKUnsignedChannelUpdate ret = *owner->contents.result;
7100 ret.is_owned = false;
7103 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7104 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7105 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7106 uint64_t ret_ref = 0;
7107 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7108 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7112 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7113 LDKDecodeError ret = *owner->contents.err;
7114 ret.is_owned = false;
7117 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7118 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7119 LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
7120 uint64_t ret_ref = 0;
7121 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7122 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7126 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7127 LDKChannelUpdate ret = *owner->contents.result;
7128 ret.is_owned = false;
7131 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7132 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7133 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7134 uint64_t ret_ref = 0;
7135 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7136 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7140 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7141 LDKDecodeError ret = *owner->contents.err;
7142 ret.is_owned = false;
7145 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7146 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7147 LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
7148 uint64_t ret_ref = 0;
7149 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7150 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7154 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7155 LDKErrorMessage ret = *owner->contents.result;
7156 ret.is_owned = false;
7159 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint64_t owner) {
7160 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7161 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
7162 uint64_t ret_ref = 0;
7163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7168 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7169 LDKDecodeError ret = *owner->contents.err;
7170 ret.is_owned = false;
7173 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
7174 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7175 LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
7176 uint64_t ret_ref = 0;
7177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7182 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7183 LDKWarningMessage ret = *owner->contents.result;
7184 ret.is_owned = false;
7187 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ok"))) TS_CResult_WarningMessageDecodeErrorZ_get_ok(uint64_t owner) {
7188 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7189 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
7190 uint64_t ret_ref = 0;
7191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7196 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7197 LDKDecodeError ret = *owner->contents.err;
7198 ret.is_owned = false;
7201 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
7202 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7203 LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
7204 uint64_t ret_ref = 0;
7205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7210 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7211 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
7212 ret.is_owned = false;
7215 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7216 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7217 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7218 uint64_t ret_ref = 0;
7219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7224 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7225 LDKDecodeError ret = *owner->contents.err;
7226 ret.is_owned = false;
7229 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7230 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7231 LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7232 uint64_t ret_ref = 0;
7233 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7234 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7238 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7239 LDKNodeAnnouncement ret = *owner->contents.result;
7240 ret.is_owned = false;
7243 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7244 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7245 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7246 uint64_t ret_ref = 0;
7247 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7248 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7252 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7253 LDKDecodeError ret = *owner->contents.err;
7254 ret.is_owned = false;
7257 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7258 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7259 LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7260 uint64_t ret_ref = 0;
7261 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7262 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7266 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7267 LDKQueryShortChannelIds ret = *owner->contents.result;
7268 ret.is_owned = false;
7271 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint64_t owner) {
7272 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7273 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
7274 uint64_t ret_ref = 0;
7275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7280 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7281 LDKDecodeError ret = *owner->contents.err;
7282 ret.is_owned = false;
7285 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
7286 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7287 LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
7288 uint64_t ret_ref = 0;
7289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7294 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7295 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
7296 ret.is_owned = false;
7299 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint64_t owner) {
7300 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7301 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
7302 uint64_t ret_ref = 0;
7303 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7304 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7308 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7309 LDKDecodeError ret = *owner->contents.err;
7310 ret.is_owned = false;
7313 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
7314 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7315 LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
7316 uint64_t ret_ref = 0;
7317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7322 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7323 LDKQueryChannelRange ret = *owner->contents.result;
7324 ret.is_owned = false;
7327 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7328 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7329 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
7330 uint64_t ret_ref = 0;
7331 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7332 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7336 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7337 LDKDecodeError ret = *owner->contents.err;
7338 ret.is_owned = false;
7341 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7342 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7343 LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
7344 uint64_t ret_ref = 0;
7345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7350 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7351 LDKReplyChannelRange ret = *owner->contents.result;
7352 ret.is_owned = false;
7355 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7356 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7357 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
7358 uint64_t ret_ref = 0;
7359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7364 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7365 LDKDecodeError ret = *owner->contents.err;
7366 ret.is_owned = false;
7369 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7370 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7371 LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
7372 uint64_t ret_ref = 0;
7373 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7374 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7378 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7379 LDKGossipTimestampFilter ret = *owner->contents.result;
7380 ret.is_owned = false;
7383 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint64_t owner) {
7384 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7385 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
7386 uint64_t ret_ref = 0;
7387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7392 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7393 LDKDecodeError ret = *owner->contents.err;
7394 ret.is_owned = false;
7397 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
7398 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7399 LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
7400 uint64_t ret_ref = 0;
7401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7406 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
7407 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7409 case LDKSignOrCreationError_SignError: return 0;
7410 case LDKSignOrCreationError_CreationError: return 1;
7414 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) {
7415 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7416 assert(obj->tag == LDKSignOrCreationError_CreationError);
7417 uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error);
7418 return creation_error_conv;
7420 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7421 LDKInvoice ret = *owner->contents.result;
7422 ret.is_owned = false;
7425 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) {
7426 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7427 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
7428 uint64_t ret_ref = 0;
7429 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7430 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7434 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7435 CHECK(!owner->result_ok);
7436 return SignOrCreationError_clone(&*owner->contents.err);
7438 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) {
7439 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7440 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
7441 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
7442 uint64_t ret_ref = tag_ptr(ret_copy, true);
7446 typedef struct LDKFilter_JCalls {
7447 atomic_size_t refcnt;
7448 uint32_t instance_ptr;
7450 static void LDKFilter_JCalls_free(void* this_arg) {
7451 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7452 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7456 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
7457 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7458 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
7459 memcpy(txid_arr->elems, *txid, 32);
7460 LDKu8slice script_pubkey_var = script_pubkey;
7461 int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
7462 memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
7463 js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
7465 LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
7466 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7467 LDKWatchedOutput output_var = output;
7468 uint64_t output_ref = 0;
7469 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
7470 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
7471 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 33, output_ref, 0, 0, 0, 0, 0);
7472 void* ret_ptr = untag_ptr(ret);
7473 CHECK_ACCESS(ret_ptr);
7474 LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
7475 FREE(untag_ptr(ret));
7478 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
7479 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
7480 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7482 static inline LDKFilter LDKFilter_init (JSValue o) {
7483 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
7484 atomic_init(&calls->refcnt, 1);
7485 calls->instance_ptr = o;
7488 .this_arg = (void*) calls,
7489 .register_tx = register_tx_LDKFilter_jcall,
7490 .register_output = register_output_LDKFilter_jcall,
7491 .free = LDKFilter_JCalls_free,
7495 uint64_t __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue o) {
7496 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
7497 *res_ptr = LDKFilter_init(o);
7498 return tag_ptr(res_ptr, true);
7500 void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
7501 void* this_arg_ptr = untag_ptr(this_arg);
7502 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7503 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7504 unsigned char txid_arr[32];
7505 CHECK(txid->arr_len == 32);
7506 memcpy(txid_arr, txid->elems, 32); FREE(txid);
7507 unsigned char (*txid_ref)[32] = &txid_arr;
7508 LDKu8slice script_pubkey_ref;
7509 script_pubkey_ref.datalen = script_pubkey->arr_len;
7510 script_pubkey_ref.data = script_pubkey->elems;
7511 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
7512 FREE(script_pubkey);
7515 uint64_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
7516 void* this_arg_ptr = untag_ptr(this_arg);
7517 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7518 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7519 LDKWatchedOutput output_conv;
7520 output_conv.inner = untag_ptr(output);
7521 output_conv.is_owned = ptr_is_owned(output);
7522 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
7523 output_conv = WatchedOutput_clone(&output_conv);
7524 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
7525 *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
7526 uint64_t ret_ref = tag_ptr(ret_copy, true);
7530 uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
7531 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7533 case LDKCOption_FilterZ_Some: return 0;
7534 case LDKCOption_FilterZ_None: return 1;
7538 uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_LDKCOption_FilterZ_Some_get_some(uint64_t ptr) {
7539 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7540 assert(obj->tag == LDKCOption_FilterZ_Some);
7541 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
7542 *some_ret = obj->some;
7543 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
7544 if ((*some_ret).free == LDKFilter_JCalls_free) {
7545 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7546 LDKFilter_JCalls_cloned(&(*some_ret));
7548 return tag_ptr(some_ret, true);
7550 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7551 LDKLockedChannelMonitor ret = *owner->contents.result;
7552 ret.is_owned = false;
7555 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) {
7556 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7557 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
7558 uint64_t ret_ref = 0;
7559 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7560 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7564 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7565 CHECK(!owner->result_ok);
7566 return *owner->contents.err;
7568 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) {
7569 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7570 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
7573 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
7574 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
7575 for (size_t i = 0; i < ret.datalen; i++) {
7576 ret.data[i] = OutPoint_clone(&orig->data[i]);
7580 typedef struct LDKMessageSendEventsProvider_JCalls {
7581 atomic_size_t refcnt;
7582 uint32_t instance_ptr;
7583 } LDKMessageSendEventsProvider_JCalls;
7584 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
7585 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7586 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7590 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
7591 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7592 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0);
7593 LDKCVec_MessageSendEventZ ret_constr;
7594 ret_constr.datalen = ret->arr_len;
7595 if (ret_constr.datalen > 0)
7596 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
7598 ret_constr.data = NULL;
7599 uint64_t* ret_vals = ret->elems;
7600 for (size_t s = 0; s < ret_constr.datalen; s++) {
7601 uint64_t ret_conv_18 = ret_vals[s];
7602 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
7603 CHECK_ACCESS(ret_conv_18_ptr);
7604 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
7605 FREE(untag_ptr(ret_conv_18));
7606 ret_constr.data[s] = ret_conv_18_conv;
7611 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
7612 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
7613 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7615 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) {
7616 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
7617 atomic_init(&calls->refcnt, 1);
7618 calls->instance_ptr = o;
7620 LDKMessageSendEventsProvider ret = {
7621 .this_arg = (void*) calls,
7622 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
7623 .free = LDKMessageSendEventsProvider_JCalls_free,
7627 uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) {
7628 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
7629 *res_ptr = LDKMessageSendEventsProvider_init(o);
7630 return tag_ptr(res_ptr, true);
7632 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) {
7633 void* this_arg_ptr = untag_ptr(this_arg);
7634 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7635 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
7636 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
7637 uint64_tArray ret_arr = NULL;
7638 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
7639 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
7640 for (size_t s = 0; s < ret_var.datalen; s++) {
7641 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
7642 *ret_conv_18_copy = ret_var.data[s];
7643 uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
7644 ret_arr_ptr[s] = ret_conv_18_ref;
7651 typedef struct LDKEventHandler_JCalls {
7652 atomic_size_t refcnt;
7653 uint32_t instance_ptr;
7654 } LDKEventHandler_JCalls;
7655 static void LDKEventHandler_JCalls_free(void* this_arg) {
7656 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7657 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7661 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
7662 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7663 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
7664 *ret_event = Event_clone(event);
7665 uint64_t ref_event = tag_ptr(ret_event, true);
7666 js_invoke_function_buuuuu(j_calls->instance_ptr, 35, ref_event, 0, 0, 0, 0, 0);
7668 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
7669 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
7670 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7672 static inline LDKEventHandler LDKEventHandler_init (JSValue o) {
7673 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
7674 atomic_init(&calls->refcnt, 1);
7675 calls->instance_ptr = o;
7677 LDKEventHandler ret = {
7678 .this_arg = (void*) calls,
7679 .handle_event = handle_event_LDKEventHandler_jcall,
7680 .free = LDKEventHandler_JCalls_free,
7684 uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) {
7685 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7686 *res_ptr = LDKEventHandler_init(o);
7687 return tag_ptr(res_ptr, true);
7689 void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) {
7690 void* this_arg_ptr = untag_ptr(this_arg);
7691 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7692 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
7693 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
7694 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
7697 typedef struct LDKEventsProvider_JCalls {
7698 atomic_size_t refcnt;
7699 uint32_t instance_ptr;
7700 } LDKEventsProvider_JCalls;
7701 static void LDKEventsProvider_JCalls_free(void* this_arg) {
7702 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7703 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7707 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
7708 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7709 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7710 *handler_ret = handler;
7711 js_invoke_function_buuuuu(j_calls->instance_ptr, 36, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
7713 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
7714 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
7715 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7717 static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) {
7718 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
7719 atomic_init(&calls->refcnt, 1);
7720 calls->instance_ptr = o;
7722 LDKEventsProvider ret = {
7723 .this_arg = (void*) calls,
7724 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
7725 .free = LDKEventsProvider_JCalls_free,
7729 uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) {
7730 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
7731 *res_ptr = LDKEventsProvider_init(o);
7732 return tag_ptr(res_ptr, true);
7734 void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) {
7735 void* this_arg_ptr = untag_ptr(this_arg);
7736 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7737 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
7738 void* handler_ptr = untag_ptr(handler);
7739 CHECK_ACCESS(handler_ptr);
7740 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
7741 if (handler_conv.free == LDKEventHandler_JCalls_free) {
7742 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7743 LDKEventHandler_JCalls_cloned(&handler_conv);
7745 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
7748 typedef struct LDKScore_JCalls {
7749 atomic_size_t refcnt;
7750 uint32_t instance_ptr;
7752 static void LDKScore_JCalls_free(void* this_arg) {
7753 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7754 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7758 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
7759 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7760 int64_t short_channel_id_conv = short_channel_id;
7761 LDKNodeId source_var = *source;
7762 uint64_t source_ref = 0;
7763 source_var = NodeId_clone(&source_var);
7764 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
7765 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
7766 LDKNodeId target_var = *target;
7767 uint64_t target_ref = 0;
7768 target_var = NodeId_clone(&target_var);
7769 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
7770 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
7771 LDKChannelUsage usage_var = usage;
7772 uint64_t usage_ref = 0;
7773 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
7774 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
7775 return js_invoke_function_bbbbuu(j_calls->instance_ptr, 37, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
7777 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7778 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7779 LDKCVec_RouteHopZ path_var = path;
7780 uint64_tArray path_arr = NULL;
7781 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7782 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7783 for (size_t k = 0; k < path_var.datalen; k++) {
7784 LDKRouteHop path_conv_10_var = path_var.data[k];
7785 uint64_t path_conv_10_ref = 0;
7786 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7787 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7788 path_arr_ptr[k] = path_conv_10_ref;
7791 FREE(path_var.data);
7792 int64_t short_channel_id_conv = short_channel_id;
7793 js_invoke_function_ubuuuu(j_calls->instance_ptr, 38, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7795 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7796 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7797 LDKCVec_RouteHopZ path_var = path;
7798 uint64_tArray path_arr = NULL;
7799 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7800 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7801 for (size_t k = 0; k < path_var.datalen; k++) {
7802 LDKRouteHop path_conv_10_var = path_var.data[k];
7803 uint64_t path_conv_10_ref = 0;
7804 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7805 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7806 path_arr_ptr[k] = path_conv_10_ref;
7809 FREE(path_var.data);
7810 js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7812 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7813 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7814 LDKCVec_RouteHopZ path_var = path;
7815 uint64_tArray path_arr = NULL;
7816 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7817 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7818 for (size_t k = 0; k < path_var.datalen; k++) {
7819 LDKRouteHop path_conv_10_var = path_var.data[k];
7820 uint64_t path_conv_10_ref = 0;
7821 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7822 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7823 path_arr_ptr[k] = path_conv_10_ref;
7826 FREE(path_var.data);
7827 int64_t short_channel_id_conv = short_channel_id;
7828 js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7830 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7831 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7832 LDKCVec_RouteHopZ path_var = path;
7833 uint64_tArray path_arr = NULL;
7834 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7835 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7836 for (size_t k = 0; k < path_var.datalen; k++) {
7837 LDKRouteHop path_conv_10_var = path_var.data[k];
7838 uint64_t path_conv_10_ref = 0;
7839 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7840 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7841 path_arr_ptr[k] = path_conv_10_ref;
7844 FREE(path_var.data);
7845 js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7847 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
7848 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7849 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 42, 0, 0, 0, 0, 0, 0);
7850 LDKCVec_u8Z ret_ref;
7851 ret_ref.datalen = ret->arr_len;
7852 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
7853 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
7856 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
7857 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
7858 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7860 static inline LDKScore LDKScore_init (JSValue o) {
7861 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
7862 atomic_init(&calls->refcnt, 1);
7863 calls->instance_ptr = o;
7866 .this_arg = (void*) calls,
7867 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
7868 .payment_path_failed = payment_path_failed_LDKScore_jcall,
7869 .payment_path_successful = payment_path_successful_LDKScore_jcall,
7870 .probe_failed = probe_failed_LDKScore_jcall,
7871 .probe_successful = probe_successful_LDKScore_jcall,
7872 .write = write_LDKScore_jcall,
7873 .free = LDKScore_JCalls_free,
7877 uint64_t __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) {
7878 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
7879 *res_ptr = LDKScore_init(o);
7880 return tag_ptr(res_ptr, true);
7882 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) {
7883 void* this_arg_ptr = untag_ptr(this_arg);
7884 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7885 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7886 LDKNodeId source_conv;
7887 source_conv.inner = untag_ptr(source);
7888 source_conv.is_owned = ptr_is_owned(source);
7889 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
7890 source_conv.is_owned = false;
7891 LDKNodeId target_conv;
7892 target_conv.inner = untag_ptr(target);
7893 target_conv.is_owned = ptr_is_owned(target);
7894 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
7895 target_conv.is_owned = false;
7896 LDKChannelUsage usage_conv;
7897 usage_conv.inner = untag_ptr(usage);
7898 usage_conv.is_owned = ptr_is_owned(usage);
7899 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
7900 usage_conv = ChannelUsage_clone(&usage_conv);
7901 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
7905 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) {
7906 void* this_arg_ptr = untag_ptr(this_arg);
7907 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7908 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7909 LDKCVec_RouteHopZ path_constr;
7910 path_constr.datalen = path->arr_len;
7911 if (path_constr.datalen > 0)
7912 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7914 path_constr.data = NULL;
7915 uint64_t* path_vals = path->elems;
7916 for (size_t k = 0; k < path_constr.datalen; k++) {
7917 uint64_t path_conv_10 = path_vals[k];
7918 LDKRouteHop path_conv_10_conv;
7919 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7920 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7921 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7922 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7923 path_constr.data[k] = path_conv_10_conv;
7926 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7929 void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
7930 void* this_arg_ptr = untag_ptr(this_arg);
7931 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7932 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7933 LDKCVec_RouteHopZ path_constr;
7934 path_constr.datalen = path->arr_len;
7935 if (path_constr.datalen > 0)
7936 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7938 path_constr.data = NULL;
7939 uint64_t* path_vals = path->elems;
7940 for (size_t k = 0; k < path_constr.datalen; k++) {
7941 uint64_t path_conv_10 = path_vals[k];
7942 LDKRouteHop path_conv_10_conv;
7943 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7944 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7945 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7946 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7947 path_constr.data[k] = path_conv_10_conv;
7950 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
7953 void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
7954 void* this_arg_ptr = untag_ptr(this_arg);
7955 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7956 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7957 LDKCVec_RouteHopZ path_constr;
7958 path_constr.datalen = path->arr_len;
7959 if (path_constr.datalen > 0)
7960 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7962 path_constr.data = NULL;
7963 uint64_t* path_vals = path->elems;
7964 for (size_t k = 0; k < path_constr.datalen; k++) {
7965 uint64_t path_conv_10 = path_vals[k];
7966 LDKRouteHop path_conv_10_conv;
7967 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7968 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7969 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7970 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7971 path_constr.data[k] = path_conv_10_conv;
7974 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7977 void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) {
7978 void* this_arg_ptr = untag_ptr(this_arg);
7979 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7980 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7981 LDKCVec_RouteHopZ path_constr;
7982 path_constr.datalen = path->arr_len;
7983 if (path_constr.datalen > 0)
7984 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7986 path_constr.data = NULL;
7987 uint64_t* path_vals = path->elems;
7988 for (size_t k = 0; k < path_constr.datalen; k++) {
7989 uint64_t path_conv_10 = path_vals[k];
7990 LDKRouteHop path_conv_10_conv;
7991 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7992 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7993 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7994 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7995 path_constr.data[k] = path_conv_10_conv;
7998 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
8001 int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) {
8002 void* this_arg_ptr = untag_ptr(this_arg);
8003 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8004 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8005 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8006 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8007 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8008 CVec_u8Z_free(ret_var);
8012 typedef struct LDKPersister_JCalls {
8013 atomic_size_t refcnt;
8014 uint32_t instance_ptr;
8015 } LDKPersister_JCalls;
8016 static void LDKPersister_JCalls_free(void* this_arg) {
8017 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8018 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8022 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
8023 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8024 LDKChannelManager channel_manager_var = *channel_manager;
8025 uint64_t channel_manager_ref = 0;
8026 // WARNING: we may need a move here but no clone is available for LDKChannelManager
8027 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
8028 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
8029 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 43, channel_manager_ref, 0, 0, 0, 0, 0);
8030 void* ret_ptr = untag_ptr(ret);
8031 CHECK_ACCESS(ret_ptr);
8032 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8033 FREE(untag_ptr(ret));
8036 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
8037 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8038 LDKNetworkGraph network_graph_var = *network_graph;
8039 uint64_t network_graph_ref = 0;
8040 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
8041 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
8042 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
8043 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 44, network_graph_ref, 0, 0, 0, 0, 0);
8044 void* ret_ptr = untag_ptr(ret);
8045 CHECK_ACCESS(ret_ptr);
8046 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8047 FREE(untag_ptr(ret));
8050 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) {
8051 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8052 LDKMultiThreadedLockableScore scorer_var = *scorer;
8053 uint64_t scorer_ref = 0;
8054 // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore
8055 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var);
8056 scorer_ref = tag_ptr(scorer_var.inner, scorer_var.is_owned);
8057 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 45, scorer_ref, 0, 0, 0, 0, 0);
8058 void* ret_ptr = untag_ptr(ret);
8059 CHECK_ACCESS(ret_ptr);
8060 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8061 FREE(untag_ptr(ret));
8064 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
8065 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
8066 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8068 static inline LDKPersister LDKPersister_init (JSValue o) {
8069 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
8070 atomic_init(&calls->refcnt, 1);
8071 calls->instance_ptr = o;
8073 LDKPersister ret = {
8074 .this_arg = (void*) calls,
8075 .persist_manager = persist_manager_LDKPersister_jcall,
8076 .persist_graph = persist_graph_LDKPersister_jcall,
8077 .persist_scorer = persist_scorer_LDKPersister_jcall,
8078 .free = LDKPersister_JCalls_free,
8082 uint64_t __attribute__((export_name("TS_LDKPersister_new"))) TS_LDKPersister_new(JSValue o) {
8083 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
8084 *res_ptr = LDKPersister_init(o);
8085 return tag_ptr(res_ptr, true);
8087 uint64_t __attribute__((export_name("TS_Persister_persist_manager"))) TS_Persister_persist_manager(uint64_t this_arg, uint64_t channel_manager) {
8088 void* this_arg_ptr = untag_ptr(this_arg);
8089 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8090 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8091 LDKChannelManager channel_manager_conv;
8092 channel_manager_conv.inner = untag_ptr(channel_manager);
8093 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
8094 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
8095 channel_manager_conv.is_owned = false;
8096 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8097 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
8098 return tag_ptr(ret_conv, true);
8101 uint64_t __attribute__((export_name("TS_Persister_persist_graph"))) TS_Persister_persist_graph(uint64_t this_arg, uint64_t network_graph) {
8102 void* this_arg_ptr = untag_ptr(this_arg);
8103 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8104 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8105 LDKNetworkGraph network_graph_conv;
8106 network_graph_conv.inner = untag_ptr(network_graph);
8107 network_graph_conv.is_owned = ptr_is_owned(network_graph);
8108 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
8109 network_graph_conv.is_owned = false;
8110 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8111 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
8112 return tag_ptr(ret_conv, true);
8115 uint64_t __attribute__((export_name("TS_Persister_persist_scorer"))) TS_Persister_persist_scorer(uint64_t this_arg, uint64_t scorer) {
8116 void* this_arg_ptr = untag_ptr(this_arg);
8117 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8118 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8119 LDKMultiThreadedLockableScore scorer_conv;
8120 scorer_conv.inner = untag_ptr(scorer);
8121 scorer_conv.is_owned = ptr_is_owned(scorer);
8122 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
8123 scorer_conv.is_owned = false;
8124 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8125 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv);
8126 return tag_ptr(ret_conv, true);
8129 typedef struct LDKListen_JCalls {
8130 atomic_size_t refcnt;
8131 uint32_t instance_ptr;
8133 static void LDKListen_JCalls_free(void* this_arg) {
8134 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8135 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8139 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8140 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8141 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8142 memcpy(header_arr->elems, *header, 80);
8143 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8144 uint64_tArray txdata_arr = NULL;
8145 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8146 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8147 for (size_t c = 0; c < txdata_var.datalen; c++) {
8148 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8149 *txdata_conv_28_conv = txdata_var.data[c];
8150 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8153 FREE(txdata_var.data);
8154 int32_t height_conv = height;
8155 js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8157 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
8158 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8159 LDKu8slice block_var = block;
8160 int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
8161 memcpy(block_arr->elems, block_var.data, block_var.datalen);
8162 int32_t height_conv = height;
8163 js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
8165 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8166 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8167 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8168 memcpy(header_arr->elems, *header, 80);
8169 int32_t height_conv = height;
8170 js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8172 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
8173 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
8174 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8176 static inline LDKListen LDKListen_init (JSValue o) {
8177 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
8178 atomic_init(&calls->refcnt, 1);
8179 calls->instance_ptr = o;
8182 .this_arg = (void*) calls,
8183 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
8184 .block_connected = block_connected_LDKListen_jcall,
8185 .block_disconnected = block_disconnected_LDKListen_jcall,
8186 .free = LDKListen_JCalls_free,
8190 uint64_t __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue o) {
8191 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
8192 *res_ptr = LDKListen_init(o);
8193 return tag_ptr(res_ptr, true);
8195 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) {
8196 void* this_arg_ptr = untag_ptr(this_arg);
8197 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8198 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8199 unsigned char header_arr[80];
8200 CHECK(header->arr_len == 80);
8201 memcpy(header_arr, header->elems, 80); FREE(header);
8202 unsigned char (*header_ref)[80] = &header_arr;
8203 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8204 txdata_constr.datalen = txdata->arr_len;
8205 if (txdata_constr.datalen > 0)
8206 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8208 txdata_constr.data = NULL;
8209 uint64_t* txdata_vals = txdata->elems;
8210 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8211 uint64_t txdata_conv_28 = txdata_vals[c];
8212 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8213 CHECK_ACCESS(txdata_conv_28_ptr);
8214 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8215 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8216 txdata_constr.data[c] = txdata_conv_28_conv;
8219 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8222 void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint64_t this_arg, int8_tArray block, int32_t height) {
8223 void* this_arg_ptr = untag_ptr(this_arg);
8224 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8225 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8226 LDKu8slice block_ref;
8227 block_ref.datalen = block->arr_len;
8228 block_ref.data = block->elems;
8229 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
8233 void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height) {
8234 void* this_arg_ptr = untag_ptr(this_arg);
8235 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8236 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8237 unsigned char header_arr[80];
8238 CHECK(header->arr_len == 80);
8239 memcpy(header_arr, header->elems, 80); FREE(header);
8240 unsigned char (*header_ref)[80] = &header_arr;
8241 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
8244 typedef struct LDKConfirm_JCalls {
8245 atomic_size_t refcnt;
8246 uint32_t instance_ptr;
8247 } LDKConfirm_JCalls;
8248 static void LDKConfirm_JCalls_free(void* this_arg) {
8249 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8250 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8254 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8255 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8256 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8257 memcpy(header_arr->elems, *header, 80);
8258 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8259 uint64_tArray txdata_arr = NULL;
8260 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8261 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8262 for (size_t c = 0; c < txdata_var.datalen; c++) {
8263 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8264 *txdata_conv_28_conv = txdata_var.data[c];
8265 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8268 FREE(txdata_var.data);
8269 int32_t height_conv = height;
8270 js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8272 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
8273 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8274 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
8275 memcpy(txid_arr->elems, *txid, 32);
8276 js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
8278 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8279 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8280 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8281 memcpy(header_arr->elems, *header, 80);
8282 int32_t height_conv = height;
8283 js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8285 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
8286 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8287 ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, 0, 0, 0, 0, 0, 0);
8288 LDKCVec_TxidZ ret_constr;
8289 ret_constr.datalen = ret->arr_len;
8290 if (ret_constr.datalen > 0)
8291 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
8293 ret_constr.data = NULL;
8294 int8_tArray* ret_vals = (void*) ret->elems;
8295 for (size_t m = 0; m < ret_constr.datalen; m++) {
8296 int8_tArray ret_conv_12 = ret_vals[m];
8297 LDKThirtyTwoBytes ret_conv_12_ref;
8298 CHECK(ret_conv_12->arr_len == 32);
8299 memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
8300 ret_constr.data[m] = ret_conv_12_ref;
8305 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
8306 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
8307 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8309 static inline LDKConfirm LDKConfirm_init (JSValue o) {
8310 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
8311 atomic_init(&calls->refcnt, 1);
8312 calls->instance_ptr = o;
8315 .this_arg = (void*) calls,
8316 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
8317 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
8318 .best_block_updated = best_block_updated_LDKConfirm_jcall,
8319 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
8320 .free = LDKConfirm_JCalls_free,
8324 uint64_t __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValue o) {
8325 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
8326 *res_ptr = LDKConfirm_init(o);
8327 return tag_ptr(res_ptr, true);
8329 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) {
8330 void* this_arg_ptr = untag_ptr(this_arg);
8331 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8332 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8333 unsigned char header_arr[80];
8334 CHECK(header->arr_len == 80);
8335 memcpy(header_arr, header->elems, 80); FREE(header);
8336 unsigned char (*header_ref)[80] = &header_arr;
8337 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8338 txdata_constr.datalen = txdata->arr_len;
8339 if (txdata_constr.datalen > 0)
8340 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8342 txdata_constr.data = NULL;
8343 uint64_t* txdata_vals = txdata->elems;
8344 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8345 uint64_t txdata_conv_28 = txdata_vals[c];
8346 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8347 CHECK_ACCESS(txdata_conv_28_ptr);
8348 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8349 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8350 txdata_constr.data[c] = txdata_conv_28_conv;
8353 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8356 void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid) {
8357 void* this_arg_ptr = untag_ptr(this_arg);
8358 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8359 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8360 unsigned char txid_arr[32];
8361 CHECK(txid->arr_len == 32);
8362 memcpy(txid_arr, txid->elems, 32); FREE(txid);
8363 unsigned char (*txid_ref)[32] = &txid_arr;
8364 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
8367 void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height) {
8368 void* this_arg_ptr = untag_ptr(this_arg);
8369 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8370 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8371 unsigned char header_arr[80];
8372 CHECK(header->arr_len == 80);
8373 memcpy(header_arr, header->elems, 80); FREE(header);
8374 unsigned char (*header_ref)[80] = &header_arr;
8375 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
8378 ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
8379 void* this_arg_ptr = untag_ptr(this_arg);
8380 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8381 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8382 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
8383 ptrArray ret_arr = NULL;
8384 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
8385 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
8386 for (size_t m = 0; m < ret_var.datalen; m++) {
8387 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
8388 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
8389 ret_arr_ptr[m] = ret_conv_12_arr;
8396 typedef struct LDKPersist_JCalls {
8397 atomic_size_t refcnt;
8398 uint32_t instance_ptr;
8399 } LDKPersist_JCalls;
8400 static void LDKPersist_JCalls_free(void* this_arg) {
8401 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8402 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8406 LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8407 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8408 LDKOutPoint channel_id_var = channel_id;
8409 uint64_t channel_id_ref = 0;
8410 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8411 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8412 LDKChannelMonitor data_var = *data;
8413 uint64_t data_ref = 0;
8414 data_var = ChannelMonitor_clone(&data_var);
8415 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8416 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8417 LDKMonitorUpdateId update_id_var = update_id;
8418 uint64_t update_id_ref = 0;
8419 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8420 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8421 uint32_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 53, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
8422 void* ret_ptr = untag_ptr(ret);
8423 CHECK_ACCESS(ret_ptr);
8424 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8425 FREE(untag_ptr(ret));
8428 LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8429 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8430 LDKOutPoint channel_id_var = channel_id;
8431 uint64_t channel_id_ref = 0;
8432 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8433 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8434 LDKChannelMonitorUpdate update_var = *update;
8435 uint64_t update_ref = 0;
8436 update_var = ChannelMonitorUpdate_clone(&update_var);
8437 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
8438 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
8439 LDKChannelMonitor data_var = *data;
8440 uint64_t data_ref = 0;
8441 data_var = ChannelMonitor_clone(&data_var);
8442 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8443 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8444 LDKMonitorUpdateId update_id_var = update_id;
8445 uint64_t update_id_ref = 0;
8446 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8447 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8448 uint32_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 54, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
8449 void* ret_ptr = untag_ptr(ret);
8450 CHECK_ACCESS(ret_ptr);
8451 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8452 FREE(untag_ptr(ret));
8455 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
8456 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
8457 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8459 static inline LDKPersist LDKPersist_init (JSValue o) {
8460 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
8461 atomic_init(&calls->refcnt, 1);
8462 calls->instance_ptr = o;
8465 .this_arg = (void*) calls,
8466 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
8467 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
8468 .free = LDKPersist_JCalls_free,
8472 uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValue o) {
8473 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
8474 *res_ptr = LDKPersist_init(o);
8475 return tag_ptr(res_ptr, true);
8477 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) {
8478 void* this_arg_ptr = untag_ptr(this_arg);
8479 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8480 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8481 LDKOutPoint channel_id_conv;
8482 channel_id_conv.inner = untag_ptr(channel_id);
8483 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8484 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8485 channel_id_conv = OutPoint_clone(&channel_id_conv);
8486 LDKChannelMonitor data_conv;
8487 data_conv.inner = untag_ptr(data);
8488 data_conv.is_owned = ptr_is_owned(data);
8489 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8490 data_conv.is_owned = false;
8491 LDKMonitorUpdateId update_id_conv;
8492 update_id_conv.inner = untag_ptr(update_id);
8493 update_id_conv.is_owned = ptr_is_owned(update_id);
8494 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8495 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8496 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8497 *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
8498 return tag_ptr(ret_conv, true);
8501 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) {
8502 void* this_arg_ptr = untag_ptr(this_arg);
8503 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8504 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8505 LDKOutPoint channel_id_conv;
8506 channel_id_conv.inner = untag_ptr(channel_id);
8507 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8508 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8509 channel_id_conv = OutPoint_clone(&channel_id_conv);
8510 LDKChannelMonitorUpdate update_conv;
8511 update_conv.inner = untag_ptr(update);
8512 update_conv.is_owned = ptr_is_owned(update);
8513 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
8514 update_conv.is_owned = false;
8515 LDKChannelMonitor data_conv;
8516 data_conv.inner = untag_ptr(data);
8517 data_conv.is_owned = ptr_is_owned(data);
8518 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8519 data_conv.is_owned = false;
8520 LDKMonitorUpdateId update_id_conv;
8521 update_id_conv.inner = untag_ptr(update_id);
8522 update_id_conv.is_owned = ptr_is_owned(update_id);
8523 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8524 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8525 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8526 *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
8527 return tag_ptr(ret_conv, true);
8530 typedef struct LDKChannelMessageHandler_JCalls {
8531 atomic_size_t refcnt;
8532 uint32_t instance_ptr;
8533 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
8534 } LDKChannelMessageHandler_JCalls;
8535 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
8536 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8537 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8541 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
8542 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8543 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8544 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8545 LDKInitFeatures their_features_var = their_features;
8546 uint64_t their_features_ref = 0;
8547 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8548 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8549 LDKOpenChannel msg_var = *msg;
8550 uint64_t msg_ref = 0;
8551 msg_var = OpenChannel_clone(&msg_var);
8552 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8553 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8554 js_invoke_function_ubbuuu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8556 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
8557 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8558 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8559 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8560 LDKInitFeatures their_features_var = their_features;
8561 uint64_t their_features_ref = 0;
8562 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8563 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8564 LDKAcceptChannel msg_var = *msg;
8565 uint64_t msg_ref = 0;
8566 msg_var = AcceptChannel_clone(&msg_var);
8567 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8568 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8569 js_invoke_function_ubbuuu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8571 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
8572 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8573 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8574 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8575 LDKFundingCreated msg_var = *msg;
8576 uint64_t msg_ref = 0;
8577 msg_var = FundingCreated_clone(&msg_var);
8578 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8579 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8580 js_invoke_function_ubuuuu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8582 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
8583 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8584 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8585 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8586 LDKFundingSigned msg_var = *msg;
8587 uint64_t msg_ref = 0;
8588 msg_var = FundingSigned_clone(&msg_var);
8589 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8590 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8591 js_invoke_function_ubuuuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8593 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
8594 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8595 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8596 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8597 LDKChannelReady msg_var = *msg;
8598 uint64_t msg_ref = 0;
8599 msg_var = ChannelReady_clone(&msg_var);
8600 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8601 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8602 js_invoke_function_ubuuuu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8604 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
8605 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8606 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8607 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8608 LDKInitFeatures their_features_var = *their_features;
8609 uint64_t their_features_ref = 0;
8610 their_features_var = InitFeatures_clone(&their_features_var);
8611 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8612 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8613 LDKShutdown msg_var = *msg;
8614 uint64_t msg_ref = 0;
8615 msg_var = Shutdown_clone(&msg_var);
8616 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8617 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8618 js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8620 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
8621 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8622 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8623 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8624 LDKClosingSigned msg_var = *msg;
8625 uint64_t msg_ref = 0;
8626 msg_var = ClosingSigned_clone(&msg_var);
8627 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8628 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8629 js_invoke_function_ubuuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8631 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
8632 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8633 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8634 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8635 LDKUpdateAddHTLC msg_var = *msg;
8636 uint64_t msg_ref = 0;
8637 msg_var = UpdateAddHTLC_clone(&msg_var);
8638 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8639 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8640 js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8642 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
8643 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8644 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8645 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8646 LDKUpdateFulfillHTLC msg_var = *msg;
8647 uint64_t msg_ref = 0;
8648 msg_var = UpdateFulfillHTLC_clone(&msg_var);
8649 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8650 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8651 js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8653 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
8654 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8655 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8656 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8657 LDKUpdateFailHTLC msg_var = *msg;
8658 uint64_t msg_ref = 0;
8659 msg_var = UpdateFailHTLC_clone(&msg_var);
8660 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8661 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8662 js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8664 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
8665 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8666 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8667 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8668 LDKUpdateFailMalformedHTLC msg_var = *msg;
8669 uint64_t msg_ref = 0;
8670 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
8671 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8672 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8673 js_invoke_function_ubuuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8675 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
8676 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8677 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8678 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8679 LDKCommitmentSigned msg_var = *msg;
8680 uint64_t msg_ref = 0;
8681 msg_var = CommitmentSigned_clone(&msg_var);
8682 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8683 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8684 js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8686 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
8687 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8688 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8689 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8690 LDKRevokeAndACK msg_var = *msg;
8691 uint64_t msg_ref = 0;
8692 msg_var = RevokeAndACK_clone(&msg_var);
8693 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8694 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8695 js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8697 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
8698 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8699 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8700 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8701 LDKUpdateFee msg_var = *msg;
8702 uint64_t msg_ref = 0;
8703 msg_var = UpdateFee_clone(&msg_var);
8704 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8705 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8706 js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8708 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
8709 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8710 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8711 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8712 LDKAnnouncementSignatures msg_var = *msg;
8713 uint64_t msg_ref = 0;
8714 msg_var = AnnouncementSignatures_clone(&msg_var);
8715 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8716 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8717 js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8719 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
8720 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8721 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8722 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8723 jboolean no_connection_possible_conv = no_connection_possible;
8724 js_invoke_function_uuuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
8726 void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
8727 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8728 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8729 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8730 LDKInit msg_var = *msg;
8731 uint64_t msg_ref = 0;
8732 msg_var = Init_clone(&msg_var);
8733 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8734 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8735 js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8737 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
8738 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8739 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8740 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8741 LDKChannelReestablish msg_var = *msg;
8742 uint64_t msg_ref = 0;
8743 msg_var = ChannelReestablish_clone(&msg_var);
8744 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8745 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8746 js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8748 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
8749 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8750 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8751 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8752 LDKChannelUpdate msg_var = *msg;
8753 uint64_t msg_ref = 0;
8754 msg_var = ChannelUpdate_clone(&msg_var);
8755 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8756 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8757 js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8759 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
8760 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8761 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8762 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8763 LDKErrorMessage msg_var = *msg;
8764 uint64_t msg_ref = 0;
8765 msg_var = ErrorMessage_clone(&msg_var);
8766 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8767 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8768 js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8770 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
8771 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
8772 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8773 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
8775 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
8776 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
8777 atomic_init(&calls->refcnt, 1);
8778 calls->instance_ptr = o;
8780 LDKChannelMessageHandler ret = {
8781 .this_arg = (void*) calls,
8782 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
8783 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
8784 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
8785 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
8786 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
8787 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
8788 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
8789 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
8790 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
8791 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
8792 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
8793 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
8794 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
8795 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
8796 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
8797 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
8798 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
8799 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
8800 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
8801 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
8802 .free = LDKChannelMessageHandler_JCalls_free,
8803 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
8805 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
8808 uint64_t __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChannelMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
8809 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
8810 *res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
8811 return tag_ptr(res_ptr, true);
8813 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) {
8814 void* this_arg_ptr = untag_ptr(this_arg);
8815 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8816 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8817 LDKPublicKey their_node_id_ref;
8818 CHECK(their_node_id->arr_len == 33);
8819 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8820 LDKInitFeatures their_features_conv;
8821 their_features_conv.inner = untag_ptr(their_features);
8822 their_features_conv.is_owned = ptr_is_owned(their_features);
8823 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8824 their_features_conv = InitFeatures_clone(&their_features_conv);
8825 LDKOpenChannel msg_conv;
8826 msg_conv.inner = untag_ptr(msg);
8827 msg_conv.is_owned = ptr_is_owned(msg);
8828 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8829 msg_conv.is_owned = false;
8830 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8833 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) {
8834 void* this_arg_ptr = untag_ptr(this_arg);
8835 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8836 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8837 LDKPublicKey their_node_id_ref;
8838 CHECK(their_node_id->arr_len == 33);
8839 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8840 LDKInitFeatures their_features_conv;
8841 their_features_conv.inner = untag_ptr(their_features);
8842 their_features_conv.is_owned = ptr_is_owned(their_features);
8843 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8844 their_features_conv = InitFeatures_clone(&their_features_conv);
8845 LDKAcceptChannel msg_conv;
8846 msg_conv.inner = untag_ptr(msg);
8847 msg_conv.is_owned = ptr_is_owned(msg);
8848 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8849 msg_conv.is_owned = false;
8850 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8853 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) {
8854 void* this_arg_ptr = untag_ptr(this_arg);
8855 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8856 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8857 LDKPublicKey their_node_id_ref;
8858 CHECK(their_node_id->arr_len == 33);
8859 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8860 LDKFundingCreated msg_conv;
8861 msg_conv.inner = untag_ptr(msg);
8862 msg_conv.is_owned = ptr_is_owned(msg);
8863 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8864 msg_conv.is_owned = false;
8865 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8868 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) {
8869 void* this_arg_ptr = untag_ptr(this_arg);
8870 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8871 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8872 LDKPublicKey their_node_id_ref;
8873 CHECK(their_node_id->arr_len == 33);
8874 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8875 LDKFundingSigned msg_conv;
8876 msg_conv.inner = untag_ptr(msg);
8877 msg_conv.is_owned = ptr_is_owned(msg);
8878 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8879 msg_conv.is_owned = false;
8880 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8883 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) {
8884 void* this_arg_ptr = untag_ptr(this_arg);
8885 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8886 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8887 LDKPublicKey their_node_id_ref;
8888 CHECK(their_node_id->arr_len == 33);
8889 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8890 LDKChannelReady msg_conv;
8891 msg_conv.inner = untag_ptr(msg);
8892 msg_conv.is_owned = ptr_is_owned(msg);
8893 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8894 msg_conv.is_owned = false;
8895 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8898 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) {
8899 void* this_arg_ptr = untag_ptr(this_arg);
8900 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8901 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8902 LDKPublicKey their_node_id_ref;
8903 CHECK(their_node_id->arr_len == 33);
8904 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8905 LDKInitFeatures their_features_conv;
8906 their_features_conv.inner = untag_ptr(their_features);
8907 their_features_conv.is_owned = ptr_is_owned(their_features);
8908 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8909 their_features_conv.is_owned = false;
8910 LDKShutdown msg_conv;
8911 msg_conv.inner = untag_ptr(msg);
8912 msg_conv.is_owned = ptr_is_owned(msg);
8913 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8914 msg_conv.is_owned = false;
8915 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
8918 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) {
8919 void* this_arg_ptr = untag_ptr(this_arg);
8920 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8921 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8922 LDKPublicKey their_node_id_ref;
8923 CHECK(their_node_id->arr_len == 33);
8924 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8925 LDKClosingSigned msg_conv;
8926 msg_conv.inner = untag_ptr(msg);
8927 msg_conv.is_owned = ptr_is_owned(msg);
8928 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8929 msg_conv.is_owned = false;
8930 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8933 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) {
8934 void* this_arg_ptr = untag_ptr(this_arg);
8935 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8936 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8937 LDKPublicKey their_node_id_ref;
8938 CHECK(their_node_id->arr_len == 33);
8939 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8940 LDKUpdateAddHTLC msg_conv;
8941 msg_conv.inner = untag_ptr(msg);
8942 msg_conv.is_owned = ptr_is_owned(msg);
8943 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8944 msg_conv.is_owned = false;
8945 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8948 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) {
8949 void* this_arg_ptr = untag_ptr(this_arg);
8950 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8951 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8952 LDKPublicKey their_node_id_ref;
8953 CHECK(their_node_id->arr_len == 33);
8954 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8955 LDKUpdateFulfillHTLC msg_conv;
8956 msg_conv.inner = untag_ptr(msg);
8957 msg_conv.is_owned = ptr_is_owned(msg);
8958 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8959 msg_conv.is_owned = false;
8960 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8963 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) {
8964 void* this_arg_ptr = untag_ptr(this_arg);
8965 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8966 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8967 LDKPublicKey their_node_id_ref;
8968 CHECK(their_node_id->arr_len == 33);
8969 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8970 LDKUpdateFailHTLC msg_conv;
8971 msg_conv.inner = untag_ptr(msg);
8972 msg_conv.is_owned = ptr_is_owned(msg);
8973 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8974 msg_conv.is_owned = false;
8975 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8978 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) {
8979 void* this_arg_ptr = untag_ptr(this_arg);
8980 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8981 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8982 LDKPublicKey their_node_id_ref;
8983 CHECK(their_node_id->arr_len == 33);
8984 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8985 LDKUpdateFailMalformedHTLC msg_conv;
8986 msg_conv.inner = untag_ptr(msg);
8987 msg_conv.is_owned = ptr_is_owned(msg);
8988 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8989 msg_conv.is_owned = false;
8990 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8993 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) {
8994 void* this_arg_ptr = untag_ptr(this_arg);
8995 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8996 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8997 LDKPublicKey their_node_id_ref;
8998 CHECK(their_node_id->arr_len == 33);
8999 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9000 LDKCommitmentSigned msg_conv;
9001 msg_conv.inner = untag_ptr(msg);
9002 msg_conv.is_owned = ptr_is_owned(msg);
9003 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9004 msg_conv.is_owned = false;
9005 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9008 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) {
9009 void* this_arg_ptr = untag_ptr(this_arg);
9010 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9011 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9012 LDKPublicKey their_node_id_ref;
9013 CHECK(their_node_id->arr_len == 33);
9014 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9015 LDKRevokeAndACK msg_conv;
9016 msg_conv.inner = untag_ptr(msg);
9017 msg_conv.is_owned = ptr_is_owned(msg);
9018 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9019 msg_conv.is_owned = false;
9020 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9023 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) {
9024 void* this_arg_ptr = untag_ptr(this_arg);
9025 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9026 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9027 LDKPublicKey their_node_id_ref;
9028 CHECK(their_node_id->arr_len == 33);
9029 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9030 LDKUpdateFee msg_conv;
9031 msg_conv.inner = untag_ptr(msg);
9032 msg_conv.is_owned = ptr_is_owned(msg);
9033 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9034 msg_conv.is_owned = false;
9035 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9038 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) {
9039 void* this_arg_ptr = untag_ptr(this_arg);
9040 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9041 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9042 LDKPublicKey their_node_id_ref;
9043 CHECK(their_node_id->arr_len == 33);
9044 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9045 LDKAnnouncementSignatures msg_conv;
9046 msg_conv.inner = untag_ptr(msg);
9047 msg_conv.is_owned = ptr_is_owned(msg);
9048 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9049 msg_conv.is_owned = false;
9050 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9053 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) {
9054 void* this_arg_ptr = untag_ptr(this_arg);
9055 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9056 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9057 LDKPublicKey their_node_id_ref;
9058 CHECK(their_node_id->arr_len == 33);
9059 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9060 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
9063 void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9064 void* this_arg_ptr = untag_ptr(this_arg);
9065 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9066 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9067 LDKPublicKey their_node_id_ref;
9068 CHECK(their_node_id->arr_len == 33);
9069 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9071 msg_conv.inner = untag_ptr(msg);
9072 msg_conv.is_owned = ptr_is_owned(msg);
9073 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9074 msg_conv.is_owned = false;
9075 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9078 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) {
9079 void* this_arg_ptr = untag_ptr(this_arg);
9080 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9081 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9082 LDKPublicKey their_node_id_ref;
9083 CHECK(their_node_id->arr_len == 33);
9084 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9085 LDKChannelReestablish msg_conv;
9086 msg_conv.inner = untag_ptr(msg);
9087 msg_conv.is_owned = ptr_is_owned(msg);
9088 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9089 msg_conv.is_owned = false;
9090 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9093 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) {
9094 void* this_arg_ptr = untag_ptr(this_arg);
9095 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9096 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9097 LDKPublicKey their_node_id_ref;
9098 CHECK(their_node_id->arr_len == 33);
9099 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9100 LDKChannelUpdate msg_conv;
9101 msg_conv.inner = untag_ptr(msg);
9102 msg_conv.is_owned = ptr_is_owned(msg);
9103 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9104 msg_conv.is_owned = false;
9105 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9108 void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9109 void* this_arg_ptr = untag_ptr(this_arg);
9110 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9111 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9112 LDKPublicKey their_node_id_ref;
9113 CHECK(their_node_id->arr_len == 33);
9114 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9115 LDKErrorMessage msg_conv;
9116 msg_conv.inner = untag_ptr(msg);
9117 msg_conv.is_owned = ptr_is_owned(msg);
9118 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9119 msg_conv.is_owned = false;
9120 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9123 typedef struct LDKRoutingMessageHandler_JCalls {
9124 atomic_size_t refcnt;
9125 uint32_t instance_ptr;
9126 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9127 } LDKRoutingMessageHandler_JCalls;
9128 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
9129 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9130 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9134 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
9135 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9136 LDKNodeAnnouncement msg_var = *msg;
9137 uint64_t msg_ref = 0;
9138 msg_var = NodeAnnouncement_clone(&msg_var);
9139 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9140 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9141 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 75, msg_ref, 0, 0, 0, 0, 0);
9142 void* ret_ptr = untag_ptr(ret);
9143 CHECK_ACCESS(ret_ptr);
9144 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9145 FREE(untag_ptr(ret));
9148 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
9149 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9150 LDKChannelAnnouncement msg_var = *msg;
9151 uint64_t msg_ref = 0;
9152 msg_var = ChannelAnnouncement_clone(&msg_var);
9153 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9154 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9155 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 76, msg_ref, 0, 0, 0, 0, 0);
9156 void* ret_ptr = untag_ptr(ret);
9157 CHECK_ACCESS(ret_ptr);
9158 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9159 FREE(untag_ptr(ret));
9162 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
9163 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9164 LDKChannelUpdate msg_var = *msg;
9165 uint64_t msg_ref = 0;
9166 msg_var = ChannelUpdate_clone(&msg_var);
9167 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9168 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9169 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 77, msg_ref, 0, 0, 0, 0, 0);
9170 void* ret_ptr = untag_ptr(ret);
9171 CHECK_ACCESS(ret_ptr);
9172 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9173 FREE(untag_ptr(ret));
9176 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
9177 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9178 int64_t starting_point_conv = starting_point;
9179 int8_t batch_amount_conv = batch_amount;
9180 uint64_tArray ret = (uint64_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 78, starting_point_conv, batch_amount_conv, 0, 0, 0, 0);
9181 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
9182 ret_constr.datalen = ret->arr_len;
9183 if (ret_constr.datalen > 0)
9184 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
9186 ret_constr.data = NULL;
9187 uint64_t* ret_vals = ret->elems;
9188 for (size_t h = 0; h < ret_constr.datalen; h++) {
9189 uint64_t ret_conv_59 = ret_vals[h];
9190 void* ret_conv_59_ptr = untag_ptr(ret_conv_59);
9191 CHECK_ACCESS(ret_conv_59_ptr);
9192 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
9193 FREE(untag_ptr(ret_conv_59));
9194 ret_constr.data[h] = ret_conv_59_conv;
9199 LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
9200 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9201 int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
9202 memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
9203 int8_t batch_amount_conv = batch_amount;
9204 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 79, (uint32_t)starting_point_arr, batch_amount_conv, 0, 0, 0, 0);
9205 LDKCVec_NodeAnnouncementZ ret_constr;
9206 ret_constr.datalen = ret->arr_len;
9207 if (ret_constr.datalen > 0)
9208 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
9210 ret_constr.data = NULL;
9211 uint64_t* ret_vals = ret->elems;
9212 for (size_t s = 0; s < ret_constr.datalen; s++) {
9213 uint64_t ret_conv_18 = ret_vals[s];
9214 LDKNodeAnnouncement ret_conv_18_conv;
9215 ret_conv_18_conv.inner = untag_ptr(ret_conv_18);
9216 ret_conv_18_conv.is_owned = ptr_is_owned(ret_conv_18);
9217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
9218 ret_constr.data[s] = ret_conv_18_conv;
9223 void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
9224 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9225 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9226 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9227 LDKInit init_var = *init;
9228 uint64_t init_ref = 0;
9229 init_var = Init_clone(&init_var);
9230 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
9231 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
9232 js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
9234 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
9235 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9236 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9237 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9238 LDKReplyChannelRange msg_var = msg;
9239 uint64_t msg_ref = 0;
9240 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9241 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9242 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9243 void* ret_ptr = untag_ptr(ret);
9244 CHECK_ACCESS(ret_ptr);
9245 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9246 FREE(untag_ptr(ret));
9249 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
9250 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9251 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9252 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9253 LDKReplyShortChannelIdsEnd msg_var = msg;
9254 uint64_t msg_ref = 0;
9255 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9256 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9257 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9258 void* ret_ptr = untag_ptr(ret);
9259 CHECK_ACCESS(ret_ptr);
9260 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9261 FREE(untag_ptr(ret));
9264 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
9265 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9266 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9267 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9268 LDKQueryChannelRange msg_var = msg;
9269 uint64_t msg_ref = 0;
9270 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9271 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9272 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9273 void* ret_ptr = untag_ptr(ret);
9274 CHECK_ACCESS(ret_ptr);
9275 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9276 FREE(untag_ptr(ret));
9279 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
9280 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9281 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9282 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9283 LDKQueryShortChannelIds msg_var = msg;
9284 uint64_t msg_ref = 0;
9285 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9286 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9287 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9288 void* ret_ptr = untag_ptr(ret);
9289 CHECK_ACCESS(ret_ptr);
9290 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9291 FREE(untag_ptr(ret));
9294 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
9295 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
9296 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9297 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9299 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9300 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
9301 atomic_init(&calls->refcnt, 1);
9302 calls->instance_ptr = o;
9304 LDKRoutingMessageHandler ret = {
9305 .this_arg = (void*) calls,
9306 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
9307 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
9308 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
9309 .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
9310 .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
9311 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
9312 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
9313 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
9314 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
9315 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
9316 .free = LDKRoutingMessageHandler_JCalls_free,
9317 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9319 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9322 uint64_t __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRoutingMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9323 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9324 *res_ptr = LDKRoutingMessageHandler_init(o, MessageSendEventsProvider);
9325 return tag_ptr(res_ptr, true);
9327 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint64_t this_arg, uint64_t msg) {
9328 void* this_arg_ptr = untag_ptr(this_arg);
9329 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9330 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9331 LDKNodeAnnouncement msg_conv;
9332 msg_conv.inner = untag_ptr(msg);
9333 msg_conv.is_owned = ptr_is_owned(msg);
9334 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9335 msg_conv.is_owned = false;
9336 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9337 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
9338 return tag_ptr(ret_conv, true);
9341 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint64_t this_arg, uint64_t msg) {
9342 void* this_arg_ptr = untag_ptr(this_arg);
9343 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9344 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9345 LDKChannelAnnouncement msg_conv;
9346 msg_conv.inner = untag_ptr(msg);
9347 msg_conv.is_owned = ptr_is_owned(msg);
9348 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9349 msg_conv.is_owned = false;
9350 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9351 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
9352 return tag_ptr(ret_conv, true);
9355 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint64_t this_arg, uint64_t msg) {
9356 void* this_arg_ptr = untag_ptr(this_arg);
9357 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9358 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9359 LDKChannelUpdate msg_conv;
9360 msg_conv.inner = untag_ptr(msg);
9361 msg_conv.is_owned = ptr_is_owned(msg);
9362 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9363 msg_conv.is_owned = false;
9364 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9365 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
9366 return tag_ptr(ret_conv, true);
9369 uint64_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcements"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint64_t this_arg, int64_t starting_point, int8_t batch_amount) {
9370 void* this_arg_ptr = untag_ptr(this_arg);
9371 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9372 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9373 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
9374 uint64_tArray ret_arr = NULL;
9375 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9376 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9377 for (size_t h = 0; h < ret_var.datalen; h++) {
9378 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
9379 *ret_conv_59_conv = ret_var.data[h];
9380 ret_arr_ptr[h] = tag_ptr(ret_conv_59_conv, true);
9387 uint64_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcements"))) TS_RoutingMessageHandler_get_next_node_announcements(uint64_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
9388 void* this_arg_ptr = untag_ptr(this_arg);
9389 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9390 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9391 LDKPublicKey starting_point_ref;
9392 CHECK(starting_point->arr_len == 33);
9393 memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
9394 LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
9395 uint64_tArray ret_arr = NULL;
9396 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9397 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9398 for (size_t s = 0; s < ret_var.datalen; s++) {
9399 LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
9400 uint64_t ret_conv_18_ref = 0;
9401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
9402 ret_conv_18_ref = tag_ptr(ret_conv_18_var.inner, ret_conv_18_var.is_owned);
9403 ret_arr_ptr[s] = ret_conv_18_ref;
9410 void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
9411 void* this_arg_ptr = untag_ptr(this_arg);
9412 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9413 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9414 LDKPublicKey their_node_id_ref;
9415 CHECK(their_node_id->arr_len == 33);
9416 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9418 init_conv.inner = untag_ptr(init);
9419 init_conv.is_owned = ptr_is_owned(init);
9420 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
9421 init_conv.is_owned = false;
9422 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
9425 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) {
9426 void* this_arg_ptr = untag_ptr(this_arg);
9427 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9428 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9429 LDKPublicKey their_node_id_ref;
9430 CHECK(their_node_id->arr_len == 33);
9431 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9432 LDKReplyChannelRange msg_conv;
9433 msg_conv.inner = untag_ptr(msg);
9434 msg_conv.is_owned = ptr_is_owned(msg);
9435 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9436 msg_conv = ReplyChannelRange_clone(&msg_conv);
9437 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9438 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9439 return tag_ptr(ret_conv, true);
9442 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) {
9443 void* this_arg_ptr = untag_ptr(this_arg);
9444 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9445 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9446 LDKPublicKey their_node_id_ref;
9447 CHECK(their_node_id->arr_len == 33);
9448 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9449 LDKReplyShortChannelIdsEnd msg_conv;
9450 msg_conv.inner = untag_ptr(msg);
9451 msg_conv.is_owned = ptr_is_owned(msg);
9452 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9453 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
9454 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9455 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9456 return tag_ptr(ret_conv, true);
9459 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) {
9460 void* this_arg_ptr = untag_ptr(this_arg);
9461 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9462 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9463 LDKPublicKey their_node_id_ref;
9464 CHECK(their_node_id->arr_len == 33);
9465 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9466 LDKQueryChannelRange msg_conv;
9467 msg_conv.inner = untag_ptr(msg);
9468 msg_conv.is_owned = ptr_is_owned(msg);
9469 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9470 msg_conv = QueryChannelRange_clone(&msg_conv);
9471 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9472 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9473 return tag_ptr(ret_conv, true);
9476 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) {
9477 void* this_arg_ptr = untag_ptr(this_arg);
9478 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9479 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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 LDKQueryShortChannelIds 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 = QueryShortChannelIds_clone(&msg_conv);
9488 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9489 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9490 return tag_ptr(ret_conv, true);
9493 typedef struct LDKCustomMessageReader_JCalls {
9494 atomic_size_t refcnt;
9495 uint32_t instance_ptr;
9496 } LDKCustomMessageReader_JCalls;
9497 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
9498 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9499 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9503 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
9504 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9505 int16_t message_type_conv = message_type;
9506 LDKu8slice buffer_var = buffer;
9507 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
9508 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
9509 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
9510 void* ret_ptr = untag_ptr(ret);
9511 CHECK_ACCESS(ret_ptr);
9512 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
9513 FREE(untag_ptr(ret));
9516 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
9517 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
9518 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9520 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JSValue o) {
9521 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
9522 atomic_init(&calls->refcnt, 1);
9523 calls->instance_ptr = o;
9525 LDKCustomMessageReader ret = {
9526 .this_arg = (void*) calls,
9527 .read = read_LDKCustomMessageReader_jcall,
9528 .free = LDKCustomMessageReader_JCalls_free,
9532 uint64_t __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustomMessageReader_new(JSValue o) {
9533 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
9534 *res_ptr = LDKCustomMessageReader_init(o);
9535 return tag_ptr(res_ptr, true);
9537 uint64_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint64_t this_arg, int16_t message_type, int8_tArray buffer) {
9538 void* this_arg_ptr = untag_ptr(this_arg);
9539 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9540 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
9541 LDKu8slice buffer_ref;
9542 buffer_ref.datalen = buffer->arr_len;
9543 buffer_ref.data = buffer->elems;
9544 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
9545 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
9547 return tag_ptr(ret_conv, true);
9550 typedef struct LDKCustomMessageHandler_JCalls {
9551 atomic_size_t refcnt;
9552 uint32_t instance_ptr;
9553 LDKCustomMessageReader_JCalls* CustomMessageReader;
9554 } LDKCustomMessageHandler_JCalls;
9555 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
9556 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9557 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9561 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
9562 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9563 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
9565 int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
9566 memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
9567 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 86, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0);
9568 void* ret_ptr = untag_ptr(ret);
9569 CHECK_ACCESS(ret_ptr);
9570 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9571 FREE(untag_ptr(ret));
9574 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
9575 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9576 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, 0, 0, 0, 0, 0, 0);
9577 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
9578 ret_constr.datalen = ret->arr_len;
9579 if (ret_constr.datalen > 0)
9580 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
9582 ret_constr.data = NULL;
9583 uint64_t* ret_vals = ret->elems;
9584 for (size_t z = 0; z < ret_constr.datalen; z++) {
9585 uint64_t ret_conv_25 = ret_vals[z];
9586 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
9587 CHECK_ACCESS(ret_conv_25_ptr);
9588 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
9589 FREE(untag_ptr(ret_conv_25));
9590 ret_constr.data[z] = ret_conv_25_conv;
9595 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
9596 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
9597 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9598 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
9600 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JSValue o, JSValue CustomMessageReader) {
9601 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
9602 atomic_init(&calls->refcnt, 1);
9603 calls->instance_ptr = o;
9605 LDKCustomMessageHandler ret = {
9606 .this_arg = (void*) calls,
9607 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
9608 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
9609 .free = LDKCustomMessageHandler_JCalls_free,
9610 .CustomMessageReader = LDKCustomMessageReader_init(CustomMessageReader),
9612 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
9615 uint64_t __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCustomMessageHandler_new(JSValue o, JSValue CustomMessageReader) {
9616 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
9617 *res_ptr = LDKCustomMessageHandler_init(o, CustomMessageReader);
9618 return tag_ptr(res_ptr, true);
9620 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) {
9621 void* this_arg_ptr = untag_ptr(this_arg);
9622 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9623 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9624 void* msg_ptr = untag_ptr(msg);
9625 CHECK_ACCESS(msg_ptr);
9626 LDKType msg_conv = *(LDKType*)(msg_ptr);
9627 if (msg_conv.free == LDKType_JCalls_free) {
9628 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9629 LDKType_JCalls_cloned(&msg_conv);
9631 LDKPublicKey sender_node_id_ref;
9632 CHECK(sender_node_id->arr_len == 33);
9633 memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id);
9634 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9635 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
9636 return tag_ptr(ret_conv, true);
9639 uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint64_t this_arg) {
9640 void* this_arg_ptr = untag_ptr(this_arg);
9641 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9642 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9643 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
9644 uint64_tArray ret_arr = NULL;
9645 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9646 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9647 for (size_t z = 0; z < ret_var.datalen; z++) {
9648 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
9649 *ret_conv_25_conv = ret_var.data[z];
9650 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
9657 typedef struct LDKSocketDescriptor_JCalls {
9658 atomic_size_t refcnt;
9659 uint32_t instance_ptr;
9660 } LDKSocketDescriptor_JCalls;
9661 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
9662 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9663 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9667 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
9668 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9669 LDKu8slice data_var = data;
9670 int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
9671 memcpy(data_arr->elems, data_var.data, data_var.datalen);
9672 jboolean resume_read_conv = resume_read;
9673 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 88, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
9675 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
9676 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9677 js_invoke_function_uuuuuu(j_calls->instance_ptr, 89, 0, 0, 0, 0, 0, 0);
9679 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
9680 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9681 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9682 *other_arg_clone = SocketDescriptor_clone(other_arg);
9683 return js_invoke_function_buuuuu(j_calls->instance_ptr, 90, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
9685 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
9686 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9687 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 91, 0, 0, 0, 0, 0, 0);
9689 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
9690 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
9691 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9693 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JSValue o) {
9694 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
9695 atomic_init(&calls->refcnt, 1);
9696 calls->instance_ptr = o;
9698 LDKSocketDescriptor ret = {
9699 .this_arg = (void*) calls,
9700 .send_data = send_data_LDKSocketDescriptor_jcall,
9701 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
9702 .eq = eq_LDKSocketDescriptor_jcall,
9703 .hash = hash_LDKSocketDescriptor_jcall,
9704 .cloned = LDKSocketDescriptor_JCalls_cloned,
9705 .free = LDKSocketDescriptor_JCalls_free,
9709 uint64_t __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDescriptor_new(JSValue o) {
9710 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9711 *res_ptr = LDKSocketDescriptor_init(o);
9712 return tag_ptr(res_ptr, true);
9714 uint32_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint64_t this_arg, int8_tArray data, jboolean resume_read) {
9715 void* this_arg_ptr = untag_ptr(this_arg);
9716 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9717 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9718 LDKu8slice data_ref;
9719 data_ref.datalen = data->arr_len;
9720 data_ref.data = data->elems;
9721 uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
9726 void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint64_t this_arg) {
9727 void* this_arg_ptr = untag_ptr(this_arg);
9728 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9729 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9730 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
9733 int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint64_t this_arg) {
9734 void* this_arg_ptr = untag_ptr(this_arg);
9735 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9736 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9737 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
9741 uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) {
9742 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9744 case LDKEffectiveCapacity_ExactLiquidity: return 0;
9745 case LDKEffectiveCapacity_MaximumHTLC: return 1;
9746 case LDKEffectiveCapacity_Total: return 2;
9747 case LDKEffectiveCapacity_Infinite: return 3;
9748 case LDKEffectiveCapacity_Unknown: return 4;
9752 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat"))) TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(uint64_t ptr) {
9753 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9754 assert(obj->tag == LDKEffectiveCapacity_ExactLiquidity);
9755 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
9756 return liquidity_msat_conv;
9758 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat"))) TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(uint64_t ptr) {
9759 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9760 assert(obj->tag == LDKEffectiveCapacity_MaximumHTLC);
9761 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
9762 return amount_msat_conv;
9764 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_capacity_msat"))) TS_LDKEffectiveCapacity_Total_get_capacity_msat(uint64_t ptr) {
9765 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9766 assert(obj->tag == LDKEffectiveCapacity_Total);
9767 int64_t capacity_msat_conv = obj->total.capacity_msat;
9768 return capacity_msat_conv;
9770 uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
9771 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9772 assert(obj->tag == LDKEffectiveCapacity_Total);
9773 uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
9774 return htlc_maximum_msat_ref;
9776 typedef struct LDKLockableScore_JCalls {
9777 atomic_size_t refcnt;
9778 uint32_t instance_ptr;
9779 } LDKLockableScore_JCalls;
9780 static void LDKLockableScore_JCalls_free(void* this_arg) {
9781 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9782 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9786 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
9787 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9788 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0);
9789 void* ret_ptr = untag_ptr(ret);
9790 CHECK_ACCESS(ret_ptr);
9791 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
9792 if (ret_conv.free == LDKScore_JCalls_free) {
9793 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9794 LDKScore_JCalls_cloned(&ret_conv);
9795 }// WARNING: we may need a move here but no clone is available for LDKScore
9799 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
9800 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
9801 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9803 static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
9804 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
9805 atomic_init(&calls->refcnt, 1);
9806 calls->instance_ptr = o;
9808 LDKLockableScore ret = {
9809 .this_arg = (void*) calls,
9810 .lock = lock_LDKLockableScore_jcall,
9811 .free = LDKLockableScore_JCalls_free,
9815 uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
9816 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
9817 *res_ptr = LDKLockableScore_init(o);
9818 return tag_ptr(res_ptr, true);
9820 uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
9821 void* this_arg_ptr = untag_ptr(this_arg);
9822 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9823 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
9824 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
9825 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
9826 return tag_ptr(ret_ret, true);
9829 uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
9830 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9832 case LDKFallback_SegWitProgram: return 0;
9833 case LDKFallback_PubKeyHash: return 1;
9834 case LDKFallback_ScriptHash: return 2;
9838 int8_t __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_version"))) TS_LDKFallback_SegWitProgram_get_version(uint64_t ptr) {
9839 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9840 assert(obj->tag == LDKFallback_SegWitProgram);
9841 uint8_t version_val = obj->seg_wit_program.version._0;
9844 int8_tArray __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_program"))) TS_LDKFallback_SegWitProgram_get_program(uint64_t ptr) {
9845 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9846 assert(obj->tag == LDKFallback_SegWitProgram);
9847 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
9848 int8_tArray program_arr = init_int8_tArray(program_var.datalen, __LINE__);
9849 memcpy(program_arr->elems, program_var.data, program_var.datalen);
9852 int8_tArray __attribute__((export_name("TS_LDKFallback_PubKeyHash_get_pub_key_hash"))) TS_LDKFallback_PubKeyHash_get_pub_key_hash(uint64_t ptr) {
9853 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9854 assert(obj->tag == LDKFallback_PubKeyHash);
9855 int8_tArray pub_key_hash_arr = init_int8_tArray(20, __LINE__);
9856 memcpy(pub_key_hash_arr->elems, obj->pub_key_hash.data, 20);
9857 return pub_key_hash_arr;
9859 int8_tArray __attribute__((export_name("TS_LDKFallback_ScriptHash_get_script_hash"))) TS_LDKFallback_ScriptHash_get_script_hash(uint64_t ptr) {
9860 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9861 assert(obj->tag == LDKFallback_ScriptHash);
9862 int8_tArray script_hash_arr = init_int8_tArray(20, __LINE__);
9863 memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
9864 return script_hash_arr;
9866 typedef struct LDKPayer_JCalls {
9867 atomic_size_t refcnt;
9868 uint32_t instance_ptr;
9870 static void LDKPayer_JCalls_free(void* this_arg) {
9871 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9872 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9876 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
9877 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9878 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, 0, 0, 0, 0, 0, 0);
9879 LDKPublicKey ret_ref;
9880 CHECK(ret->arr_len == 33);
9881 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
9884 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
9885 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9886 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 94, 0, 0, 0, 0, 0, 0);
9887 LDKCVec_ChannelDetailsZ ret_constr;
9888 ret_constr.datalen = ret->arr_len;
9889 if (ret_constr.datalen > 0)
9890 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
9892 ret_constr.data = NULL;
9893 uint64_t* ret_vals = ret->elems;
9894 for (size_t q = 0; q < ret_constr.datalen; q++) {
9895 uint64_t ret_conv_16 = ret_vals[q];
9896 LDKChannelDetails ret_conv_16_conv;
9897 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
9898 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
9899 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
9900 ret_constr.data[q] = ret_conv_16_conv;
9905 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
9906 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9907 LDKRoute route_var = *route;
9908 uint64_t route_ref = 0;
9909 route_var = Route_clone(&route_var);
9910 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9911 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9912 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
9913 memcpy(payment_hash_arr->elems, payment_hash.data, 32);
9914 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
9915 memcpy(payment_secret_arr->elems, payment_secret.data, 32);
9916 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 95, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0);
9917 void* ret_ptr = untag_ptr(ret);
9918 CHECK_ACCESS(ret_ptr);
9919 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9920 FREE(untag_ptr(ret));
9923 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
9924 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9925 LDKRoute route_var = *route;
9926 uint64_t route_ref = 0;
9927 route_var = Route_clone(&route_var);
9928 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9929 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9930 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
9931 memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
9932 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 96, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
9933 void* ret_ptr = untag_ptr(ret);
9934 CHECK_ACCESS(ret_ptr);
9935 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9936 FREE(untag_ptr(ret));
9939 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
9940 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9941 LDKRoute route_var = *route;
9942 uint64_t route_ref = 0;
9943 route_var = Route_clone(&route_var);
9944 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9945 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9946 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9947 memcpy(payment_id_arr->elems, payment_id.data, 32);
9948 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 97, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
9949 void* ret_ptr = untag_ptr(ret);
9950 CHECK_ACCESS(ret_ptr);
9951 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
9952 FREE(untag_ptr(ret));
9955 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
9956 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9957 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9958 memcpy(payment_id_arr->elems, payment_id.data, 32);
9959 js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
9961 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
9962 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
9963 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9965 static inline LDKPayer LDKPayer_init (JSValue o) {
9966 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
9967 atomic_init(&calls->refcnt, 1);
9968 calls->instance_ptr = o;
9971 .this_arg = (void*) calls,
9972 .node_id = node_id_LDKPayer_jcall,
9973 .first_hops = first_hops_LDKPayer_jcall,
9974 .send_payment = send_payment_LDKPayer_jcall,
9975 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
9976 .retry_payment = retry_payment_LDKPayer_jcall,
9977 .abandon_payment = abandon_payment_LDKPayer_jcall,
9978 .free = LDKPayer_JCalls_free,
9982 uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
9983 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
9984 *res_ptr = LDKPayer_init(o);
9985 return tag_ptr(res_ptr, true);
9987 int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
9988 void* this_arg_ptr = untag_ptr(this_arg);
9989 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9990 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9991 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
9992 memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
9996 uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
9997 void* this_arg_ptr = untag_ptr(this_arg);
9998 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9999 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10000 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
10001 uint64_tArray ret_arr = NULL;
10002 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10003 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10004 for (size_t q = 0; q < ret_var.datalen; q++) {
10005 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
10006 uint64_t ret_conv_16_ref = 0;
10007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
10008 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
10009 ret_arr_ptr[q] = ret_conv_16_ref;
10012 FREE(ret_var.data);
10016 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) {
10017 void* this_arg_ptr = untag_ptr(this_arg);
10018 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10019 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10020 LDKRoute route_conv;
10021 route_conv.inner = untag_ptr(route);
10022 route_conv.is_owned = ptr_is_owned(route);
10023 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10024 route_conv.is_owned = false;
10025 LDKThirtyTwoBytes payment_hash_ref;
10026 CHECK(payment_hash->arr_len == 32);
10027 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
10028 LDKThirtyTwoBytes payment_secret_ref;
10029 CHECK(payment_secret->arr_len == 32);
10030 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
10031 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10032 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
10033 return tag_ptr(ret_conv, true);
10036 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) {
10037 void* this_arg_ptr = untag_ptr(this_arg);
10038 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10039 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10040 LDKRoute route_conv;
10041 route_conv.inner = untag_ptr(route);
10042 route_conv.is_owned = ptr_is_owned(route);
10043 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10044 route_conv.is_owned = false;
10045 LDKThirtyTwoBytes payment_preimage_ref;
10046 CHECK(payment_preimage->arr_len == 32);
10047 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
10048 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10049 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
10050 return tag_ptr(ret_conv, true);
10053 uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
10054 void* this_arg_ptr = untag_ptr(this_arg);
10055 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10056 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10057 LDKRoute route_conv;
10058 route_conv.inner = untag_ptr(route);
10059 route_conv.is_owned = ptr_is_owned(route);
10060 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10061 route_conv.is_owned = false;
10062 LDKThirtyTwoBytes payment_id_ref;
10063 CHECK(payment_id->arr_len == 32);
10064 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10065 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
10066 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
10067 return tag_ptr(ret_conv, true);
10070 void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
10071 void* this_arg_ptr = untag_ptr(this_arg);
10072 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10073 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10074 LDKThirtyTwoBytes payment_id_ref;
10075 CHECK(payment_id->arr_len == 32);
10076 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10077 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
10080 typedef struct LDKRouter_JCalls {
10081 atomic_size_t refcnt;
10082 uint32_t instance_ptr;
10083 } LDKRouter_JCalls;
10084 static void LDKRouter_JCalls_free(void* this_arg) {
10085 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10086 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10090 LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
10091 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10092 int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
10093 memcpy(payer_arr->elems, payer.compressed_form, 33);
10094 LDKRouteParameters route_params_var = *route_params;
10095 uint64_t route_params_ref = 0;
10096 route_params_var = RouteParameters_clone(&route_params_var);
10097 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
10098 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
10099 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10100 memcpy(payment_hash_arr->elems, *payment_hash, 32);
10101 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
10102 uint64_tArray first_hops_arr = NULL;
10103 if (first_hops != NULL) {
10104 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
10105 first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
10106 uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
10107 for (size_t q = 0; q < first_hops_var.datalen; q++) {
10108 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
10109 uint64_t first_hops_conv_16_ref = 0;
10110 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
10111 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
10112 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
10116 // WARNING: This object doesn't live past this scope, needs clone!
10117 uint64_t ret_scorer = tag_ptr(scorer, false);
10118 uint32_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 99, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, ret_scorer, 0);
10119 void* ret_ptr = untag_ptr(ret);
10120 CHECK_ACCESS(ret_ptr);
10121 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
10122 FREE(untag_ptr(ret));
10125 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
10126 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
10127 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10129 static inline LDKRouter LDKRouter_init (JSValue o) {
10130 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
10131 atomic_init(&calls->refcnt, 1);
10132 calls->instance_ptr = o;
10135 .this_arg = (void*) calls,
10136 .find_route = find_route_LDKRouter_jcall,
10137 .free = LDKRouter_JCalls_free,
10141 uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
10142 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
10143 *res_ptr = LDKRouter_init(o);
10144 return tag_ptr(res_ptr, true);
10146 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 scorer) {
10147 void* this_arg_ptr = untag_ptr(this_arg);
10148 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10149 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10150 LDKPublicKey payer_ref;
10151 CHECK(payer->arr_len == 33);
10152 memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
10153 LDKRouteParameters route_params_conv;
10154 route_params_conv.inner = untag_ptr(route_params);
10155 route_params_conv.is_owned = ptr_is_owned(route_params);
10156 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
10157 route_params_conv.is_owned = false;
10158 unsigned char payment_hash_arr[32];
10159 CHECK(payment_hash->arr_len == 32);
10160 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
10161 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
10162 LDKCVec_ChannelDetailsZ first_hops_constr;
10163 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
10164 if (first_hops != 0) {
10165 first_hops_constr.datalen = first_hops->arr_len;
10166 if (first_hops_constr.datalen > 0)
10167 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
10169 first_hops_constr.data = NULL;
10170 uint64_t* first_hops_vals = first_hops->elems;
10171 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
10172 uint64_t first_hops_conv_16 = first_hops_vals[q];
10173 LDKChannelDetails first_hops_conv_16_conv;
10174 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
10175 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
10176 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
10177 first_hops_conv_16_conv.is_owned = false;
10178 first_hops_constr.data[q] = first_hops_conv_16_conv;
10181 first_hops_ptr = &first_hops_constr;
10183 void* scorer_ptr = untag_ptr(scorer);
10184 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
10185 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
10186 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
10187 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
10188 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
10189 return tag_ptr(ret_conv, true);
10192 uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
10193 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
10195 case LDKRetry_Attempts: return 0;
10199 uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
10200 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
10201 assert(obj->tag == LDKRetry_Attempts);
10202 uint32_t attempts_conv = obj->attempts;
10203 return attempts_conv;
10205 jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
10206 LDKStr ret_str = _ldk_get_compiled_version();
10207 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10212 jstring __attribute__((export_name("TS__ldk_c_bindings_get_compiled_version"))) TS__ldk_c_bindings_get_compiled_version() {
10213 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
10214 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10219 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
10220 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10221 *ret_copy = Bech32Error_clone(arg);
10222 uint64_t ret_ref = tag_ptr(ret_copy, true);
10225 int64_t __attribute__((export_name("TS_Bech32Error_clone_ptr"))) TS_Bech32Error_clone_ptr(uint64_t arg) {
10226 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
10227 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
10231 uint64_t __attribute__((export_name("TS_Bech32Error_clone"))) TS_Bech32Error_clone(uint64_t orig) {
10232 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
10233 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10234 *ret_copy = Bech32Error_clone(orig_conv);
10235 uint64_t ret_ref = tag_ptr(ret_copy, true);
10239 void __attribute__((export_name("TS_Bech32Error_free"))) TS_Bech32Error_free(uint64_t o) {
10240 if (!ptr_is_owned(o)) return;
10241 void* o_ptr = untag_ptr(o);
10242 CHECK_ACCESS(o_ptr);
10243 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
10244 FREE(untag_ptr(o));
10245 Bech32Error_free(o_conv);
10248 void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(int8_tArray _res) {
10249 LDKTransaction _res_ref;
10250 _res_ref.datalen = _res->arr_len;
10251 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
10252 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
10253 _res_ref.data_is_owned = true;
10254 Transaction_free(_res_ref);
10257 uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
10258 LDKCVec_u8Z script_pubkey_ref;
10259 script_pubkey_ref.datalen = script_pubkey->arr_len;
10260 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
10261 memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey);
10262 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10263 *ret_ref = TxOut_new(script_pubkey_ref, value);
10264 return tag_ptr(ret_ref, true);
10267 void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint64_t _res) {
10268 if (!ptr_is_owned(_res)) return;
10269 void* _res_ptr = untag_ptr(_res);
10270 CHECK_ACCESS(_res_ptr);
10271 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
10272 FREE(untag_ptr(_res));
10273 TxOut_free(_res_conv);
10276 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
10277 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10278 *ret_ref = TxOut_clone(arg);
10279 return tag_ptr(ret_ref, true);
10281 int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint64_t arg) {
10282 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
10283 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
10287 uint64_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint64_t orig) {
10288 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
10289 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10290 *ret_ref = TxOut_clone(orig_conv);
10291 return tag_ptr(ret_ref, true);
10294 void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) {
10295 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
10299 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
10300 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10301 *ret_conv = CResult_NoneNoneZ_ok();
10302 return tag_ptr(ret_conv, true);
10305 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() {
10306 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10307 *ret_conv = CResult_NoneNoneZ_err();
10308 return tag_ptr(ret_conv, true);
10311 jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint64_t o) {
10312 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
10313 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
10317 void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint64_t _res) {
10318 if (!ptr_is_owned(_res)) return;
10319 void* _res_ptr = untag_ptr(_res);
10320 CHECK_ACCESS(_res_ptr);
10321 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
10322 FREE(untag_ptr(_res));
10323 CResult_NoneNoneZ_free(_res_conv);
10326 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
10327 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10328 *ret_conv = CResult_NoneNoneZ_clone(arg);
10329 return tag_ptr(ret_conv, true);
10331 int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint64_t arg) {
10332 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
10333 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
10337 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_NoneNoneZ_clone(uint64_t orig) {
10338 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
10339 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10340 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
10341 return tag_ptr(ret_conv, true);
10344 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) {
10345 LDKCounterpartyCommitmentSecrets o_conv;
10346 o_conv.inner = untag_ptr(o);
10347 o_conv.is_owned = ptr_is_owned(o);
10348 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10349 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
10350 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10351 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
10352 return tag_ptr(ret_conv, true);
10355 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
10356 LDKDecodeError e_conv;
10357 e_conv.inner = untag_ptr(e);
10358 e_conv.is_owned = ptr_is_owned(e);
10359 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10360 e_conv = DecodeError_clone(&e_conv);
10361 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10362 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
10363 return tag_ptr(ret_conv, true);
10366 jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) {
10367 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
10368 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
10372 void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) {
10373 if (!ptr_is_owned(_res)) return;
10374 void* _res_ptr = untag_ptr(_res);
10375 CHECK_ACCESS(_res_ptr);
10376 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
10377 FREE(untag_ptr(_res));
10378 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
10381 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
10382 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10383 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
10384 return tag_ptr(ret_conv, true);
10386 int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) {
10387 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
10388 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
10392 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) {
10393 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
10394 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10395 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
10396 return tag_ptr(ret_conv, true);
10399 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
10400 LDKSecretKey o_ref;
10401 CHECK(o->arr_len == 32);
10402 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
10403 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10404 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
10405 return tag_ptr(ret_conv, true);
10408 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
10409 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10410 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10411 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
10412 return tag_ptr(ret_conv, true);
10415 jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
10416 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
10417 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
10421 void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
10422 if (!ptr_is_owned(_res)) return;
10423 void* _res_ptr = untag_ptr(_res);
10424 CHECK_ACCESS(_res_ptr);
10425 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
10426 FREE(untag_ptr(_res));
10427 CResult_SecretKeyErrorZ_free(_res_conv);
10430 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
10431 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10432 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
10433 return tag_ptr(ret_conv, true);
10435 int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
10436 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
10437 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
10441 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
10442 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
10443 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10444 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
10445 return tag_ptr(ret_conv, true);
10448 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
10449 LDKPublicKey o_ref;
10450 CHECK(o->arr_len == 33);
10451 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
10452 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10453 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
10454 return tag_ptr(ret_conv, true);
10457 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
10458 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10459 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10460 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
10461 return tag_ptr(ret_conv, true);
10464 jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
10465 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
10466 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
10470 void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
10471 if (!ptr_is_owned(_res)) return;
10472 void* _res_ptr = untag_ptr(_res);
10473 CHECK_ACCESS(_res_ptr);
10474 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
10475 FREE(untag_ptr(_res));
10476 CResult_PublicKeyErrorZ_free(_res_conv);
10479 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
10480 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10481 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
10482 return tag_ptr(ret_conv, true);
10484 int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
10485 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
10486 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
10490 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
10491 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
10492 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10493 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
10494 return tag_ptr(ret_conv, true);
10497 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
10498 LDKTxCreationKeys o_conv;
10499 o_conv.inner = untag_ptr(o);
10500 o_conv.is_owned = ptr_is_owned(o);
10501 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10502 o_conv = TxCreationKeys_clone(&o_conv);
10503 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10504 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
10505 return tag_ptr(ret_conv, true);
10508 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
10509 LDKDecodeError e_conv;
10510 e_conv.inner = untag_ptr(e);
10511 e_conv.is_owned = ptr_is_owned(e);
10512 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10513 e_conv = DecodeError_clone(&e_conv);
10514 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10515 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
10516 return tag_ptr(ret_conv, true);
10519 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
10520 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
10521 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
10525 void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
10526 if (!ptr_is_owned(_res)) return;
10527 void* _res_ptr = untag_ptr(_res);
10528 CHECK_ACCESS(_res_ptr);
10529 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
10530 FREE(untag_ptr(_res));
10531 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
10534 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
10535 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10536 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
10537 return tag_ptr(ret_conv, true);
10539 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10540 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
10541 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
10545 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
10546 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
10547 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10548 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
10549 return tag_ptr(ret_conv, true);
10552 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
10553 LDKChannelPublicKeys o_conv;
10554 o_conv.inner = untag_ptr(o);
10555 o_conv.is_owned = ptr_is_owned(o);
10556 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10557 o_conv = ChannelPublicKeys_clone(&o_conv);
10558 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10559 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
10560 return tag_ptr(ret_conv, true);
10563 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
10564 LDKDecodeError e_conv;
10565 e_conv.inner = untag_ptr(e);
10566 e_conv.is_owned = ptr_is_owned(e);
10567 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10568 e_conv = DecodeError_clone(&e_conv);
10569 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10570 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
10571 return tag_ptr(ret_conv, true);
10574 jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) {
10575 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
10576 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
10580 void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) {
10581 if (!ptr_is_owned(_res)) return;
10582 void* _res_ptr = untag_ptr(_res);
10583 CHECK_ACCESS(_res_ptr);
10584 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
10585 FREE(untag_ptr(_res));
10586 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
10589 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
10590 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10591 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
10592 return tag_ptr(ret_conv, true);
10594 int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10595 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
10596 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
10600 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) {
10601 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
10602 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10603 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
10604 return tag_ptr(ret_conv, true);
10607 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
10608 LDKTxCreationKeys o_conv;
10609 o_conv.inner = untag_ptr(o);
10610 o_conv.is_owned = ptr_is_owned(o);
10611 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10612 o_conv = TxCreationKeys_clone(&o_conv);
10613 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10614 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
10615 return tag_ptr(ret_conv, true);
10618 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
10619 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10620 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10621 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
10622 return tag_ptr(ret_conv, true);
10625 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
10626 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
10627 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
10631 void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
10632 if (!ptr_is_owned(_res)) return;
10633 void* _res_ptr = untag_ptr(_res);
10634 CHECK_ACCESS(_res_ptr);
10635 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
10636 FREE(untag_ptr(_res));
10637 CResult_TxCreationKeysErrorZ_free(_res_conv);
10640 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
10641 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10642 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
10643 return tag_ptr(ret_conv, true);
10645 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
10646 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
10647 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
10651 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
10652 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
10653 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10654 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
10655 return tag_ptr(ret_conv, true);
10658 uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
10659 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10660 *ret_copy = COption_u32Z_some(o);
10661 uint64_t ret_ref = tag_ptr(ret_copy, true);
10665 uint64_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() {
10666 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10667 *ret_copy = COption_u32Z_none();
10668 uint64_t ret_ref = tag_ptr(ret_copy, true);
10672 void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint64_t _res) {
10673 if (!ptr_is_owned(_res)) return;
10674 void* _res_ptr = untag_ptr(_res);
10675 CHECK_ACCESS(_res_ptr);
10676 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
10677 FREE(untag_ptr(_res));
10678 COption_u32Z_free(_res_conv);
10681 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
10682 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10683 *ret_copy = COption_u32Z_clone(arg);
10684 uint64_t ret_ref = tag_ptr(ret_copy, true);
10687 int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint64_t arg) {
10688 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
10689 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
10693 uint64_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_clone(uint64_t orig) {
10694 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
10695 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10696 *ret_copy = COption_u32Z_clone(orig_conv);
10697 uint64_t ret_ref = tag_ptr(ret_copy, true);
10701 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) {
10702 LDKHTLCOutputInCommitment o_conv;
10703 o_conv.inner = untag_ptr(o);
10704 o_conv.is_owned = ptr_is_owned(o);
10705 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10706 o_conv = HTLCOutputInCommitment_clone(&o_conv);
10707 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10708 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
10709 return tag_ptr(ret_conv, true);
10712 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
10713 LDKDecodeError e_conv;
10714 e_conv.inner = untag_ptr(e);
10715 e_conv.is_owned = ptr_is_owned(e);
10716 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10717 e_conv = DecodeError_clone(&e_conv);
10718 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10719 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
10720 return tag_ptr(ret_conv, true);
10723 jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) {
10724 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
10725 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
10729 void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) {
10730 if (!ptr_is_owned(_res)) return;
10731 void* _res_ptr = untag_ptr(_res);
10732 CHECK_ACCESS(_res_ptr);
10733 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
10734 FREE(untag_ptr(_res));
10735 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
10738 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
10739 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10740 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
10741 return tag_ptr(ret_conv, true);
10743 int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) {
10744 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
10745 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
10749 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) {
10750 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
10751 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10752 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
10753 return tag_ptr(ret_conv, true);
10756 uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() {
10757 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
10761 uint32_t __attribute__((export_name("TS_COption_NoneZ_none"))) TS_COption_NoneZ_none() {
10762 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
10766 void __attribute__((export_name("TS_COption_NoneZ_free"))) TS_COption_NoneZ_free(uint32_t _res) {
10767 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
10768 COption_NoneZ_free(_res_conv);
10771 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10772 LDKCounterpartyChannelTransactionParameters o_conv;
10773 o_conv.inner = untag_ptr(o);
10774 o_conv.is_owned = ptr_is_owned(o);
10775 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10776 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
10777 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10778 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10779 return tag_ptr(ret_conv, true);
10782 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10783 LDKDecodeError e_conv;
10784 e_conv.inner = untag_ptr(e);
10785 e_conv.is_owned = ptr_is_owned(e);
10786 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10787 e_conv = DecodeError_clone(&e_conv);
10788 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10789 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
10790 return tag_ptr(ret_conv, true);
10793 jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10794 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10795 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10799 void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10800 if (!ptr_is_owned(_res)) return;
10801 void* _res_ptr = untag_ptr(_res);
10802 CHECK_ACCESS(_res_ptr);
10803 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10804 FREE(untag_ptr(_res));
10805 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10808 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10809 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10810 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
10811 return tag_ptr(ret_conv, true);
10813 int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10814 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10815 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10819 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10820 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10821 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10822 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10823 return tag_ptr(ret_conv, true);
10826 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10827 LDKChannelTransactionParameters o_conv;
10828 o_conv.inner = untag_ptr(o);
10829 o_conv.is_owned = ptr_is_owned(o);
10830 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10831 o_conv = ChannelTransactionParameters_clone(&o_conv);
10832 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10833 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10834 return tag_ptr(ret_conv, true);
10837 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10838 LDKDecodeError e_conv;
10839 e_conv.inner = untag_ptr(e);
10840 e_conv.is_owned = ptr_is_owned(e);
10841 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10842 e_conv = DecodeError_clone(&e_conv);
10843 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10844 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
10845 return tag_ptr(ret_conv, true);
10848 jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10849 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10850 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10854 void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10855 if (!ptr_is_owned(_res)) return;
10856 void* _res_ptr = untag_ptr(_res);
10857 CHECK_ACCESS(_res_ptr);
10858 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10859 FREE(untag_ptr(_res));
10860 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10863 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10864 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10865 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
10866 return tag_ptr(ret_conv, true);
10868 int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10869 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10870 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10874 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10875 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10876 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10877 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10878 return tag_ptr(ret_conv, true);
10881 void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) {
10882 LDKCVec_SignatureZ _res_constr;
10883 _res_constr.datalen = _res->arr_len;
10884 if (_res_constr.datalen > 0)
10885 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
10887 _res_constr.data = NULL;
10888 int8_tArray* _res_vals = (void*) _res->elems;
10889 for (size_t m = 0; m < _res_constr.datalen; m++) {
10890 int8_tArray _res_conv_12 = _res_vals[m];
10891 LDKSignature _res_conv_12_ref;
10892 CHECK(_res_conv_12->arr_len == 64);
10893 memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
10894 _res_constr.data[m] = _res_conv_12_ref;
10897 CVec_SignatureZ_free(_res_constr);
10900 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10901 LDKHolderCommitmentTransaction o_conv;
10902 o_conv.inner = untag_ptr(o);
10903 o_conv.is_owned = ptr_is_owned(o);
10904 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10905 o_conv = HolderCommitmentTransaction_clone(&o_conv);
10906 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10907 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
10908 return tag_ptr(ret_conv, true);
10911 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10912 LDKDecodeError e_conv;
10913 e_conv.inner = untag_ptr(e);
10914 e_conv.is_owned = ptr_is_owned(e);
10915 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10916 e_conv = DecodeError_clone(&e_conv);
10917 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10918 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
10919 return tag_ptr(ret_conv, true);
10922 jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10923 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10924 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10928 void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10929 if (!ptr_is_owned(_res)) return;
10930 void* _res_ptr = untag_ptr(_res);
10931 CHECK_ACCESS(_res_ptr);
10932 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10933 FREE(untag_ptr(_res));
10934 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
10937 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10938 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10939 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
10940 return tag_ptr(ret_conv, true);
10942 int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10943 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10944 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
10948 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
10949 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
10950 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10951 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
10952 return tag_ptr(ret_conv, true);
10955 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10956 LDKBuiltCommitmentTransaction o_conv;
10957 o_conv.inner = untag_ptr(o);
10958 o_conv.is_owned = ptr_is_owned(o);
10959 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10960 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
10961 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10962 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
10963 return tag_ptr(ret_conv, true);
10966 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10967 LDKDecodeError e_conv;
10968 e_conv.inner = untag_ptr(e);
10969 e_conv.is_owned = ptr_is_owned(e);
10970 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10971 e_conv = DecodeError_clone(&e_conv);
10972 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10973 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
10974 return tag_ptr(ret_conv, true);
10977 jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10978 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10979 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10983 void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10984 if (!ptr_is_owned(_res)) return;
10985 void* _res_ptr = untag_ptr(_res);
10986 CHECK_ACCESS(_res_ptr);
10987 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10988 FREE(untag_ptr(_res));
10989 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
10992 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10993 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10994 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
10995 return tag_ptr(ret_conv, true);
10997 int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10998 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10999 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11003 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11004 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11005 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11006 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
11007 return tag_ptr(ret_conv, true);
11010 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) {
11011 LDKTrustedClosingTransaction o_conv;
11012 o_conv.inner = untag_ptr(o);
11013 o_conv.is_owned = ptr_is_owned(o);
11014 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11015 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
11017 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11018 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
11019 return tag_ptr(ret_conv, true);
11022 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() {
11023 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11024 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
11025 return tag_ptr(ret_conv, true);
11028 jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) {
11029 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
11030 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
11034 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) {
11035 if (!ptr_is_owned(_res)) return;
11036 void* _res_ptr = untag_ptr(_res);
11037 CHECK_ACCESS(_res_ptr);
11038 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
11039 FREE(untag_ptr(_res));
11040 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
11043 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
11044 LDKCommitmentTransaction o_conv;
11045 o_conv.inner = untag_ptr(o);
11046 o_conv.is_owned = ptr_is_owned(o);
11047 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11048 o_conv = CommitmentTransaction_clone(&o_conv);
11049 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11050 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
11051 return tag_ptr(ret_conv, true);
11054 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
11055 LDKDecodeError e_conv;
11056 e_conv.inner = untag_ptr(e);
11057 e_conv.is_owned = ptr_is_owned(e);
11058 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11059 e_conv = DecodeError_clone(&e_conv);
11060 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11061 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
11062 return tag_ptr(ret_conv, true);
11065 jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
11066 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
11067 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
11071 void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
11072 if (!ptr_is_owned(_res)) return;
11073 void* _res_ptr = untag_ptr(_res);
11074 CHECK_ACCESS(_res_ptr);
11075 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
11076 FREE(untag_ptr(_res));
11077 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
11080 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
11081 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11082 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
11083 return tag_ptr(ret_conv, true);
11085 int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
11086 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
11087 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11091 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11092 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11093 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11094 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
11095 return tag_ptr(ret_conv, true);
11098 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) {
11099 LDKTrustedCommitmentTransaction o_conv;
11100 o_conv.inner = untag_ptr(o);
11101 o_conv.is_owned = ptr_is_owned(o);
11102 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11103 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
11105 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
11106 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
11107 return tag_ptr(ret_conv, true);
11110 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() {
11111 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
11112 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
11113 return tag_ptr(ret_conv, true);
11116 jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) {
11117 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
11118 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
11122 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) {
11123 if (!ptr_is_owned(_res)) return;
11124 void* _res_ptr = untag_ptr(_res);
11125 CHECK_ACCESS(_res_ptr);
11126 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
11127 FREE(untag_ptr(_res));
11128 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
11131 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_CResult_CVec_SignatureZNoneZ_ok(ptrArray o) {
11132 LDKCVec_SignatureZ o_constr;
11133 o_constr.datalen = o->arr_len;
11134 if (o_constr.datalen > 0)
11135 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
11137 o_constr.data = NULL;
11138 int8_tArray* o_vals = (void*) o->elems;
11139 for (size_t m = 0; m < o_constr.datalen; m++) {
11140 int8_tArray o_conv_12 = o_vals[m];
11141 LDKSignature o_conv_12_ref;
11142 CHECK(o_conv_12->arr_len == 64);
11143 memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
11144 o_constr.data[m] = o_conv_12_ref;
11147 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11148 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
11149 return tag_ptr(ret_conv, true);
11152 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() {
11153 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11154 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
11155 return tag_ptr(ret_conv, true);
11158 jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint64_t o) {
11159 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
11160 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
11164 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint64_t _res) {
11165 if (!ptr_is_owned(_res)) return;
11166 void* _res_ptr = untag_ptr(_res);
11167 CHECK_ACCESS(_res_ptr);
11168 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
11169 FREE(untag_ptr(_res));
11170 CResult_CVec_SignatureZNoneZ_free(_res_conv);
11173 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
11174 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11175 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
11176 return tag_ptr(ret_conv, true);
11178 int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint64_t arg) {
11179 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
11180 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
11184 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint64_t orig) {
11185 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
11186 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11187 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
11188 return tag_ptr(ret_conv, true);
11191 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) {
11192 LDKShutdownScript o_conv;
11193 o_conv.inner = untag_ptr(o);
11194 o_conv.is_owned = ptr_is_owned(o);
11195 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11196 o_conv = ShutdownScript_clone(&o_conv);
11197 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11198 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
11199 return tag_ptr(ret_conv, true);
11202 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
11203 LDKDecodeError e_conv;
11204 e_conv.inner = untag_ptr(e);
11205 e_conv.is_owned = ptr_is_owned(e);
11206 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11207 e_conv = DecodeError_clone(&e_conv);
11208 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11209 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
11210 return tag_ptr(ret_conv, true);
11213 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) {
11214 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
11215 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
11219 void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) {
11220 if (!ptr_is_owned(_res)) return;
11221 void* _res_ptr = untag_ptr(_res);
11222 CHECK_ACCESS(_res_ptr);
11223 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
11224 FREE(untag_ptr(_res));
11225 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
11228 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
11229 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11230 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
11231 return tag_ptr(ret_conv, true);
11233 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) {
11234 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
11235 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
11239 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) {
11240 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
11241 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11242 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
11243 return tag_ptr(ret_conv, true);
11246 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) {
11247 LDKShutdownScript o_conv;
11248 o_conv.inner = untag_ptr(o);
11249 o_conv.is_owned = ptr_is_owned(o);
11250 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11251 o_conv = ShutdownScript_clone(&o_conv);
11252 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11253 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
11254 return tag_ptr(ret_conv, true);
11257 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) {
11258 LDKInvalidShutdownScript e_conv;
11259 e_conv.inner = untag_ptr(e);
11260 e_conv.is_owned = ptr_is_owned(e);
11261 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11262 e_conv = InvalidShutdownScript_clone(&e_conv);
11263 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11264 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
11265 return tag_ptr(ret_conv, true);
11268 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) {
11269 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
11270 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
11274 void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) {
11275 if (!ptr_is_owned(_res)) return;
11276 void* _res_ptr = untag_ptr(_res);
11277 CHECK_ACCESS(_res_ptr);
11278 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
11279 FREE(untag_ptr(_res));
11280 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
11283 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
11284 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11285 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
11286 return tag_ptr(ret_conv, true);
11288 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) {
11289 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
11290 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
11294 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) {
11295 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
11296 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11297 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
11298 return tag_ptr(ret_conv, true);
11301 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
11302 LDKRouteHop o_conv;
11303 o_conv.inner = untag_ptr(o);
11304 o_conv.is_owned = ptr_is_owned(o);
11305 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11306 o_conv = RouteHop_clone(&o_conv);
11307 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11308 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
11309 return tag_ptr(ret_conv, true);
11312 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
11313 LDKDecodeError e_conv;
11314 e_conv.inner = untag_ptr(e);
11315 e_conv.is_owned = ptr_is_owned(e);
11316 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11317 e_conv = DecodeError_clone(&e_conv);
11318 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11319 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
11320 return tag_ptr(ret_conv, true);
11323 jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
11324 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
11325 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
11329 void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
11330 if (!ptr_is_owned(_res)) return;
11331 void* _res_ptr = untag_ptr(_res);
11332 CHECK_ACCESS(_res_ptr);
11333 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
11334 FREE(untag_ptr(_res));
11335 CResult_RouteHopDecodeErrorZ_free(_res_conv);
11338 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
11339 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11340 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
11341 return tag_ptr(ret_conv, true);
11343 int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11344 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
11345 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
11349 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
11350 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
11351 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11352 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
11353 return tag_ptr(ret_conv, true);
11356 void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) {
11357 LDKCVec_RouteHopZ _res_constr;
11358 _res_constr.datalen = _res->arr_len;
11359 if (_res_constr.datalen > 0)
11360 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11362 _res_constr.data = NULL;
11363 uint64_t* _res_vals = _res->elems;
11364 for (size_t k = 0; k < _res_constr.datalen; k++) {
11365 uint64_t _res_conv_10 = _res_vals[k];
11366 LDKRouteHop _res_conv_10_conv;
11367 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
11368 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
11369 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
11370 _res_constr.data[k] = _res_conv_10_conv;
11373 CVec_RouteHopZ_free(_res_constr);
11376 void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
11377 LDKCVec_CVec_RouteHopZZ _res_constr;
11378 _res_constr.datalen = _res->arr_len;
11379 if (_res_constr.datalen > 0)
11380 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
11382 _res_constr.data = NULL;
11383 uint64_tArray* _res_vals = (void*) _res->elems;
11384 for (size_t m = 0; m < _res_constr.datalen; m++) {
11385 uint64_tArray _res_conv_12 = _res_vals[m];
11386 LDKCVec_RouteHopZ _res_conv_12_constr;
11387 _res_conv_12_constr.datalen = _res_conv_12->arr_len;
11388 if (_res_conv_12_constr.datalen > 0)
11389 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11391 _res_conv_12_constr.data = NULL;
11392 uint64_t* _res_conv_12_vals = _res_conv_12->elems;
11393 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
11394 uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
11395 LDKRouteHop _res_conv_12_conv_10_conv;
11396 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
11397 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
11398 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
11399 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
11401 FREE(_res_conv_12);
11402 _res_constr.data[m] = _res_conv_12_constr;
11405 CVec_CVec_RouteHopZZ_free(_res_constr);
11408 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) {
11410 o_conv.inner = untag_ptr(o);
11411 o_conv.is_owned = ptr_is_owned(o);
11412 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11413 o_conv = Route_clone(&o_conv);
11414 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11415 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
11416 return tag_ptr(ret_conv, true);
11419 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
11420 LDKDecodeError e_conv;
11421 e_conv.inner = untag_ptr(e);
11422 e_conv.is_owned = ptr_is_owned(e);
11423 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11424 e_conv = DecodeError_clone(&e_conv);
11425 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11426 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
11427 return tag_ptr(ret_conv, true);
11430 jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint64_t o) {
11431 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
11432 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
11436 void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint64_t _res) {
11437 if (!ptr_is_owned(_res)) return;
11438 void* _res_ptr = untag_ptr(_res);
11439 CHECK_ACCESS(_res_ptr);
11440 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
11441 FREE(untag_ptr(_res));
11442 CResult_RouteDecodeErrorZ_free(_res_conv);
11445 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
11446 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11447 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
11448 return tag_ptr(ret_conv, true);
11450 int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint64_t arg) {
11451 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
11452 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
11456 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_CResult_RouteDecodeErrorZ_clone(uint64_t orig) {
11457 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
11458 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11459 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
11460 return tag_ptr(ret_conv, true);
11463 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint64_t o) {
11464 LDKRouteParameters o_conv;
11465 o_conv.inner = untag_ptr(o);
11466 o_conv.is_owned = ptr_is_owned(o);
11467 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11468 o_conv = RouteParameters_clone(&o_conv);
11469 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11470 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
11471 return tag_ptr(ret_conv, true);
11474 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
11475 LDKDecodeError e_conv;
11476 e_conv.inner = untag_ptr(e);
11477 e_conv.is_owned = ptr_is_owned(e);
11478 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11479 e_conv = DecodeError_clone(&e_conv);
11480 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11481 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
11482 return tag_ptr(ret_conv, true);
11485 jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint64_t o) {
11486 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
11487 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
11491 void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint64_t _res) {
11492 if (!ptr_is_owned(_res)) return;
11493 void* _res_ptr = untag_ptr(_res);
11494 CHECK_ACCESS(_res_ptr);
11495 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
11496 FREE(untag_ptr(_res));
11497 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
11500 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
11501 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11502 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
11503 return tag_ptr(ret_conv, true);
11505 int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11506 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
11507 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
11511 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint64_t orig) {
11512 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
11513 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11514 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
11515 return tag_ptr(ret_conv, true);
11518 void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) {
11519 LDKCVec_RouteHintZ _res_constr;
11520 _res_constr.datalen = _res->arr_len;
11521 if (_res_constr.datalen > 0)
11522 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
11524 _res_constr.data = NULL;
11525 uint64_t* _res_vals = _res->elems;
11526 for (size_t l = 0; l < _res_constr.datalen; l++) {
11527 uint64_t _res_conv_11 = _res_vals[l];
11528 LDKRouteHint _res_conv_11_conv;
11529 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
11530 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
11531 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
11532 _res_constr.data[l] = _res_conv_11_conv;
11535 CVec_RouteHintZ_free(_res_constr);
11538 uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
11539 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11540 *ret_copy = COption_u64Z_some(o);
11541 uint64_t ret_ref = tag_ptr(ret_copy, true);
11545 uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
11546 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11547 *ret_copy = COption_u64Z_none();
11548 uint64_t ret_ref = tag_ptr(ret_copy, true);
11552 void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
11553 if (!ptr_is_owned(_res)) return;
11554 void* _res_ptr = untag_ptr(_res);
11555 CHECK_ACCESS(_res_ptr);
11556 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
11557 FREE(untag_ptr(_res));
11558 COption_u64Z_free(_res_conv);
11561 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
11562 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11563 *ret_copy = COption_u64Z_clone(arg);
11564 uint64_t ret_ref = tag_ptr(ret_copy, true);
11567 int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
11568 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
11569 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
11573 uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
11574 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
11575 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11576 *ret_copy = COption_u64Z_clone(orig_conv);
11577 uint64_t ret_ref = tag_ptr(ret_copy, true);
11581 void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
11582 LDKCVec_u64Z _res_constr;
11583 _res_constr.datalen = _res->arr_len;
11584 if (_res_constr.datalen > 0)
11585 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
11587 _res_constr.data = NULL;
11588 int64_t* _res_vals = _res->elems;
11589 for (size_t i = 0; i < _res_constr.datalen; i++) {
11590 int64_t _res_conv_8 = _res_vals[i];
11591 _res_constr.data[i] = _res_conv_8;
11594 CVec_u64Z_free(_res_constr);
11597 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_ok(uint64_t o) {
11598 LDKPaymentParameters o_conv;
11599 o_conv.inner = untag_ptr(o);
11600 o_conv.is_owned = ptr_is_owned(o);
11601 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11602 o_conv = PaymentParameters_clone(&o_conv);
11603 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11604 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
11605 return tag_ptr(ret_conv, true);
11608 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
11609 LDKDecodeError e_conv;
11610 e_conv.inner = untag_ptr(e);
11611 e_conv.is_owned = ptr_is_owned(e);
11612 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11613 e_conv = DecodeError_clone(&e_conv);
11614 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11615 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
11616 return tag_ptr(ret_conv, true);
11619 jboolean __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_is_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_is_ok(uint64_t o) {
11620 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
11621 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
11625 void __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_free"))) TS_CResult_PaymentParametersDecodeErrorZ_free(uint64_t _res) {
11626 if (!ptr_is_owned(_res)) return;
11627 void* _res_ptr = untag_ptr(_res);
11628 CHECK_ACCESS(_res_ptr);
11629 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
11630 FREE(untag_ptr(_res));
11631 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
11634 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
11635 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11636 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
11637 return tag_ptr(ret_conv, true);
11639 int64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11640 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
11641 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
11645 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone"))) TS_CResult_PaymentParametersDecodeErrorZ_clone(uint64_t orig) {
11646 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
11647 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11648 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
11649 return tag_ptr(ret_conv, true);
11652 void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) {
11653 LDKCVec_RouteHintHopZ _res_constr;
11654 _res_constr.datalen = _res->arr_len;
11655 if (_res_constr.datalen > 0)
11656 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
11658 _res_constr.data = NULL;
11659 uint64_t* _res_vals = _res->elems;
11660 for (size_t o = 0; o < _res_constr.datalen; o++) {
11661 uint64_t _res_conv_14 = _res_vals[o];
11662 LDKRouteHintHop _res_conv_14_conv;
11663 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
11664 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
11665 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
11666 _res_constr.data[o] = _res_conv_14_conv;
11669 CVec_RouteHintHopZ_free(_res_constr);
11672 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint64_t o) {
11673 LDKRouteHint o_conv;
11674 o_conv.inner = untag_ptr(o);
11675 o_conv.is_owned = ptr_is_owned(o);
11676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11677 o_conv = RouteHint_clone(&o_conv);
11678 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11679 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
11680 return tag_ptr(ret_conv, true);
11683 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
11684 LDKDecodeError e_conv;
11685 e_conv.inner = untag_ptr(e);
11686 e_conv.is_owned = ptr_is_owned(e);
11687 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11688 e_conv = DecodeError_clone(&e_conv);
11689 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11690 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
11691 return tag_ptr(ret_conv, true);
11694 jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint64_t o) {
11695 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
11696 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
11700 void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint64_t _res) {
11701 if (!ptr_is_owned(_res)) return;
11702 void* _res_ptr = untag_ptr(_res);
11703 CHECK_ACCESS(_res_ptr);
11704 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
11705 FREE(untag_ptr(_res));
11706 CResult_RouteHintDecodeErrorZ_free(_res_conv);
11709 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
11710 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11711 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
11712 return tag_ptr(ret_conv, true);
11714 int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint64_t arg) {
11715 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
11716 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
11720 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint64_t orig) {
11721 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
11722 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11723 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
11724 return tag_ptr(ret_conv, true);
11727 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint64_t o) {
11728 LDKRouteHintHop o_conv;
11729 o_conv.inner = untag_ptr(o);
11730 o_conv.is_owned = ptr_is_owned(o);
11731 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11732 o_conv = RouteHintHop_clone(&o_conv);
11733 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11734 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
11735 return tag_ptr(ret_conv, true);
11738 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
11739 LDKDecodeError e_conv;
11740 e_conv.inner = untag_ptr(e);
11741 e_conv.is_owned = ptr_is_owned(e);
11742 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11743 e_conv = DecodeError_clone(&e_conv);
11744 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11745 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
11746 return tag_ptr(ret_conv, true);
11749 jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint64_t o) {
11750 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
11751 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
11755 void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint64_t _res) {
11756 if (!ptr_is_owned(_res)) return;
11757 void* _res_ptr = untag_ptr(_res);
11758 CHECK_ACCESS(_res_ptr);
11759 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
11760 FREE(untag_ptr(_res));
11761 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
11764 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
11765 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11766 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
11767 return tag_ptr(ret_conv, true);
11769 int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11770 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
11771 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
11775 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint64_t orig) {
11776 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
11777 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11778 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
11779 return tag_ptr(ret_conv, true);
11782 void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
11783 LDKCVec_ChannelDetailsZ _res_constr;
11784 _res_constr.datalen = _res->arr_len;
11785 if (_res_constr.datalen > 0)
11786 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
11788 _res_constr.data = NULL;
11789 uint64_t* _res_vals = _res->elems;
11790 for (size_t q = 0; q < _res_constr.datalen; q++) {
11791 uint64_t _res_conv_16 = _res_vals[q];
11792 LDKChannelDetails _res_conv_16_conv;
11793 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
11794 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
11795 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
11796 _res_constr.data[q] = _res_conv_16_conv;
11799 CVec_ChannelDetailsZ_free(_res_constr);
11802 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
11804 o_conv.inner = untag_ptr(o);
11805 o_conv.is_owned = ptr_is_owned(o);
11806 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11807 o_conv = Route_clone(&o_conv);
11808 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11809 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
11810 return tag_ptr(ret_conv, true);
11813 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
11814 LDKLightningError e_conv;
11815 e_conv.inner = untag_ptr(e);
11816 e_conv.is_owned = ptr_is_owned(e);
11817 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11818 e_conv = LightningError_clone(&e_conv);
11819 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11820 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
11821 return tag_ptr(ret_conv, true);
11824 jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
11825 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
11826 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
11830 void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
11831 if (!ptr_is_owned(_res)) return;
11832 void* _res_ptr = untag_ptr(_res);
11833 CHECK_ACCESS(_res_ptr);
11834 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
11835 FREE(untag_ptr(_res));
11836 CResult_RouteLightningErrorZ_free(_res_conv);
11839 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
11840 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11841 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
11842 return tag_ptr(ret_conv, true);
11844 int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
11845 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
11846 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
11850 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
11851 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
11852 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11853 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
11854 return tag_ptr(ret_conv, true);
11857 void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
11858 LDKCVec_PublicKeyZ _res_constr;
11859 _res_constr.datalen = _res->arr_len;
11860 if (_res_constr.datalen > 0)
11861 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
11863 _res_constr.data = NULL;
11864 int8_tArray* _res_vals = (void*) _res->elems;
11865 for (size_t m = 0; m < _res_constr.datalen; m++) {
11866 int8_tArray _res_conv_12 = _res_vals[m];
11867 LDKPublicKey _res_conv_12_ref;
11868 CHECK(_res_conv_12->arr_len == 33);
11869 memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
11870 _res_constr.data[m] = _res_conv_12_ref;
11873 CVec_PublicKeyZ_free(_res_constr);
11876 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
11877 void* o_ptr = untag_ptr(o);
11878 CHECK_ACCESS(o_ptr);
11879 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
11880 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
11881 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11882 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
11883 return tag_ptr(ret_conv, true);
11886 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
11887 LDKDecodeError e_conv;
11888 e_conv.inner = untag_ptr(e);
11889 e_conv.is_owned = ptr_is_owned(e);
11890 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11891 e_conv = DecodeError_clone(&e_conv);
11892 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11893 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
11894 return tag_ptr(ret_conv, true);
11897 jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
11898 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
11899 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
11903 void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
11904 if (!ptr_is_owned(_res)) return;
11905 void* _res_ptr = untag_ptr(_res);
11906 CHECK_ACCESS(_res_ptr);
11907 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
11908 FREE(untag_ptr(_res));
11909 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
11912 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
11913 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11914 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
11915 return tag_ptr(ret_conv, true);
11917 int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
11918 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
11919 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
11923 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
11924 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
11925 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11926 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
11927 return tag_ptr(ret_conv, true);
11930 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) {
11931 void* o_ptr = untag_ptr(o);
11932 CHECK_ACCESS(o_ptr);
11933 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
11934 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
11935 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11936 *ret_copy = COption_ClosureReasonZ_some(o_conv);
11937 uint64_t ret_ref = tag_ptr(ret_copy, true);
11941 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() {
11942 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11943 *ret_copy = COption_ClosureReasonZ_none();
11944 uint64_t ret_ref = tag_ptr(ret_copy, true);
11948 void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) {
11949 if (!ptr_is_owned(_res)) return;
11950 void* _res_ptr = untag_ptr(_res);
11951 CHECK_ACCESS(_res_ptr);
11952 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
11953 FREE(untag_ptr(_res));
11954 COption_ClosureReasonZ_free(_res_conv);
11957 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
11958 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11959 *ret_copy = COption_ClosureReasonZ_clone(arg);
11960 uint64_t ret_ref = tag_ptr(ret_copy, true);
11963 int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) {
11964 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
11965 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
11969 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) {
11970 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
11971 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11972 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
11973 uint64_t ret_ref = tag_ptr(ret_copy, true);
11977 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) {
11978 void* o_ptr = untag_ptr(o);
11979 CHECK_ACCESS(o_ptr);
11980 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
11981 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
11982 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11983 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
11984 return tag_ptr(ret_conv, true);
11987 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
11988 LDKDecodeError e_conv;
11989 e_conv.inner = untag_ptr(e);
11990 e_conv.is_owned = ptr_is_owned(e);
11991 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11992 e_conv = DecodeError_clone(&e_conv);
11993 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11994 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
11995 return tag_ptr(ret_conv, true);
11998 jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) {
11999 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
12000 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
12004 void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) {
12005 if (!ptr_is_owned(_res)) return;
12006 void* _res_ptr = untag_ptr(_res);
12007 CHECK_ACCESS(_res_ptr);
12008 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
12009 FREE(untag_ptr(_res));
12010 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
12013 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
12014 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12015 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
12016 return tag_ptr(ret_conv, true);
12018 int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) {
12019 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
12020 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
12024 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) {
12025 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
12026 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12027 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
12028 return tag_ptr(ret_conv, true);
12031 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) {
12032 void* o_ptr = untag_ptr(o);
12033 CHECK_ACCESS(o_ptr);
12034 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
12035 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
12036 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12037 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
12038 uint64_t ret_ref = tag_ptr(ret_copy, true);
12042 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() {
12043 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12044 *ret_copy = COption_HTLCDestinationZ_none();
12045 uint64_t ret_ref = tag_ptr(ret_copy, true);
12049 void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) {
12050 if (!ptr_is_owned(_res)) return;
12051 void* _res_ptr = untag_ptr(_res);
12052 CHECK_ACCESS(_res_ptr);
12053 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
12054 FREE(untag_ptr(_res));
12055 COption_HTLCDestinationZ_free(_res_conv);
12058 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
12059 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12060 *ret_copy = COption_HTLCDestinationZ_clone(arg);
12061 uint64_t ret_ref = tag_ptr(ret_copy, true);
12064 int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) {
12065 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
12066 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
12070 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) {
12071 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
12072 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12073 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
12074 uint64_t ret_ref = tag_ptr(ret_copy, true);
12078 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) {
12079 void* o_ptr = untag_ptr(o);
12080 CHECK_ACCESS(o_ptr);
12081 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
12082 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
12083 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12084 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
12085 return tag_ptr(ret_conv, true);
12088 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
12089 LDKDecodeError e_conv;
12090 e_conv.inner = untag_ptr(e);
12091 e_conv.is_owned = ptr_is_owned(e);
12092 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12093 e_conv = DecodeError_clone(&e_conv);
12094 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12095 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
12096 return tag_ptr(ret_conv, true);
12099 jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) {
12100 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
12101 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
12105 void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) {
12106 if (!ptr_is_owned(_res)) return;
12107 void* _res_ptr = untag_ptr(_res);
12108 CHECK_ACCESS(_res_ptr);
12109 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
12110 FREE(untag_ptr(_res));
12111 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
12114 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
12115 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12116 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
12117 return tag_ptr(ret_conv, true);
12119 int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) {
12120 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
12121 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
12125 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) {
12126 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
12127 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12128 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
12129 return tag_ptr(ret_conv, true);
12132 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
12133 void* o_ptr = untag_ptr(o);
12134 CHECK_ACCESS(o_ptr);
12135 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
12136 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
12137 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12138 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
12139 uint64_t ret_ref = tag_ptr(ret_copy, true);
12143 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
12144 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12145 *ret_copy = COption_NetworkUpdateZ_none();
12146 uint64_t ret_ref = tag_ptr(ret_copy, true);
12150 void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
12151 if (!ptr_is_owned(_res)) return;
12152 void* _res_ptr = untag_ptr(_res);
12153 CHECK_ACCESS(_res_ptr);
12154 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
12155 FREE(untag_ptr(_res));
12156 COption_NetworkUpdateZ_free(_res_conv);
12159 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
12160 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12161 *ret_copy = COption_NetworkUpdateZ_clone(arg);
12162 uint64_t ret_ref = tag_ptr(ret_copy, true);
12165 int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
12166 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
12167 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
12171 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
12172 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
12173 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12174 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
12175 uint64_t ret_ref = tag_ptr(ret_copy, true);
12179 void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) {
12180 LDKCVec_SpendableOutputDescriptorZ _res_constr;
12181 _res_constr.datalen = _res->arr_len;
12182 if (_res_constr.datalen > 0)
12183 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
12185 _res_constr.data = NULL;
12186 uint64_t* _res_vals = _res->elems;
12187 for (size_t b = 0; b < _res_constr.datalen; b++) {
12188 uint64_t _res_conv_27 = _res_vals[b];
12189 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
12190 CHECK_ACCESS(_res_conv_27_ptr);
12191 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
12192 FREE(untag_ptr(_res_conv_27));
12193 _res_constr.data[b] = _res_conv_27_conv;
12196 CVec_SpendableOutputDescriptorZ_free(_res_constr);
12199 uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) {
12200 void* o_ptr = untag_ptr(o);
12201 CHECK_ACCESS(o_ptr);
12202 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
12203 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
12204 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12205 *ret_copy = COption_EventZ_some(o_conv);
12206 uint64_t ret_ref = tag_ptr(ret_copy, true);
12210 uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() {
12211 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12212 *ret_copy = COption_EventZ_none();
12213 uint64_t ret_ref = tag_ptr(ret_copy, true);
12217 void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) {
12218 if (!ptr_is_owned(_res)) return;
12219 void* _res_ptr = untag_ptr(_res);
12220 CHECK_ACCESS(_res_ptr);
12221 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
12222 FREE(untag_ptr(_res));
12223 COption_EventZ_free(_res_conv);
12226 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
12227 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12228 *ret_copy = COption_EventZ_clone(arg);
12229 uint64_t ret_ref = tag_ptr(ret_copy, true);
12232 int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) {
12233 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
12234 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
12238 uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) {
12239 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
12240 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12241 *ret_copy = COption_EventZ_clone(orig_conv);
12242 uint64_t ret_ref = tag_ptr(ret_copy, true);
12246 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) {
12247 void* o_ptr = untag_ptr(o);
12248 CHECK_ACCESS(o_ptr);
12249 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
12250 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
12251 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12252 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
12253 return tag_ptr(ret_conv, true);
12256 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
12257 LDKDecodeError e_conv;
12258 e_conv.inner = untag_ptr(e);
12259 e_conv.is_owned = ptr_is_owned(e);
12260 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12261 e_conv = DecodeError_clone(&e_conv);
12262 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12263 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
12264 return tag_ptr(ret_conv, true);
12267 jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) {
12268 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
12269 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
12273 void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) {
12274 if (!ptr_is_owned(_res)) return;
12275 void* _res_ptr = untag_ptr(_res);
12276 CHECK_ACCESS(_res_ptr);
12277 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
12278 FREE(untag_ptr(_res));
12279 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
12282 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
12283 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12284 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
12285 return tag_ptr(ret_conv, true);
12287 int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) {
12288 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
12289 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
12293 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) {
12294 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
12295 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12296 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
12297 return tag_ptr(ret_conv, true);
12300 void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) {
12301 LDKCVec_MessageSendEventZ _res_constr;
12302 _res_constr.datalen = _res->arr_len;
12303 if (_res_constr.datalen > 0)
12304 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
12306 _res_constr.data = NULL;
12307 uint64_t* _res_vals = _res->elems;
12308 for (size_t s = 0; s < _res_constr.datalen; s++) {
12309 uint64_t _res_conv_18 = _res_vals[s];
12310 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
12311 CHECK_ACCESS(_res_conv_18_ptr);
12312 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
12313 FREE(untag_ptr(_res_conv_18));
12314 _res_constr.data[s] = _res_conv_18_conv;
12317 CVec_MessageSendEventZ_free(_res_constr);
12320 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
12321 void* o_ptr = untag_ptr(o);
12322 CHECK_ACCESS(o_ptr);
12323 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
12324 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
12325 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12326 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
12327 return tag_ptr(ret_conv, true);
12330 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
12331 LDKAccessError e_conv = LDKAccessError_from_js(e);
12332 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12333 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
12334 return tag_ptr(ret_conv, true);
12337 jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
12338 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
12339 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
12343 void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
12344 if (!ptr_is_owned(_res)) return;
12345 void* _res_ptr = untag_ptr(_res);
12346 CHECK_ACCESS(_res_ptr);
12347 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
12348 FREE(untag_ptr(_res));
12349 CResult_TxOutAccessErrorZ_free(_res_conv);
12352 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
12353 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12354 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
12355 return tag_ptr(ret_conv, true);
12357 int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
12358 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
12359 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
12363 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
12364 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
12365 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12366 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
12367 return tag_ptr(ret_conv, true);
12370 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
12371 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12372 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
12373 return tag_ptr(ret_conv, true);
12375 int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) {
12376 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
12377 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
12381 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) {
12382 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
12383 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12384 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
12385 return tag_ptr(ret_conv, true);
12388 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) {
12389 LDKTransaction b_ref;
12390 b_ref.datalen = b->arr_len;
12391 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
12392 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
12393 b_ref.data_is_owned = true;
12394 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12395 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
12396 return tag_ptr(ret_conv, true);
12399 void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) {
12400 if (!ptr_is_owned(_res)) return;
12401 void* _res_ptr = untag_ptr(_res);
12402 CHECK_ACCESS(_res_ptr);
12403 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
12404 FREE(untag_ptr(_res));
12405 C2Tuple_usizeTransactionZ_free(_res_conv);
12408 void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) {
12409 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
12410 _res_constr.datalen = _res->arr_len;
12411 if (_res_constr.datalen > 0)
12412 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12414 _res_constr.data = NULL;
12415 uint64_t* _res_vals = _res->elems;
12416 for (size_t c = 0; c < _res_constr.datalen; c++) {
12417 uint64_t _res_conv_28 = _res_vals[c];
12418 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
12419 CHECK_ACCESS(_res_conv_28_ptr);
12420 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
12421 FREE(untag_ptr(_res_conv_28));
12422 _res_constr.data[c] = _res_conv_28_conv;
12425 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
12428 void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
12429 LDKCVec_TxidZ _res_constr;
12430 _res_constr.datalen = _res->arr_len;
12431 if (_res_constr.datalen > 0)
12432 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
12434 _res_constr.data = NULL;
12435 int8_tArray* _res_vals = (void*) _res->elems;
12436 for (size_t m = 0; m < _res_constr.datalen; m++) {
12437 int8_tArray _res_conv_12 = _res_vals[m];
12438 LDKThirtyTwoBytes _res_conv_12_ref;
12439 CHECK(_res_conv_12->arr_len == 32);
12440 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
12441 _res_constr.data[m] = _res_conv_12_ref;
12444 CVec_TxidZ_free(_res_constr);
12447 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() {
12448 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12449 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
12450 return tag_ptr(ret_conv, true);
12453 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) {
12454 LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e);
12455 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12456 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
12457 return tag_ptr(ret_conv, true);
12460 jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) {
12461 LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
12462 jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
12466 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) {
12467 if (!ptr_is_owned(_res)) return;
12468 void* _res_ptr = untag_ptr(_res);
12469 CHECK_ACCESS(_res_ptr);
12470 LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
12471 FREE(untag_ptr(_res));
12472 CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
12475 static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
12476 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12477 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
12478 return tag_ptr(ret_conv, true);
12480 int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) {
12481 LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
12482 int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
12486 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) {
12487 LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
12488 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12489 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
12490 return tag_ptr(ret_conv, true);
12493 void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
12494 LDKCVec_MonitorEventZ _res_constr;
12495 _res_constr.datalen = _res->arr_len;
12496 if (_res_constr.datalen > 0)
12497 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12499 _res_constr.data = NULL;
12500 uint64_t* _res_vals = _res->elems;
12501 for (size_t o = 0; o < _res_constr.datalen; o++) {
12502 uint64_t _res_conv_14 = _res_vals[o];
12503 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
12504 CHECK_ACCESS(_res_conv_14_ptr);
12505 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
12506 FREE(untag_ptr(_res_conv_14));
12507 _res_constr.data[o] = _res_conv_14_conv;
12510 CVec_MonitorEventZ_free(_res_constr);
12513 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
12514 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12515 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
12516 return tag_ptr(ret_conv, true);
12518 int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) {
12519 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
12520 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
12524 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) {
12525 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
12526 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12527 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
12528 return tag_ptr(ret_conv, true);
12531 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) {
12532 LDKOutPoint a_conv;
12533 a_conv.inner = untag_ptr(a);
12534 a_conv.is_owned = ptr_is_owned(a);
12535 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
12536 a_conv = OutPoint_clone(&a_conv);
12537 LDKCVec_MonitorEventZ b_constr;
12538 b_constr.datalen = b->arr_len;
12539 if (b_constr.datalen > 0)
12540 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12542 b_constr.data = NULL;
12543 uint64_t* b_vals = b->elems;
12544 for (size_t o = 0; o < b_constr.datalen; o++) {
12545 uint64_t b_conv_14 = b_vals[o];
12546 void* b_conv_14_ptr = untag_ptr(b_conv_14);
12547 CHECK_ACCESS(b_conv_14_ptr);
12548 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
12549 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
12550 b_constr.data[o] = b_conv_14_conv;
12553 LDKPublicKey c_ref;
12554 CHECK(c->arr_len == 33);
12555 memcpy(c_ref.compressed_form, c->elems, 33); FREE(c);
12556 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12557 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
12558 return tag_ptr(ret_conv, true);
12561 void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) {
12562 if (!ptr_is_owned(_res)) return;
12563 void* _res_ptr = untag_ptr(_res);
12564 CHECK_ACCESS(_res_ptr);
12565 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
12566 FREE(untag_ptr(_res));
12567 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
12570 void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) {
12571 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
12572 _res_constr.datalen = _res->arr_len;
12573 if (_res_constr.datalen > 0)
12574 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
12576 _res_constr.data = NULL;
12577 uint64_t* _res_vals = _res->elems;
12578 for (size_t x = 0; x < _res_constr.datalen; x++) {
12579 uint64_t _res_conv_49 = _res_vals[x];
12580 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
12581 CHECK_ACCESS(_res_conv_49_ptr);
12582 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
12583 FREE(untag_ptr(_res_conv_49));
12584 _res_constr.data[x] = _res_conv_49_conv;
12587 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
12590 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint64_t o) {
12591 void* o_ptr = untag_ptr(o);
12592 CHECK_ACCESS(o_ptr);
12593 LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
12594 o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(o));
12595 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12596 *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
12597 uint64_t ret_ref = tag_ptr(ret_copy, true);
12601 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() {
12602 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12603 *ret_copy = COption_C2Tuple_usizeTransactionZZ_none();
12604 uint64_t ret_ref = tag_ptr(ret_copy, true);
12608 void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint64_t _res) {
12609 if (!ptr_is_owned(_res)) return;
12610 void* _res_ptr = untag_ptr(_res);
12611 CHECK_ACCESS(_res_ptr);
12612 LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
12613 FREE(untag_ptr(_res));
12614 COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
12617 static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
12618 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12619 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
12620 uint64_t ret_ref = tag_ptr(ret_copy, true);
12623 int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint64_t arg) {
12624 LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(arg);
12625 int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
12629 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint64_t orig) {
12630 LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(orig);
12631 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12632 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv);
12633 uint64_t ret_ref = tag_ptr(ret_copy, true);
12637 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
12638 LDKFixedPenaltyScorer o_conv;
12639 o_conv.inner = untag_ptr(o);
12640 o_conv.is_owned = ptr_is_owned(o);
12641 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12642 o_conv = FixedPenaltyScorer_clone(&o_conv);
12643 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12644 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
12645 return tag_ptr(ret_conv, true);
12648 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
12649 LDKDecodeError e_conv;
12650 e_conv.inner = untag_ptr(e);
12651 e_conv.is_owned = ptr_is_owned(e);
12652 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12653 e_conv = DecodeError_clone(&e_conv);
12654 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12655 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
12656 return tag_ptr(ret_conv, true);
12659 jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) {
12660 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
12661 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
12665 void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) {
12666 if (!ptr_is_owned(_res)) return;
12667 void* _res_ptr = untag_ptr(_res);
12668 CHECK_ACCESS(_res_ptr);
12669 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
12670 FREE(untag_ptr(_res));
12671 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
12674 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
12675 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12676 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
12677 return tag_ptr(ret_conv, true);
12679 int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) {
12680 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
12681 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
12685 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) {
12686 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
12687 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12688 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
12689 return tag_ptr(ret_conv, true);
12692 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
12693 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12694 *ret_conv = C2Tuple_u64u64Z_clone(arg);
12695 return tag_ptr(ret_conv, true);
12697 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) {
12698 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
12699 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
12703 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) {
12704 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
12705 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12706 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
12707 return tag_ptr(ret_conv, true);
12710 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
12711 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12712 *ret_conv = C2Tuple_u64u64Z_new(a, b);
12713 return tag_ptr(ret_conv, true);
12716 void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) {
12717 if (!ptr_is_owned(_res)) return;
12718 void* _res_ptr = untag_ptr(_res);
12719 CHECK_ACCESS(_res_ptr);
12720 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
12721 FREE(untag_ptr(_res));
12722 C2Tuple_u64u64Z_free(_res_conv);
12725 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) {
12726 void* o_ptr = untag_ptr(o);
12727 CHECK_ACCESS(o_ptr);
12728 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
12729 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
12730 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12731 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
12732 uint64_t ret_ref = tag_ptr(ret_copy, true);
12736 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() {
12737 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12738 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
12739 uint64_t ret_ref = tag_ptr(ret_copy, true);
12743 void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) {
12744 if (!ptr_is_owned(_res)) return;
12745 void* _res_ptr = untag_ptr(_res);
12746 CHECK_ACCESS(_res_ptr);
12747 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
12748 FREE(untag_ptr(_res));
12749 COption_C2Tuple_u64u64ZZ_free(_res_conv);
12752 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
12753 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12754 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
12755 uint64_t ret_ref = tag_ptr(ret_copy, true);
12758 int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) {
12759 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
12760 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
12764 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) {
12765 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
12766 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12767 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
12768 uint64_t ret_ref = tag_ptr(ret_copy, true);
12772 void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
12773 LDKCVec_NodeIdZ _res_constr;
12774 _res_constr.datalen = _res->arr_len;
12775 if (_res_constr.datalen > 0)
12776 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
12778 _res_constr.data = NULL;
12779 uint64_t* _res_vals = _res->elems;
12780 for (size_t i = 0; i < _res_constr.datalen; i++) {
12781 uint64_t _res_conv_8 = _res_vals[i];
12782 LDKNodeId _res_conv_8_conv;
12783 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
12784 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
12785 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
12786 _res_constr.data[i] = _res_conv_8_conv;
12789 CVec_NodeIdZ_free(_res_constr);
12792 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) {
12793 LDKProbabilisticScorer o_conv;
12794 o_conv.inner = untag_ptr(o);
12795 o_conv.is_owned = ptr_is_owned(o);
12796 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12797 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
12799 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12800 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
12801 return tag_ptr(ret_conv, true);
12804 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
12805 LDKDecodeError e_conv;
12806 e_conv.inner = untag_ptr(e);
12807 e_conv.is_owned = ptr_is_owned(e);
12808 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12809 e_conv = DecodeError_clone(&e_conv);
12810 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12811 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
12812 return tag_ptr(ret_conv, true);
12815 jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) {
12816 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
12817 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
12821 void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) {
12822 if (!ptr_is_owned(_res)) return;
12823 void* _res_ptr = untag_ptr(_res);
12824 CHECK_ACCESS(_res_ptr);
12825 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
12826 FREE(untag_ptr(_res));
12827 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
12830 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) {
12831 LDKInitFeatures o_conv;
12832 o_conv.inner = untag_ptr(o);
12833 o_conv.is_owned = ptr_is_owned(o);
12834 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12835 o_conv = InitFeatures_clone(&o_conv);
12836 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12837 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
12838 return tag_ptr(ret_conv, true);
12841 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
12842 LDKDecodeError e_conv;
12843 e_conv.inner = untag_ptr(e);
12844 e_conv.is_owned = ptr_is_owned(e);
12845 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12846 e_conv = DecodeError_clone(&e_conv);
12847 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12848 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
12849 return tag_ptr(ret_conv, true);
12852 jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12853 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
12854 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
12858 void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) {
12859 if (!ptr_is_owned(_res)) return;
12860 void* _res_ptr = untag_ptr(_res);
12861 CHECK_ACCESS(_res_ptr);
12862 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
12863 FREE(untag_ptr(_res));
12864 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
12867 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12868 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12869 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
12870 return tag_ptr(ret_conv, true);
12872 int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12873 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
12874 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12878 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) {
12879 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
12880 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12881 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
12882 return tag_ptr(ret_conv, true);
12885 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) {
12886 LDKChannelFeatures o_conv;
12887 o_conv.inner = untag_ptr(o);
12888 o_conv.is_owned = ptr_is_owned(o);
12889 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12890 o_conv = ChannelFeatures_clone(&o_conv);
12891 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12892 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
12893 return tag_ptr(ret_conv, true);
12896 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
12897 LDKDecodeError e_conv;
12898 e_conv.inner = untag_ptr(e);
12899 e_conv.is_owned = ptr_is_owned(e);
12900 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12901 e_conv = DecodeError_clone(&e_conv);
12902 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12903 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
12904 return tag_ptr(ret_conv, true);
12907 jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12908 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
12909 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
12913 void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) {
12914 if (!ptr_is_owned(_res)) return;
12915 void* _res_ptr = untag_ptr(_res);
12916 CHECK_ACCESS(_res_ptr);
12917 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
12918 FREE(untag_ptr(_res));
12919 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
12922 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12923 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12924 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
12925 return tag_ptr(ret_conv, true);
12927 int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12928 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
12929 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12933 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) {
12934 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
12935 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12936 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
12937 return tag_ptr(ret_conv, true);
12940 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) {
12941 LDKNodeFeatures o_conv;
12942 o_conv.inner = untag_ptr(o);
12943 o_conv.is_owned = ptr_is_owned(o);
12944 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12945 o_conv = NodeFeatures_clone(&o_conv);
12946 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12947 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
12948 return tag_ptr(ret_conv, true);
12951 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
12952 LDKDecodeError e_conv;
12953 e_conv.inner = untag_ptr(e);
12954 e_conv.is_owned = ptr_is_owned(e);
12955 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12956 e_conv = DecodeError_clone(&e_conv);
12957 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12958 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
12959 return tag_ptr(ret_conv, true);
12962 jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12963 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
12964 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
12968 void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) {
12969 if (!ptr_is_owned(_res)) return;
12970 void* _res_ptr = untag_ptr(_res);
12971 CHECK_ACCESS(_res_ptr);
12972 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
12973 FREE(untag_ptr(_res));
12974 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
12977 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12978 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12979 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
12980 return tag_ptr(ret_conv, true);
12982 int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12983 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
12984 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12988 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) {
12989 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
12990 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12991 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
12992 return tag_ptr(ret_conv, true);
12995 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) {
12996 LDKInvoiceFeatures o_conv;
12997 o_conv.inner = untag_ptr(o);
12998 o_conv.is_owned = ptr_is_owned(o);
12999 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13000 o_conv = InvoiceFeatures_clone(&o_conv);
13001 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13002 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
13003 return tag_ptr(ret_conv, true);
13006 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
13007 LDKDecodeError e_conv;
13008 e_conv.inner = untag_ptr(e);
13009 e_conv.is_owned = ptr_is_owned(e);
13010 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13011 e_conv = DecodeError_clone(&e_conv);
13012 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13013 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
13014 return tag_ptr(ret_conv, true);
13017 jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13018 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
13019 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
13023 void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) {
13024 if (!ptr_is_owned(_res)) return;
13025 void* _res_ptr = untag_ptr(_res);
13026 CHECK_ACCESS(_res_ptr);
13027 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
13028 FREE(untag_ptr(_res));
13029 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
13032 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13033 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13034 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
13035 return tag_ptr(ret_conv, true);
13037 int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13038 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
13039 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13043 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) {
13044 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
13045 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13046 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
13047 return tag_ptr(ret_conv, true);
13050 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
13051 LDKChannelTypeFeatures o_conv;
13052 o_conv.inner = untag_ptr(o);
13053 o_conv.is_owned = ptr_is_owned(o);
13054 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13055 o_conv = ChannelTypeFeatures_clone(&o_conv);
13056 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13057 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
13058 return tag_ptr(ret_conv, true);
13061 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
13062 LDKDecodeError e_conv;
13063 e_conv.inner = untag_ptr(e);
13064 e_conv.is_owned = ptr_is_owned(e);
13065 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13066 e_conv = DecodeError_clone(&e_conv);
13067 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13068 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
13069 return tag_ptr(ret_conv, true);
13072 jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13073 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
13074 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
13078 void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) {
13079 if (!ptr_is_owned(_res)) return;
13080 void* _res_ptr = untag_ptr(_res);
13081 CHECK_ACCESS(_res_ptr);
13082 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
13083 FREE(untag_ptr(_res));
13084 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
13087 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13088 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13089 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
13090 return tag_ptr(ret_conv, true);
13092 int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13093 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
13094 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13098 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) {
13099 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
13100 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13101 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
13102 return tag_ptr(ret_conv, true);
13105 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) {
13107 o_conv.inner = untag_ptr(o);
13108 o_conv.is_owned = ptr_is_owned(o);
13109 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13110 o_conv = NodeId_clone(&o_conv);
13111 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13112 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
13113 return tag_ptr(ret_conv, true);
13116 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
13117 LDKDecodeError e_conv;
13118 e_conv.inner = untag_ptr(e);
13119 e_conv.is_owned = ptr_is_owned(e);
13120 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13121 e_conv = DecodeError_clone(&e_conv);
13122 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13123 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
13124 return tag_ptr(ret_conv, true);
13127 jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) {
13128 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
13129 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
13133 void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) {
13134 if (!ptr_is_owned(_res)) return;
13135 void* _res_ptr = untag_ptr(_res);
13136 CHECK_ACCESS(_res_ptr);
13137 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
13138 FREE(untag_ptr(_res));
13139 CResult_NodeIdDecodeErrorZ_free(_res_conv);
13142 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
13143 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13144 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
13145 return tag_ptr(ret_conv, true);
13147 int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) {
13148 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
13149 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
13153 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint64_t orig) {
13154 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
13155 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13156 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
13157 return tag_ptr(ret_conv, true);
13160 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint64_t o) {
13161 void* o_ptr = untag_ptr(o);
13162 CHECK_ACCESS(o_ptr);
13163 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
13164 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
13165 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13166 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
13167 return tag_ptr(ret_conv, true);
13170 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
13171 LDKDecodeError e_conv;
13172 e_conv.inner = untag_ptr(e);
13173 e_conv.is_owned = ptr_is_owned(e);
13174 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13175 e_conv = DecodeError_clone(&e_conv);
13176 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13177 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
13178 return tag_ptr(ret_conv, true);
13181 jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint64_t o) {
13182 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
13183 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
13187 void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint64_t _res) {
13188 if (!ptr_is_owned(_res)) return;
13189 void* _res_ptr = untag_ptr(_res);
13190 CHECK_ACCESS(_res_ptr);
13191 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
13192 FREE(untag_ptr(_res));
13193 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
13196 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
13197 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13198 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
13199 return tag_ptr(ret_conv, true);
13201 int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint64_t arg) {
13202 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
13203 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
13207 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint64_t orig) {
13208 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
13209 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13210 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
13211 return tag_ptr(ret_conv, true);
13214 uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
13215 void* o_ptr = untag_ptr(o);
13216 CHECK_ACCESS(o_ptr);
13217 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
13218 if (o_conv.free == LDKAccess_JCalls_free) {
13219 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
13220 LDKAccess_JCalls_cloned(&o_conv);
13222 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13223 *ret_copy = COption_AccessZ_some(o_conv);
13224 uint64_t ret_ref = tag_ptr(ret_copy, true);
13228 uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
13229 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13230 *ret_copy = COption_AccessZ_none();
13231 uint64_t ret_ref = tag_ptr(ret_copy, true);
13235 void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
13236 if (!ptr_is_owned(_res)) return;
13237 void* _res_ptr = untag_ptr(_res);
13238 CHECK_ACCESS(_res_ptr);
13239 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
13240 FREE(untag_ptr(_res));
13241 COption_AccessZ_free(_res_conv);
13244 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
13245 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13246 *ret_conv = CResult_boolLightningErrorZ_ok(o);
13247 return tag_ptr(ret_conv, true);
13250 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint64_t e) {
13251 LDKLightningError e_conv;
13252 e_conv.inner = untag_ptr(e);
13253 e_conv.is_owned = ptr_is_owned(e);
13254 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13255 e_conv = LightningError_clone(&e_conv);
13256 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13257 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
13258 return tag_ptr(ret_conv, true);
13261 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint64_t o) {
13262 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
13263 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
13267 void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint64_t _res) {
13268 if (!ptr_is_owned(_res)) return;
13269 void* _res_ptr = untag_ptr(_res);
13270 CHECK_ACCESS(_res_ptr);
13271 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
13272 FREE(untag_ptr(_res));
13273 CResult_boolLightningErrorZ_free(_res_conv);
13276 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
13277 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13278 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
13279 return tag_ptr(ret_conv, true);
13281 int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint64_t arg) {
13282 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
13283 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
13287 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) TS_CResult_boolLightningErrorZ_clone(uint64_t orig) {
13288 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
13289 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13290 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
13291 return tag_ptr(ret_conv, true);
13294 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
13295 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13296 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
13297 return tag_ptr(ret_conv, true);
13299 int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint64_t arg) {
13300 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
13301 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
13305 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint64_t orig) {
13306 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
13307 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13308 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
13309 return tag_ptr(ret_conv, true);
13312 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint64_t a, uint64_t b, uint64_t c) {
13313 LDKChannelAnnouncement a_conv;
13314 a_conv.inner = untag_ptr(a);
13315 a_conv.is_owned = ptr_is_owned(a);
13316 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
13317 a_conv = ChannelAnnouncement_clone(&a_conv);
13318 LDKChannelUpdate b_conv;
13319 b_conv.inner = untag_ptr(b);
13320 b_conv.is_owned = ptr_is_owned(b);
13321 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
13322 b_conv = ChannelUpdate_clone(&b_conv);
13323 LDKChannelUpdate c_conv;
13324 c_conv.inner = untag_ptr(c);
13325 c_conv.is_owned = ptr_is_owned(c);
13326 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
13327 c_conv = ChannelUpdate_clone(&c_conv);
13328 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13329 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
13330 return tag_ptr(ret_conv, true);
13333 void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint64_t _res) {
13334 if (!ptr_is_owned(_res)) return;
13335 void* _res_ptr = untag_ptr(_res);
13336 CHECK_ACCESS(_res_ptr);
13337 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
13338 FREE(untag_ptr(_res));
13339 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
13342 void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_tArray _res) {
13343 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr;
13344 _res_constr.datalen = _res->arr_len;
13345 if (_res_constr.datalen > 0)
13346 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
13348 _res_constr.data = NULL;
13349 uint64_t* _res_vals = _res->elems;
13350 for (size_t h = 0; h < _res_constr.datalen; h++) {
13351 uint64_t _res_conv_59 = _res_vals[h];
13352 void* _res_conv_59_ptr = untag_ptr(_res_conv_59);
13353 CHECK_ACCESS(_res_conv_59_ptr);
13354 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
13355 FREE(untag_ptr(_res_conv_59));
13356 _res_constr.data[h] = _res_conv_59_conv;
13359 CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
13362 void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_NodeAnnouncementZ_free(uint64_tArray _res) {
13363 LDKCVec_NodeAnnouncementZ _res_constr;
13364 _res_constr.datalen = _res->arr_len;
13365 if (_res_constr.datalen > 0)
13366 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
13368 _res_constr.data = NULL;
13369 uint64_t* _res_vals = _res->elems;
13370 for (size_t s = 0; s < _res_constr.datalen; s++) {
13371 uint64_t _res_conv_18 = _res_vals[s];
13372 LDKNodeAnnouncement _res_conv_18_conv;
13373 _res_conv_18_conv.inner = untag_ptr(_res_conv_18);
13374 _res_conv_18_conv.is_owned = ptr_is_owned(_res_conv_18);
13375 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
13376 _res_constr.data[s] = _res_conv_18_conv;
13379 CVec_NodeAnnouncementZ_free(_res_constr);
13382 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
13383 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13384 *ret_conv = CResult_NoneLightningErrorZ_ok();
13385 return tag_ptr(ret_conv, true);
13388 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint64_t e) {
13389 LDKLightningError e_conv;
13390 e_conv.inner = untag_ptr(e);
13391 e_conv.is_owned = ptr_is_owned(e);
13392 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13393 e_conv = LightningError_clone(&e_conv);
13394 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13395 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
13396 return tag_ptr(ret_conv, true);
13399 jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint64_t o) {
13400 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
13401 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
13405 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint64_t _res) {
13406 if (!ptr_is_owned(_res)) return;
13407 void* _res_ptr = untag_ptr(_res);
13408 CHECK_ACCESS(_res_ptr);
13409 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
13410 FREE(untag_ptr(_res));
13411 CResult_NoneLightningErrorZ_free(_res_conv);
13414 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
13415 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13416 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
13417 return tag_ptr(ret_conv, true);
13419 int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint64_t arg) {
13420 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
13421 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
13425 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) TS_CResult_NoneLightningErrorZ_clone(uint64_t orig) {
13426 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
13427 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13428 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
13429 return tag_ptr(ret_conv, true);
13432 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok(uint64_t o) {
13433 LDKChannelUpdateInfo o_conv;
13434 o_conv.inner = untag_ptr(o);
13435 o_conv.is_owned = ptr_is_owned(o);
13436 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13437 o_conv = ChannelUpdateInfo_clone(&o_conv);
13438 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13439 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
13440 return tag_ptr(ret_conv, true);
13443 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
13444 LDKDecodeError e_conv;
13445 e_conv.inner = untag_ptr(e);
13446 e_conv.is_owned = ptr_is_owned(e);
13447 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13448 e_conv = DecodeError_clone(&e_conv);
13449 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13450 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
13451 return tag_ptr(ret_conv, true);
13454 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(uint64_t o) {
13455 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
13456 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
13460 void __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_free"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_free(uint64_t _res) {
13461 if (!ptr_is_owned(_res)) return;
13462 void* _res_ptr = untag_ptr(_res);
13463 CHECK_ACCESS(_res_ptr);
13464 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
13465 FREE(untag_ptr(_res));
13466 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
13469 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
13470 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13471 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
13472 return tag_ptr(ret_conv, true);
13474 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13475 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
13476 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
13480 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone(uint64_t orig) {
13481 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
13482 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13483 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
13484 return tag_ptr(ret_conv, true);
13487 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint64_t o) {
13488 LDKChannelInfo o_conv;
13489 o_conv.inner = untag_ptr(o);
13490 o_conv.is_owned = ptr_is_owned(o);
13491 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13492 o_conv = ChannelInfo_clone(&o_conv);
13493 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13494 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
13495 return tag_ptr(ret_conv, true);
13498 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
13499 LDKDecodeError e_conv;
13500 e_conv.inner = untag_ptr(e);
13501 e_conv.is_owned = ptr_is_owned(e);
13502 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13503 e_conv = DecodeError_clone(&e_conv);
13504 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13505 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
13506 return tag_ptr(ret_conv, true);
13509 jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint64_t o) {
13510 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
13511 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
13515 void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint64_t _res) {
13516 if (!ptr_is_owned(_res)) return;
13517 void* _res_ptr = untag_ptr(_res);
13518 CHECK_ACCESS(_res_ptr);
13519 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
13520 FREE(untag_ptr(_res));
13521 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
13524 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
13525 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13526 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
13527 return tag_ptr(ret_conv, true);
13529 int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13530 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
13531 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
13535 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint64_t orig) {
13536 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
13537 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13538 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
13539 return tag_ptr(ret_conv, true);
13542 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint64_t o) {
13543 LDKRoutingFees o_conv;
13544 o_conv.inner = untag_ptr(o);
13545 o_conv.is_owned = ptr_is_owned(o);
13546 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13547 o_conv = RoutingFees_clone(&o_conv);
13548 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13549 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
13550 return tag_ptr(ret_conv, true);
13553 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
13554 LDKDecodeError e_conv;
13555 e_conv.inner = untag_ptr(e);
13556 e_conv.is_owned = ptr_is_owned(e);
13557 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13558 e_conv = DecodeError_clone(&e_conv);
13559 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13560 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
13561 return tag_ptr(ret_conv, true);
13564 jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint64_t o) {
13565 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
13566 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
13570 void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint64_t _res) {
13571 if (!ptr_is_owned(_res)) return;
13572 void* _res_ptr = untag_ptr(_res);
13573 CHECK_ACCESS(_res_ptr);
13574 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
13575 FREE(untag_ptr(_res));
13576 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
13579 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
13580 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13581 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
13582 return tag_ptr(ret_conv, true);
13584 int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint64_t arg) {
13585 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
13586 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
13590 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint64_t orig) {
13591 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
13592 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13593 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
13594 return tag_ptr(ret_conv, true);
13597 void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint64_tArray _res) {
13598 LDKCVec_NetAddressZ _res_constr;
13599 _res_constr.datalen = _res->arr_len;
13600 if (_res_constr.datalen > 0)
13601 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13603 _res_constr.data = NULL;
13604 uint64_t* _res_vals = _res->elems;
13605 for (size_t m = 0; m < _res_constr.datalen; m++) {
13606 uint64_t _res_conv_12 = _res_vals[m];
13607 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
13608 CHECK_ACCESS(_res_conv_12_ptr);
13609 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
13610 FREE(untag_ptr(_res_conv_12));
13611 _res_constr.data[m] = _res_conv_12_conv;
13614 CVec_NetAddressZ_free(_res_constr);
13617 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint64_t o) {
13618 LDKNodeAnnouncementInfo o_conv;
13619 o_conv.inner = untag_ptr(o);
13620 o_conv.is_owned = ptr_is_owned(o);
13621 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13622 o_conv = NodeAnnouncementInfo_clone(&o_conv);
13623 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13624 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
13625 return tag_ptr(ret_conv, true);
13628 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
13629 LDKDecodeError e_conv;
13630 e_conv.inner = untag_ptr(e);
13631 e_conv.is_owned = ptr_is_owned(e);
13632 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13633 e_conv = DecodeError_clone(&e_conv);
13634 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13635 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
13636 return tag_ptr(ret_conv, true);
13639 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint64_t o) {
13640 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
13641 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
13645 void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint64_t _res) {
13646 if (!ptr_is_owned(_res)) return;
13647 void* _res_ptr = untag_ptr(_res);
13648 CHECK_ACCESS(_res_ptr);
13649 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
13650 FREE(untag_ptr(_res));
13651 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
13654 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
13655 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13656 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
13657 return tag_ptr(ret_conv, true);
13659 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13660 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
13661 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
13665 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint64_t orig) {
13666 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
13667 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13668 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
13669 return tag_ptr(ret_conv, true);
13672 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS_CResult_NodeAliasDecodeErrorZ_ok(uint64_t o) {
13673 LDKNodeAlias o_conv;
13674 o_conv.inner = untag_ptr(o);
13675 o_conv.is_owned = ptr_is_owned(o);
13676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13677 o_conv = NodeAlias_clone(&o_conv);
13678 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13679 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
13680 return tag_ptr(ret_conv, true);
13683 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
13684 LDKDecodeError e_conv;
13685 e_conv.inner = untag_ptr(e);
13686 e_conv.is_owned = ptr_is_owned(e);
13687 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13688 e_conv = DecodeError_clone(&e_conv);
13689 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13690 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
13691 return tag_ptr(ret_conv, true);
13694 jboolean __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_is_ok"))) TS_CResult_NodeAliasDecodeErrorZ_is_ok(uint64_t o) {
13695 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
13696 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
13700 void __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_free"))) TS_CResult_NodeAliasDecodeErrorZ_free(uint64_t _res) {
13701 if (!ptr_is_owned(_res)) return;
13702 void* _res_ptr = untag_ptr(_res);
13703 CHECK_ACCESS(_res_ptr);
13704 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
13705 FREE(untag_ptr(_res));
13706 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
13709 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
13710 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13711 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
13712 return tag_ptr(ret_conv, true);
13714 int64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAliasDecodeErrorZ_clone_ptr(uint64_t arg) {
13715 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
13716 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
13720 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone"))) TS_CResult_NodeAliasDecodeErrorZ_clone(uint64_t orig) {
13721 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
13722 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13723 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
13724 return tag_ptr(ret_conv, true);
13727 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_CResult_NodeInfoDecodeErrorZ_ok(uint64_t o) {
13728 LDKNodeInfo 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 = NodeInfo_clone(&o_conv);
13733 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13734 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
13735 return tag_ptr(ret_conv, true);
13738 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_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_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13745 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
13746 return tag_ptr(ret_conv, true);
13749 jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint64_t o) {
13750 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
13751 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
13755 void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_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_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
13760 FREE(untag_ptr(_res));
13761 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
13764 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
13765 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13766 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
13767 return tag_ptr(ret_conv, true);
13769 int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13770 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
13771 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
13775 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint64_t orig) {
13776 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
13777 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13778 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
13779 return tag_ptr(ret_conv, true);
13782 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint64_t o) {
13783 LDKNetworkGraph 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 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
13789 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13790 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
13791 return tag_ptr(ret_conv, true);
13794 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
13795 LDKDecodeError e_conv;
13796 e_conv.inner = untag_ptr(e);
13797 e_conv.is_owned = ptr_is_owned(e);
13798 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13799 e_conv = DecodeError_clone(&e_conv);
13800 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13801 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
13802 return tag_ptr(ret_conv, true);
13805 jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint64_t o) {
13806 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
13807 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
13811 void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint64_t _res) {
13812 if (!ptr_is_owned(_res)) return;
13813 void* _res_ptr = untag_ptr(_res);
13814 CHECK_ACCESS(_res_ptr);
13815 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
13816 FREE(untag_ptr(_res));
13817 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
13820 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint64_tArray o) {
13821 LDKCVec_NetAddressZ o_constr;
13822 o_constr.datalen = o->arr_len;
13823 if (o_constr.datalen > 0)
13824 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13826 o_constr.data = NULL;
13827 uint64_t* o_vals = o->elems;
13828 for (size_t m = 0; m < o_constr.datalen; m++) {
13829 uint64_t o_conv_12 = o_vals[m];
13830 void* o_conv_12_ptr = untag_ptr(o_conv_12);
13831 CHECK_ACCESS(o_conv_12_ptr);
13832 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
13833 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
13834 o_constr.data[m] = o_conv_12_conv;
13837 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13838 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
13839 uint64_t ret_ref = tag_ptr(ret_copy, true);
13843 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() {
13844 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13845 *ret_copy = COption_CVec_NetAddressZZ_none();
13846 uint64_t ret_ref = tag_ptr(ret_copy, true);
13850 void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint64_t _res) {
13851 if (!ptr_is_owned(_res)) return;
13852 void* _res_ptr = untag_ptr(_res);
13853 CHECK_ACCESS(_res_ptr);
13854 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
13855 FREE(untag_ptr(_res));
13856 COption_CVec_NetAddressZZ_free(_res_conv);
13859 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
13860 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13861 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
13862 uint64_t ret_ref = tag_ptr(ret_copy, true);
13865 int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint64_t arg) {
13866 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
13867 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
13871 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_COption_CVec_NetAddressZZ_clone(uint64_t orig) {
13872 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
13873 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13874 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
13875 uint64_t ret_ref = tag_ptr(ret_copy, true);
13879 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13880 LDKDelayedPaymentOutputDescriptor o_conv;
13881 o_conv.inner = untag_ptr(o);
13882 o_conv.is_owned = ptr_is_owned(o);
13883 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13884 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
13885 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13886 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13887 return tag_ptr(ret_conv, true);
13890 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13891 LDKDecodeError e_conv;
13892 e_conv.inner = untag_ptr(e);
13893 e_conv.is_owned = ptr_is_owned(e);
13894 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13895 e_conv = DecodeError_clone(&e_conv);
13896 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13897 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13898 return tag_ptr(ret_conv, true);
13901 jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13902 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13903 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13907 void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13908 if (!ptr_is_owned(_res)) return;
13909 void* _res_ptr = untag_ptr(_res);
13910 CHECK_ACCESS(_res_ptr);
13911 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13912 FREE(untag_ptr(_res));
13913 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13916 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13917 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13918 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13919 return tag_ptr(ret_conv, true);
13921 int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13922 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13923 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13927 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13928 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13929 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13930 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13931 return tag_ptr(ret_conv, true);
13934 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13935 LDKStaticPaymentOutputDescriptor o_conv;
13936 o_conv.inner = untag_ptr(o);
13937 o_conv.is_owned = ptr_is_owned(o);
13938 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13939 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
13940 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13941 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13942 return tag_ptr(ret_conv, true);
13945 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13946 LDKDecodeError e_conv;
13947 e_conv.inner = untag_ptr(e);
13948 e_conv.is_owned = ptr_is_owned(e);
13949 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13950 e_conv = DecodeError_clone(&e_conv);
13951 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13952 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13953 return tag_ptr(ret_conv, true);
13956 jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13957 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13958 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13962 void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13963 if (!ptr_is_owned(_res)) return;
13964 void* _res_ptr = untag_ptr(_res);
13965 CHECK_ACCESS(_res_ptr);
13966 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13967 FREE(untag_ptr(_res));
13968 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13971 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13972 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13973 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13974 return tag_ptr(ret_conv, true);
13976 int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13977 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13978 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13982 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13983 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13984 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13985 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13986 return tag_ptr(ret_conv, true);
13989 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13990 void* o_ptr = untag_ptr(o);
13991 CHECK_ACCESS(o_ptr);
13992 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
13993 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
13994 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13995 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
13996 return tag_ptr(ret_conv, true);
13999 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14000 LDKDecodeError e_conv;
14001 e_conv.inner = untag_ptr(e);
14002 e_conv.is_owned = ptr_is_owned(e);
14003 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14004 e_conv = DecodeError_clone(&e_conv);
14005 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14006 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
14007 return tag_ptr(ret_conv, true);
14010 jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14011 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14012 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14016 void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14017 if (!ptr_is_owned(_res)) return;
14018 void* _res_ptr = untag_ptr(_res);
14019 CHECK_ACCESS(_res_ptr);
14020 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
14021 FREE(untag_ptr(_res));
14022 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
14025 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14026 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14027 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
14028 return tag_ptr(ret_conv, true);
14030 int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14031 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14032 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14036 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14037 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14038 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14039 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
14040 return tag_ptr(ret_conv, true);
14043 void __attribute__((export_name("TS_CVec_PaymentPreimageZ_free"))) TS_CVec_PaymentPreimageZ_free(ptrArray _res) {
14044 LDKCVec_PaymentPreimageZ _res_constr;
14045 _res_constr.datalen = _res->arr_len;
14046 if (_res_constr.datalen > 0)
14047 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
14049 _res_constr.data = NULL;
14050 int8_tArray* _res_vals = (void*) _res->elems;
14051 for (size_t m = 0; m < _res_constr.datalen; m++) {
14052 int8_tArray _res_conv_12 = _res_vals[m];
14053 LDKThirtyTwoBytes _res_conv_12_ref;
14054 CHECK(_res_conv_12->arr_len == 32);
14055 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
14056 _res_constr.data[m] = _res_conv_12_ref;
14059 CVec_PaymentPreimageZ_free(_res_constr);
14062 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
14063 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14064 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
14065 return tag_ptr(ret_conv, true);
14067 int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint64_t arg) {
14068 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
14069 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
14073 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint64_t orig) {
14074 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
14075 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14076 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
14077 return tag_ptr(ret_conv, true);
14080 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
14081 LDKSignature a_ref;
14082 CHECK(a->arr_len == 64);
14083 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14084 LDKCVec_SignatureZ b_constr;
14085 b_constr.datalen = b->arr_len;
14086 if (b_constr.datalen > 0)
14087 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
14089 b_constr.data = NULL;
14090 int8_tArray* b_vals = (void*) b->elems;
14091 for (size_t m = 0; m < b_constr.datalen; m++) {
14092 int8_tArray b_conv_12 = b_vals[m];
14093 LDKSignature b_conv_12_ref;
14094 CHECK(b_conv_12->arr_len == 64);
14095 memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
14096 b_constr.data[m] = b_conv_12_ref;
14099 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14100 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
14101 return tag_ptr(ret_conv, true);
14104 void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint64_t _res) {
14105 if (!ptr_is_owned(_res)) return;
14106 void* _res_ptr = untag_ptr(_res);
14107 CHECK_ACCESS(_res_ptr);
14108 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
14109 FREE(untag_ptr(_res));
14110 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
14113 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint64_t o) {
14114 void* o_ptr = untag_ptr(o);
14115 CHECK_ACCESS(o_ptr);
14116 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
14117 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
14118 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14119 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
14120 return tag_ptr(ret_conv, true);
14123 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() {
14124 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14125 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
14126 return tag_ptr(ret_conv, true);
14129 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint64_t o) {
14130 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
14131 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
14135 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint64_t _res) {
14136 if (!ptr_is_owned(_res)) return;
14137 void* _res_ptr = untag_ptr(_res);
14138 CHECK_ACCESS(_res_ptr);
14139 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
14140 FREE(untag_ptr(_res));
14141 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
14144 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
14145 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14146 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
14147 return tag_ptr(ret_conv, true);
14149 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint64_t arg) {
14150 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
14151 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
14155 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint64_t orig) {
14156 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
14157 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14158 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
14159 return tag_ptr(ret_conv, true);
14162 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) {
14163 LDKSignature o_ref;
14164 CHECK(o->arr_len == 64);
14165 memcpy(o_ref.compact_form, o->elems, 64); FREE(o);
14166 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14167 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
14168 return tag_ptr(ret_conv, true);
14171 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() {
14172 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14173 *ret_conv = CResult_SignatureNoneZ_err();
14174 return tag_ptr(ret_conv, true);
14177 jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint64_t o) {
14178 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
14179 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
14183 void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint64_t _res) {
14184 if (!ptr_is_owned(_res)) return;
14185 void* _res_ptr = untag_ptr(_res);
14186 CHECK_ACCESS(_res_ptr);
14187 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
14188 FREE(untag_ptr(_res));
14189 CResult_SignatureNoneZ_free(_res_conv);
14192 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
14193 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14194 *ret_conv = CResult_SignatureNoneZ_clone(arg);
14195 return tag_ptr(ret_conv, true);
14197 int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint64_t arg) {
14198 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
14199 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
14203 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CResult_SignatureNoneZ_clone(uint64_t orig) {
14204 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
14205 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14206 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
14207 return tag_ptr(ret_conv, true);
14210 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
14211 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14212 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
14213 return tag_ptr(ret_conv, true);
14215 int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
14216 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
14217 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
14221 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
14222 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
14223 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14224 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
14225 return tag_ptr(ret_conv, true);
14228 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
14229 LDKSignature a_ref;
14230 CHECK(a->arr_len == 64);
14231 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14232 LDKSignature b_ref;
14233 CHECK(b->arr_len == 64);
14234 memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
14235 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14236 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
14237 return tag_ptr(ret_conv, true);
14240 void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
14241 if (!ptr_is_owned(_res)) return;
14242 void* _res_ptr = untag_ptr(_res);
14243 CHECK_ACCESS(_res_ptr);
14244 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
14245 FREE(untag_ptr(_res));
14246 C2Tuple_SignatureSignatureZ_free(_res_conv);
14249 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
14250 void* o_ptr = untag_ptr(o);
14251 CHECK_ACCESS(o_ptr);
14252 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
14253 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
14254 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14255 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
14256 return tag_ptr(ret_conv, true);
14259 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
14260 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14261 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
14262 return tag_ptr(ret_conv, true);
14265 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
14266 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
14267 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
14271 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
14272 if (!ptr_is_owned(_res)) return;
14273 void* _res_ptr = untag_ptr(_res);
14274 CHECK_ACCESS(_res_ptr);
14275 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
14276 FREE(untag_ptr(_res));
14277 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
14280 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
14281 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14282 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
14283 return tag_ptr(ret_conv, true);
14285 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
14286 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
14287 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
14291 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
14292 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
14293 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14294 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
14295 return tag_ptr(ret_conv, true);
14298 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
14299 LDKSecretKey o_ref;
14300 CHECK(o->arr_len == 32);
14301 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
14302 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14303 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
14304 return tag_ptr(ret_conv, true);
14307 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
14308 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14309 *ret_conv = CResult_SecretKeyNoneZ_err();
14310 return tag_ptr(ret_conv, true);
14313 jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
14314 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
14315 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
14319 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
14320 if (!ptr_is_owned(_res)) return;
14321 void* _res_ptr = untag_ptr(_res);
14322 CHECK_ACCESS(_res_ptr);
14323 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
14324 FREE(untag_ptr(_res));
14325 CResult_SecretKeyNoneZ_free(_res_conv);
14328 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
14329 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14330 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
14331 return tag_ptr(ret_conv, true);
14333 int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
14334 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
14335 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
14339 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
14340 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
14341 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14342 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
14343 return tag_ptr(ret_conv, true);
14346 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
14347 void* o_ptr = untag_ptr(o);
14348 CHECK_ACCESS(o_ptr);
14349 LDKSign o_conv = *(LDKSign*)(o_ptr);
14350 if (o_conv.free == LDKSign_JCalls_free) {
14351 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14352 LDKSign_JCalls_cloned(&o_conv);
14354 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14355 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
14356 return tag_ptr(ret_conv, true);
14359 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
14360 LDKDecodeError e_conv;
14361 e_conv.inner = untag_ptr(e);
14362 e_conv.is_owned = ptr_is_owned(e);
14363 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14364 e_conv = DecodeError_clone(&e_conv);
14365 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14366 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
14367 return tag_ptr(ret_conv, true);
14370 jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
14371 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
14372 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
14376 void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
14377 if (!ptr_is_owned(_res)) return;
14378 void* _res_ptr = untag_ptr(_res);
14379 CHECK_ACCESS(_res_ptr);
14380 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
14381 FREE(untag_ptr(_res));
14382 CResult_SignDecodeErrorZ_free(_res_conv);
14385 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
14386 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14387 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
14388 return tag_ptr(ret_conv, true);
14390 int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
14391 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
14392 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
14396 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
14397 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
14398 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14399 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
14400 return tag_ptr(ret_conv, true);
14403 void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
14404 LDKCVec_u5Z _res_constr;
14405 _res_constr.datalen = _res->arr_len;
14406 if (_res_constr.datalen > 0)
14407 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
14409 _res_constr.data = NULL;
14410 int8_t* _res_vals = (void*) _res->elems;
14411 for (size_t h = 0; h < _res_constr.datalen; h++) {
14412 int8_t _res_conv_7 = _res_vals[h];
14414 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
14417 CVec_u5Z_free(_res_constr);
14420 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
14421 LDKRecoverableSignature o_ref;
14422 CHECK(o->arr_len == 68);
14423 memcpy(o_ref.serialized_form, o->elems, 68); FREE(o);
14424 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14425 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
14426 return tag_ptr(ret_conv, true);
14429 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() {
14430 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14431 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
14432 return tag_ptr(ret_conv, true);
14435 jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint64_t o) {
14436 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
14437 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
14441 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint64_t _res) {
14442 if (!ptr_is_owned(_res)) return;
14443 void* _res_ptr = untag_ptr(_res);
14444 CHECK_ACCESS(_res_ptr);
14445 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
14446 FREE(untag_ptr(_res));
14447 CResult_RecoverableSignatureNoneZ_free(_res_conv);
14450 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
14451 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14452 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
14453 return tag_ptr(ret_conv, true);
14455 int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint64_t arg) {
14456 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
14457 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
14461 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint64_t orig) {
14462 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
14463 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14464 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
14465 return tag_ptr(ret_conv, true);
14468 void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
14469 LDKCVec_u8Z _res_ref;
14470 _res_ref.datalen = _res->arr_len;
14471 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
14472 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
14473 CVec_u8Z_free(_res_ref);
14476 void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
14477 LDKCVec_CVec_u8ZZ _res_constr;
14478 _res_constr.datalen = _res->arr_len;
14479 if (_res_constr.datalen > 0)
14480 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14482 _res_constr.data = NULL;
14483 int8_tArray* _res_vals = (void*) _res->elems;
14484 for (size_t m = 0; m < _res_constr.datalen; m++) {
14485 int8_tArray _res_conv_12 = _res_vals[m];
14486 LDKCVec_u8Z _res_conv_12_ref;
14487 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
14488 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14489 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
14490 _res_constr.data[m] = _res_conv_12_ref;
14493 CVec_CVec_u8ZZ_free(_res_constr);
14496 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
14497 LDKCVec_CVec_u8ZZ o_constr;
14498 o_constr.datalen = o->arr_len;
14499 if (o_constr.datalen > 0)
14500 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14502 o_constr.data = NULL;
14503 int8_tArray* o_vals = (void*) o->elems;
14504 for (size_t m = 0; m < o_constr.datalen; m++) {
14505 int8_tArray o_conv_12 = o_vals[m];
14506 LDKCVec_u8Z o_conv_12_ref;
14507 o_conv_12_ref.datalen = o_conv_12->arr_len;
14508 o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14509 memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
14510 o_constr.data[m] = o_conv_12_ref;
14513 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14514 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
14515 return tag_ptr(ret_conv, true);
14518 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
14519 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14520 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
14521 return tag_ptr(ret_conv, true);
14524 jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint64_t o) {
14525 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
14526 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
14530 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint64_t _res) {
14531 if (!ptr_is_owned(_res)) return;
14532 void* _res_ptr = untag_ptr(_res);
14533 CHECK_ACCESS(_res_ptr);
14534 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
14535 FREE(untag_ptr(_res));
14536 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
14539 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
14540 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14541 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
14542 return tag_ptr(ret_conv, true);
14544 int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint64_t arg) {
14545 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
14546 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
14550 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint64_t orig) {
14551 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
14552 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14553 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
14554 return tag_ptr(ret_conv, true);
14557 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint64_t o) {
14558 LDKInMemorySigner o_conv;
14559 o_conv.inner = untag_ptr(o);
14560 o_conv.is_owned = ptr_is_owned(o);
14561 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14562 o_conv = InMemorySigner_clone(&o_conv);
14563 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14564 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
14565 return tag_ptr(ret_conv, true);
14568 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
14569 LDKDecodeError e_conv;
14570 e_conv.inner = untag_ptr(e);
14571 e_conv.is_owned = ptr_is_owned(e);
14572 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14573 e_conv = DecodeError_clone(&e_conv);
14574 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14575 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
14576 return tag_ptr(ret_conv, true);
14579 jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint64_t o) {
14580 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
14581 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
14585 void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint64_t _res) {
14586 if (!ptr_is_owned(_res)) return;
14587 void* _res_ptr = untag_ptr(_res);
14588 CHECK_ACCESS(_res_ptr);
14589 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
14590 FREE(untag_ptr(_res));
14591 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
14594 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
14595 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14596 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
14597 return tag_ptr(ret_conv, true);
14599 int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint64_t arg) {
14600 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
14601 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
14605 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint64_t orig) {
14606 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
14607 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14608 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
14609 return tag_ptr(ret_conv, true);
14612 void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint64_tArray _res) {
14613 LDKCVec_TxOutZ _res_constr;
14614 _res_constr.datalen = _res->arr_len;
14615 if (_res_constr.datalen > 0)
14616 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
14618 _res_constr.data = NULL;
14619 uint64_t* _res_vals = _res->elems;
14620 for (size_t h = 0; h < _res_constr.datalen; h++) {
14621 uint64_t _res_conv_7 = _res_vals[h];
14622 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
14623 CHECK_ACCESS(_res_conv_7_ptr);
14624 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
14625 FREE(untag_ptr(_res_conv_7));
14626 _res_constr.data[h] = _res_conv_7_conv;
14629 CVec_TxOutZ_free(_res_constr);
14632 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
14633 LDKTransaction o_ref;
14634 o_ref.datalen = o->arr_len;
14635 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
14636 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
14637 o_ref.data_is_owned = true;
14638 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14639 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
14640 return tag_ptr(ret_conv, true);
14643 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() {
14644 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14645 *ret_conv = CResult_TransactionNoneZ_err();
14646 return tag_ptr(ret_conv, true);
14649 jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) {
14650 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
14651 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
14655 void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) {
14656 if (!ptr_is_owned(_res)) return;
14657 void* _res_ptr = untag_ptr(_res);
14658 CHECK_ACCESS(_res_ptr);
14659 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
14660 FREE(untag_ptr(_res));
14661 CResult_TransactionNoneZ_free(_res_conv);
14664 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
14665 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14666 *ret_conv = CResult_TransactionNoneZ_clone(arg);
14667 return tag_ptr(ret_conv, true);
14669 int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) {
14670 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
14671 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
14675 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) {
14676 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
14677 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14678 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
14679 return tag_ptr(ret_conv, true);
14682 uint64_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) {
14683 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14684 *ret_copy = COption_u16Z_some(o);
14685 uint64_t ret_ref = tag_ptr(ret_copy, true);
14689 uint64_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() {
14690 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14691 *ret_copy = COption_u16Z_none();
14692 uint64_t ret_ref = tag_ptr(ret_copy, true);
14696 void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint64_t _res) {
14697 if (!ptr_is_owned(_res)) return;
14698 void* _res_ptr = untag_ptr(_res);
14699 CHECK_ACCESS(_res_ptr);
14700 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
14701 FREE(untag_ptr(_res));
14702 COption_u16Z_free(_res_conv);
14705 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
14706 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14707 *ret_copy = COption_u16Z_clone(arg);
14708 uint64_t ret_ref = tag_ptr(ret_copy, true);
14711 int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint64_t arg) {
14712 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
14713 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
14717 uint64_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_clone(uint64_t orig) {
14718 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
14719 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14720 *ret_copy = COption_u16Z_clone(orig_conv);
14721 uint64_t ret_ref = tag_ptr(ret_copy, true);
14725 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
14726 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14727 *ret_conv = CResult_NoneAPIErrorZ_ok();
14728 return tag_ptr(ret_conv, true);
14731 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
14732 void* e_ptr = untag_ptr(e);
14733 CHECK_ACCESS(e_ptr);
14734 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14735 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14736 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14737 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
14738 return tag_ptr(ret_conv, true);
14741 jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
14742 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
14743 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
14747 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
14748 if (!ptr_is_owned(_res)) return;
14749 void* _res_ptr = untag_ptr(_res);
14750 CHECK_ACCESS(_res_ptr);
14751 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
14752 FREE(untag_ptr(_res));
14753 CResult_NoneAPIErrorZ_free(_res_conv);
14756 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
14757 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14758 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
14759 return tag_ptr(ret_conv, true);
14761 int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
14762 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
14763 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
14767 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
14768 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
14769 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14770 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
14771 return tag_ptr(ret_conv, true);
14774 void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
14775 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
14776 _res_constr.datalen = _res->arr_len;
14777 if (_res_constr.datalen > 0)
14778 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
14780 _res_constr.data = NULL;
14781 uint64_t* _res_vals = _res->elems;
14782 for (size_t w = 0; w < _res_constr.datalen; w++) {
14783 uint64_t _res_conv_22 = _res_vals[w];
14784 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
14785 CHECK_ACCESS(_res_conv_22_ptr);
14786 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
14787 FREE(untag_ptr(_res_conv_22));
14788 _res_constr.data[w] = _res_conv_22_conv;
14791 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
14794 void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
14795 LDKCVec_APIErrorZ _res_constr;
14796 _res_constr.datalen = _res->arr_len;
14797 if (_res_constr.datalen > 0)
14798 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
14800 _res_constr.data = NULL;
14801 uint64_t* _res_vals = _res->elems;
14802 for (size_t k = 0; k < _res_constr.datalen; k++) {
14803 uint64_t _res_conv_10 = _res_vals[k];
14804 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
14805 CHECK_ACCESS(_res_conv_10_ptr);
14806 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
14807 FREE(untag_ptr(_res_conv_10));
14808 _res_constr.data[k] = _res_conv_10_conv;
14811 CVec_APIErrorZ_free(_res_constr);
14814 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
14815 LDKThirtyTwoBytes o_ref;
14816 CHECK(o->arr_len == 32);
14817 memcpy(o_ref.data, o->elems, 32); FREE(o);
14818 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14819 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
14820 return tag_ptr(ret_conv, true);
14823 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
14824 void* e_ptr = untag_ptr(e);
14825 CHECK_ACCESS(e_ptr);
14826 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14827 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14828 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14829 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
14830 return tag_ptr(ret_conv, true);
14833 jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
14834 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
14835 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
14839 void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
14840 if (!ptr_is_owned(_res)) return;
14841 void* _res_ptr = untag_ptr(_res);
14842 CHECK_ACCESS(_res_ptr);
14843 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
14844 FREE(untag_ptr(_res));
14845 CResult__u832APIErrorZ_free(_res_conv);
14848 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
14849 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14850 *ret_conv = CResult__u832APIErrorZ_clone(arg);
14851 return tag_ptr(ret_conv, true);
14853 int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
14854 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
14855 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
14859 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
14860 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
14861 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14862 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
14863 return tag_ptr(ret_conv, true);
14866 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
14867 LDKThirtyTwoBytes o_ref;
14868 CHECK(o->arr_len == 32);
14869 memcpy(o_ref.data, o->elems, 32); FREE(o);
14870 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14871 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
14872 return tag_ptr(ret_conv, true);
14875 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
14876 void* e_ptr = untag_ptr(e);
14877 CHECK_ACCESS(e_ptr);
14878 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14879 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14880 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14881 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
14882 return tag_ptr(ret_conv, true);
14885 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
14886 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
14887 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
14891 void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
14892 if (!ptr_is_owned(_res)) return;
14893 void* _res_ptr = untag_ptr(_res);
14894 CHECK_ACCESS(_res_ptr);
14895 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
14896 FREE(untag_ptr(_res));
14897 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
14900 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
14901 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14902 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
14903 return tag_ptr(ret_conv, true);
14905 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
14906 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
14907 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
14911 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
14912 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
14913 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14914 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
14915 return tag_ptr(ret_conv, true);
14918 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
14919 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14920 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
14921 return tag_ptr(ret_conv, true);
14924 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
14925 void* e_ptr = untag_ptr(e);
14926 CHECK_ACCESS(e_ptr);
14927 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14928 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14929 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14930 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
14931 return tag_ptr(ret_conv, true);
14934 jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
14935 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
14936 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
14940 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
14941 if (!ptr_is_owned(_res)) return;
14942 void* _res_ptr = untag_ptr(_res);
14943 CHECK_ACCESS(_res_ptr);
14944 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
14945 FREE(untag_ptr(_res));
14946 CResult_NonePaymentSendFailureZ_free(_res_conv);
14949 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
14950 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14951 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
14952 return tag_ptr(ret_conv, true);
14954 int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
14955 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
14956 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
14960 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
14961 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
14962 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14963 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
14964 return tag_ptr(ret_conv, true);
14967 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
14968 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14969 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
14970 return tag_ptr(ret_conv, true);
14972 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint64_t arg) {
14973 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
14974 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
14978 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint64_t orig) {
14979 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
14980 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14981 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
14982 return tag_ptr(ret_conv, true);
14985 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
14986 LDKThirtyTwoBytes a_ref;
14987 CHECK(a->arr_len == 32);
14988 memcpy(a_ref.data, a->elems, 32); FREE(a);
14989 LDKThirtyTwoBytes b_ref;
14990 CHECK(b->arr_len == 32);
14991 memcpy(b_ref.data, b->elems, 32); FREE(b);
14992 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14993 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
14994 return tag_ptr(ret_conv, true);
14997 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint64_t _res) {
14998 if (!ptr_is_owned(_res)) return;
14999 void* _res_ptr = untag_ptr(_res);
15000 CHECK_ACCESS(_res_ptr);
15001 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
15002 FREE(untag_ptr(_res));
15003 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
15006 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint64_t o) {
15007 void* o_ptr = untag_ptr(o);
15008 CHECK_ACCESS(o_ptr);
15009 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
15010 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
15011 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15012 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
15013 return tag_ptr(ret_conv, true);
15016 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint64_t e) {
15017 void* e_ptr = untag_ptr(e);
15018 CHECK_ACCESS(e_ptr);
15019 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15020 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15021 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15022 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
15023 return tag_ptr(ret_conv, true);
15026 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint64_t o) {
15027 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
15028 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
15032 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint64_t _res) {
15033 if (!ptr_is_owned(_res)) return;
15034 void* _res_ptr = untag_ptr(_res);
15035 CHECK_ACCESS(_res_ptr);
15036 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
15037 FREE(untag_ptr(_res));
15038 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
15041 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
15042 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15043 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
15044 return tag_ptr(ret_conv, true);
15046 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint64_t arg) {
15047 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
15048 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
15052 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint64_t orig) {
15053 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
15054 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15055 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
15056 return tag_ptr(ret_conv, true);
15059 void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) {
15060 LDKCVec_ThirtyTwoBytesZ _res_constr;
15061 _res_constr.datalen = _res->arr_len;
15062 if (_res_constr.datalen > 0)
15063 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
15065 _res_constr.data = NULL;
15066 int8_tArray* _res_vals = (void*) _res->elems;
15067 for (size_t m = 0; m < _res_constr.datalen; m++) {
15068 int8_tArray _res_conv_12 = _res_vals[m];
15069 LDKThirtyTwoBytes _res_conv_12_ref;
15070 CHECK(_res_conv_12->arr_len == 32);
15071 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
15072 _res_constr.data[m] = _res_conv_12_ref;
15075 CVec_ThirtyTwoBytesZ_free(_res_constr);
15078 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
15079 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15080 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
15081 return tag_ptr(ret_conv, true);
15083 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint64_t arg) {
15084 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
15085 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
15089 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint64_t orig) {
15090 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
15091 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15092 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
15093 return tag_ptr(ret_conv, true);
15096 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
15097 LDKThirtyTwoBytes a_ref;
15098 CHECK(a->arr_len == 32);
15099 memcpy(a_ref.data, a->elems, 32); FREE(a);
15100 LDKThirtyTwoBytes b_ref;
15101 CHECK(b->arr_len == 32);
15102 memcpy(b_ref.data, b->elems, 32); FREE(b);
15103 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15104 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
15105 return tag_ptr(ret_conv, true);
15108 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint64_t _res) {
15109 if (!ptr_is_owned(_res)) return;
15110 void* _res_ptr = untag_ptr(_res);
15111 CHECK_ACCESS(_res_ptr);
15112 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
15113 FREE(untag_ptr(_res));
15114 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
15117 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint64_t o) {
15118 void* o_ptr = untag_ptr(o);
15119 CHECK_ACCESS(o_ptr);
15120 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
15121 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
15122 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15123 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
15124 return tag_ptr(ret_conv, true);
15127 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
15128 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15129 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
15130 return tag_ptr(ret_conv, true);
15133 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint64_t o) {
15134 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
15135 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
15139 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint64_t _res) {
15140 if (!ptr_is_owned(_res)) return;
15141 void* _res_ptr = untag_ptr(_res);
15142 CHECK_ACCESS(_res_ptr);
15143 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
15144 FREE(untag_ptr(_res));
15145 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
15148 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
15149 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15150 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
15151 return tag_ptr(ret_conv, true);
15153 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint64_t arg) {
15154 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
15155 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
15159 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint64_t orig) {
15160 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
15161 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15162 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
15163 return tag_ptr(ret_conv, true);
15166 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint64_t o) {
15167 void* o_ptr = untag_ptr(o);
15168 CHECK_ACCESS(o_ptr);
15169 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
15170 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
15171 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15172 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
15173 return tag_ptr(ret_conv, true);
15176 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint64_t e) {
15177 void* e_ptr = untag_ptr(e);
15178 CHECK_ACCESS(e_ptr);
15179 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15180 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15181 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15182 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
15183 return tag_ptr(ret_conv, true);
15186 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint64_t o) {
15187 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
15188 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
15192 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint64_t _res) {
15193 if (!ptr_is_owned(_res)) return;
15194 void* _res_ptr = untag_ptr(_res);
15195 CHECK_ACCESS(_res_ptr);
15196 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
15197 FREE(untag_ptr(_res));
15198 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
15201 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
15202 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15203 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
15204 return tag_ptr(ret_conv, true);
15206 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint64_t arg) {
15207 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
15208 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
15212 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint64_t orig) {
15213 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
15214 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15215 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
15216 return tag_ptr(ret_conv, true);
15219 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
15220 LDKThirtyTwoBytes o_ref;
15221 CHECK(o->arr_len == 32);
15222 memcpy(o_ref.data, o->elems, 32); FREE(o);
15223 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15224 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
15225 return tag_ptr(ret_conv, true);
15228 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() {
15229 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15230 *ret_conv = CResult_PaymentSecretNoneZ_err();
15231 return tag_ptr(ret_conv, true);
15234 jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint64_t o) {
15235 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
15236 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
15240 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint64_t _res) {
15241 if (!ptr_is_owned(_res)) return;
15242 void* _res_ptr = untag_ptr(_res);
15243 CHECK_ACCESS(_res_ptr);
15244 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
15245 FREE(untag_ptr(_res));
15246 CResult_PaymentSecretNoneZ_free(_res_conv);
15249 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
15250 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15251 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
15252 return tag_ptr(ret_conv, true);
15254 int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint64_t arg) {
15255 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
15256 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
15260 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS_CResult_PaymentSecretNoneZ_clone(uint64_t orig) {
15261 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
15262 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15263 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
15264 return tag_ptr(ret_conv, true);
15267 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
15268 LDKThirtyTwoBytes o_ref;
15269 CHECK(o->arr_len == 32);
15270 memcpy(o_ref.data, o->elems, 32); FREE(o);
15271 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15272 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
15273 return tag_ptr(ret_conv, true);
15276 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint64_t e) {
15277 void* e_ptr = untag_ptr(e);
15278 CHECK_ACCESS(e_ptr);
15279 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15280 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15281 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15282 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
15283 return tag_ptr(ret_conv, true);
15286 jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint64_t o) {
15287 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
15288 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
15292 void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint64_t _res) {
15293 if (!ptr_is_owned(_res)) return;
15294 void* _res_ptr = untag_ptr(_res);
15295 CHECK_ACCESS(_res_ptr);
15296 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
15297 FREE(untag_ptr(_res));
15298 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
15301 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
15302 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15303 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
15304 return tag_ptr(ret_conv, true);
15306 int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint64_t arg) {
15307 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
15308 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
15312 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint64_t orig) {
15313 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
15314 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15315 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
15316 return tag_ptr(ret_conv, true);
15319 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
15320 LDKThirtyTwoBytes o_ref;
15321 CHECK(o->arr_len == 32);
15322 memcpy(o_ref.data, o->elems, 32); FREE(o);
15323 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15324 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
15325 return tag_ptr(ret_conv, true);
15328 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint64_t e) {
15329 void* e_ptr = untag_ptr(e);
15330 CHECK_ACCESS(e_ptr);
15331 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15332 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15333 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15334 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
15335 return tag_ptr(ret_conv, true);
15338 jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint64_t o) {
15339 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
15340 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
15344 void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint64_t _res) {
15345 if (!ptr_is_owned(_res)) return;
15346 void* _res_ptr = untag_ptr(_res);
15347 CHECK_ACCESS(_res_ptr);
15348 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
15349 FREE(untag_ptr(_res));
15350 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
15353 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
15354 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15355 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
15356 return tag_ptr(ret_conv, true);
15358 int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint64_t arg) {
15359 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
15360 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
15364 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint64_t orig) {
15365 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
15366 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15367 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
15368 return tag_ptr(ret_conv, true);
15371 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) {
15372 LDKCounterpartyForwardingInfo o_conv;
15373 o_conv.inner = untag_ptr(o);
15374 o_conv.is_owned = ptr_is_owned(o);
15375 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15376 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
15377 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15378 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
15379 return tag_ptr(ret_conv, true);
15382 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
15383 LDKDecodeError e_conv;
15384 e_conv.inner = untag_ptr(e);
15385 e_conv.is_owned = ptr_is_owned(e);
15386 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15387 e_conv = DecodeError_clone(&e_conv);
15388 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15389 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
15390 return tag_ptr(ret_conv, true);
15393 jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) {
15394 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
15395 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
15399 void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) {
15400 if (!ptr_is_owned(_res)) return;
15401 void* _res_ptr = untag_ptr(_res);
15402 CHECK_ACCESS(_res_ptr);
15403 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
15404 FREE(untag_ptr(_res));
15405 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
15408 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
15409 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15410 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
15411 return tag_ptr(ret_conv, true);
15413 int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
15414 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
15415 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
15419 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) {
15420 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
15421 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15422 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
15423 return tag_ptr(ret_conv, true);
15426 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) {
15427 LDKChannelCounterparty o_conv;
15428 o_conv.inner = untag_ptr(o);
15429 o_conv.is_owned = ptr_is_owned(o);
15430 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15431 o_conv = ChannelCounterparty_clone(&o_conv);
15432 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15433 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
15434 return tag_ptr(ret_conv, true);
15437 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
15438 LDKDecodeError e_conv;
15439 e_conv.inner = untag_ptr(e);
15440 e_conv.is_owned = ptr_is_owned(e);
15441 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15442 e_conv = DecodeError_clone(&e_conv);
15443 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15444 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
15445 return tag_ptr(ret_conv, true);
15448 jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) {
15449 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
15450 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
15454 void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) {
15455 if (!ptr_is_owned(_res)) return;
15456 void* _res_ptr = untag_ptr(_res);
15457 CHECK_ACCESS(_res_ptr);
15458 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
15459 FREE(untag_ptr(_res));
15460 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
15463 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
15464 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15465 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
15466 return tag_ptr(ret_conv, true);
15468 int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) {
15469 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
15470 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
15474 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) {
15475 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
15476 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15477 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
15478 return tag_ptr(ret_conv, true);
15481 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) {
15482 LDKChannelDetails o_conv;
15483 o_conv.inner = untag_ptr(o);
15484 o_conv.is_owned = ptr_is_owned(o);
15485 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15486 o_conv = ChannelDetails_clone(&o_conv);
15487 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15488 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
15489 return tag_ptr(ret_conv, true);
15492 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
15493 LDKDecodeError e_conv;
15494 e_conv.inner = untag_ptr(e);
15495 e_conv.is_owned = ptr_is_owned(e);
15496 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15497 e_conv = DecodeError_clone(&e_conv);
15498 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15499 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
15500 return tag_ptr(ret_conv, true);
15503 jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) {
15504 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
15505 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
15509 void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
15514 FREE(untag_ptr(_res));
15515 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
15518 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
15519 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15520 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
15521 return tag_ptr(ret_conv, true);
15523 int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) {
15524 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
15525 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
15529 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) {
15530 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
15531 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15532 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
15533 return tag_ptr(ret_conv, true);
15536 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) {
15537 LDKPhantomRouteHints 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 = PhantomRouteHints_clone(&o_conv);
15542 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15543 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
15544 return tag_ptr(ret_conv, true);
15547 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15554 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
15555 return tag_ptr(ret_conv, true);
15558 jboolean __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(uint64_t o) {
15559 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
15560 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
15564 void __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_free"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_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_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
15569 FREE(untag_ptr(_res));
15570 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
15573 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
15574 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15575 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
15576 return tag_ptr(ret_conv, true);
15578 int64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(uint64_t arg) {
15579 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
15580 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
15584 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone(uint64_t orig) {
15585 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
15586 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15587 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
15588 return tag_ptr(ret_conv, true);
15591 void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) {
15592 LDKCVec_ChannelMonitorZ _res_constr;
15593 _res_constr.datalen = _res->arr_len;
15594 if (_res_constr.datalen > 0)
15595 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
15597 _res_constr.data = NULL;
15598 uint64_t* _res_vals = _res->elems;
15599 for (size_t q = 0; q < _res_constr.datalen; q++) {
15600 uint64_t _res_conv_16 = _res_vals[q];
15601 LDKChannelMonitor _res_conv_16_conv;
15602 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
15603 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
15604 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
15605 _res_constr.data[q] = _res_conv_16_conv;
15608 CVec_ChannelMonitorZ_free(_res_constr);
15611 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint64_t b) {
15612 LDKThirtyTwoBytes a_ref;
15613 CHECK(a->arr_len == 32);
15614 memcpy(a_ref.data, a->elems, 32); FREE(a);
15615 LDKChannelManager b_conv;
15616 b_conv.inner = untag_ptr(b);
15617 b_conv.is_owned = ptr_is_owned(b);
15618 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
15619 // WARNING: we need a move here but no clone is available for LDKChannelManager
15621 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
15622 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
15623 return tag_ptr(ret_conv, true);
15626 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint64_t _res) {
15627 if (!ptr_is_owned(_res)) return;
15628 void* _res_ptr = untag_ptr(_res);
15629 CHECK_ACCESS(_res_ptr);
15630 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
15631 FREE(untag_ptr(_res));
15632 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
15635 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint64_t o) {
15636 void* o_ptr = untag_ptr(o);
15637 CHECK_ACCESS(o_ptr);
15638 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
15639 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
15640 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15641 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
15642 return tag_ptr(ret_conv, true);
15645 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
15646 LDKDecodeError e_conv;
15647 e_conv.inner = untag_ptr(e);
15648 e_conv.is_owned = ptr_is_owned(e);
15649 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15650 e_conv = DecodeError_clone(&e_conv);
15651 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15652 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
15653 return tag_ptr(ret_conv, true);
15656 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint64_t o) {
15657 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
15658 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
15662 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint64_t _res) {
15663 if (!ptr_is_owned(_res)) return;
15664 void* _res_ptr = untag_ptr(_res);
15665 CHECK_ACCESS(_res_ptr);
15666 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
15667 FREE(untag_ptr(_res));
15668 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
15671 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint64_t o) {
15672 LDKChannelConfig o_conv;
15673 o_conv.inner = untag_ptr(o);
15674 o_conv.is_owned = ptr_is_owned(o);
15675 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15676 o_conv = ChannelConfig_clone(&o_conv);
15677 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15678 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
15679 return tag_ptr(ret_conv, true);
15682 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
15683 LDKDecodeError e_conv;
15684 e_conv.inner = untag_ptr(e);
15685 e_conv.is_owned = ptr_is_owned(e);
15686 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15687 e_conv = DecodeError_clone(&e_conv);
15688 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15689 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
15690 return tag_ptr(ret_conv, true);
15693 jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint64_t o) {
15694 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
15695 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
15699 void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint64_t _res) {
15700 if (!ptr_is_owned(_res)) return;
15701 void* _res_ptr = untag_ptr(_res);
15702 CHECK_ACCESS(_res_ptr);
15703 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
15704 FREE(untag_ptr(_res));
15705 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
15708 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
15709 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15710 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
15711 return tag_ptr(ret_conv, true);
15713 int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint64_t arg) {
15714 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
15715 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
15719 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint64_t orig) {
15720 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
15721 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15722 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
15723 return tag_ptr(ret_conv, true);
15726 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
15727 LDKOutPoint o_conv;
15728 o_conv.inner = untag_ptr(o);
15729 o_conv.is_owned = ptr_is_owned(o);
15730 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15731 o_conv = OutPoint_clone(&o_conv);
15732 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15733 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
15734 return tag_ptr(ret_conv, true);
15737 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
15738 LDKDecodeError e_conv;
15739 e_conv.inner = untag_ptr(e);
15740 e_conv.is_owned = ptr_is_owned(e);
15741 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15742 e_conv = DecodeError_clone(&e_conv);
15743 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15744 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
15745 return tag_ptr(ret_conv, true);
15748 jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) {
15749 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
15750 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
15754 void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) {
15755 if (!ptr_is_owned(_res)) return;
15756 void* _res_ptr = untag_ptr(_res);
15757 CHECK_ACCESS(_res_ptr);
15758 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
15759 FREE(untag_ptr(_res));
15760 CResult_OutPointDecodeErrorZ_free(_res_conv);
15763 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
15764 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15765 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
15766 return tag_ptr(ret_conv, true);
15768 int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) {
15769 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
15770 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
15774 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) {
15775 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
15776 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15777 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
15778 return tag_ptr(ret_conv, true);
15781 uint64_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint64_t o) {
15782 void* o_ptr = untag_ptr(o);
15783 CHECK_ACCESS(o_ptr);
15784 LDKType o_conv = *(LDKType*)(o_ptr);
15785 if (o_conv.free == LDKType_JCalls_free) {
15786 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15787 LDKType_JCalls_cloned(&o_conv);
15789 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15790 *ret_copy = COption_TypeZ_some(o_conv);
15791 uint64_t ret_ref = tag_ptr(ret_copy, true);
15795 uint64_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() {
15796 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15797 *ret_copy = COption_TypeZ_none();
15798 uint64_t ret_ref = tag_ptr(ret_copy, true);
15802 void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint64_t _res) {
15803 if (!ptr_is_owned(_res)) return;
15804 void* _res_ptr = untag_ptr(_res);
15805 CHECK_ACCESS(_res_ptr);
15806 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
15807 FREE(untag_ptr(_res));
15808 COption_TypeZ_free(_res_conv);
15811 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
15812 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15813 *ret_copy = COption_TypeZ_clone(arg);
15814 uint64_t ret_ref = tag_ptr(ret_copy, true);
15817 int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint64_t arg) {
15818 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
15819 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
15823 uint64_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_TypeZ_clone(uint64_t orig) {
15824 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
15825 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15826 *ret_copy = COption_TypeZ_clone(orig_conv);
15827 uint64_t ret_ref = tag_ptr(ret_copy, true);
15831 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint64_t o) {
15832 void* o_ptr = untag_ptr(o);
15833 CHECK_ACCESS(o_ptr);
15834 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
15835 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
15836 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15837 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
15838 return tag_ptr(ret_conv, true);
15841 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
15842 LDKDecodeError e_conv;
15843 e_conv.inner = untag_ptr(e);
15844 e_conv.is_owned = ptr_is_owned(e);
15845 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15846 e_conv = DecodeError_clone(&e_conv);
15847 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15848 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
15849 return tag_ptr(ret_conv, true);
15852 jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint64_t o) {
15853 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
15854 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
15858 void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint64_t _res) {
15859 if (!ptr_is_owned(_res)) return;
15860 void* _res_ptr = untag_ptr(_res);
15861 CHECK_ACCESS(_res_ptr);
15862 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
15863 FREE(untag_ptr(_res));
15864 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
15867 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
15868 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15869 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
15870 return tag_ptr(ret_conv, true);
15872 int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint64_t arg) {
15873 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
15874 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
15878 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint64_t orig) {
15879 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
15880 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15881 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
15882 return tag_ptr(ret_conv, true);
15885 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_ok"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
15886 LDKThirtyTwoBytes o_ref;
15887 CHECK(o->arr_len == 32);
15888 memcpy(o_ref.data, o->elems, 32); FREE(o);
15889 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15890 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
15891 return tag_ptr(ret_conv, true);
15894 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_err"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint64_t e) {
15895 void* e_ptr = untag_ptr(e);
15896 CHECK_ACCESS(e_ptr);
15897 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
15898 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
15899 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15900 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
15901 return tag_ptr(ret_conv, true);
15904 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_is_ok"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint64_t o) {
15905 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
15906 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
15910 void __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_free"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint64_t _res) {
15911 if (!ptr_is_owned(_res)) return;
15912 void* _res_ptr = untag_ptr(_res);
15913 CHECK_ACCESS(_res_ptr);
15914 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
15915 FREE(untag_ptr(_res));
15916 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
15919 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
15920 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15921 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
15922 return tag_ptr(ret_conv, true);
15924 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone_ptr"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint64_t arg) {
15925 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
15926 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
15930 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint64_t orig) {
15931 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
15932 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15933 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
15934 return tag_ptr(ret_conv, true);
15937 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
15938 LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
15939 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15940 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
15941 return tag_ptr(ret_conv, true);
15944 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
15945 void* e_ptr = untag_ptr(e);
15946 CHECK_ACCESS(e_ptr);
15947 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
15948 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
15949 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15950 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
15951 return tag_ptr(ret_conv, true);
15954 jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
15955 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
15956 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
15960 void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
15961 if (!ptr_is_owned(_res)) return;
15962 void* _res_ptr = untag_ptr(_res);
15963 CHECK_ACCESS(_res_ptr);
15964 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
15965 FREE(untag_ptr(_res));
15966 CResult_SiPrefixParseErrorZ_free(_res_conv);
15969 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
15970 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15971 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
15972 return tag_ptr(ret_conv, true);
15974 int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
15975 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
15976 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
15980 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
15981 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
15982 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15983 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
15984 return tag_ptr(ret_conv, true);
15987 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
15989 o_conv.inner = untag_ptr(o);
15990 o_conv.is_owned = ptr_is_owned(o);
15991 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15992 o_conv = Invoice_clone(&o_conv);
15993 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15994 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
15995 return tag_ptr(ret_conv, true);
15998 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
15999 void* e_ptr = untag_ptr(e);
16000 CHECK_ACCESS(e_ptr);
16001 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
16002 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
16003 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16004 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
16005 return tag_ptr(ret_conv, true);
16008 jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
16009 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
16010 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
16014 void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
16015 if (!ptr_is_owned(_res)) return;
16016 void* _res_ptr = untag_ptr(_res);
16017 CHECK_ACCESS(_res_ptr);
16018 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
16019 FREE(untag_ptr(_res));
16020 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
16023 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
16024 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16025 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
16026 return tag_ptr(ret_conv, true);
16028 int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
16029 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
16030 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
16034 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
16035 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
16036 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16037 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
16038 return tag_ptr(ret_conv, true);
16041 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
16042 LDKSignedRawInvoice o_conv;
16043 o_conv.inner = untag_ptr(o);
16044 o_conv.is_owned = ptr_is_owned(o);
16045 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16046 o_conv = SignedRawInvoice_clone(&o_conv);
16047 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16048 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
16049 return tag_ptr(ret_conv, true);
16052 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
16053 void* e_ptr = untag_ptr(e);
16054 CHECK_ACCESS(e_ptr);
16055 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
16056 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
16057 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16058 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
16059 return tag_ptr(ret_conv, true);
16062 jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
16063 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
16064 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
16068 void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
16069 if (!ptr_is_owned(_res)) return;
16070 void* _res_ptr = untag_ptr(_res);
16071 CHECK_ACCESS(_res_ptr);
16072 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
16073 FREE(untag_ptr(_res));
16074 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
16077 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
16078 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16079 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
16080 return tag_ptr(ret_conv, true);
16082 int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
16083 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
16084 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
16088 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
16089 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
16090 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16091 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
16092 return tag_ptr(ret_conv, true);
16095 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
16096 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16097 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
16098 return tag_ptr(ret_conv, true);
16100 int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
16101 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
16102 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
16106 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
16107 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
16108 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16109 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
16110 return tag_ptr(ret_conv, true);
16113 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
16114 LDKRawInvoice a_conv;
16115 a_conv.inner = untag_ptr(a);
16116 a_conv.is_owned = ptr_is_owned(a);
16117 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16118 a_conv = RawInvoice_clone(&a_conv);
16119 LDKThirtyTwoBytes b_ref;
16120 CHECK(b->arr_len == 32);
16121 memcpy(b_ref.data, b->elems, 32); FREE(b);
16122 LDKInvoiceSignature c_conv;
16123 c_conv.inner = untag_ptr(c);
16124 c_conv.is_owned = ptr_is_owned(c);
16125 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
16126 c_conv = InvoiceSignature_clone(&c_conv);
16127 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16128 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
16129 return tag_ptr(ret_conv, true);
16132 void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
16133 if (!ptr_is_owned(_res)) return;
16134 void* _res_ptr = untag_ptr(_res);
16135 CHECK_ACCESS(_res_ptr);
16136 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
16137 FREE(untag_ptr(_res));
16138 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
16141 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
16142 LDKPayeePubKey o_conv;
16143 o_conv.inner = untag_ptr(o);
16144 o_conv.is_owned = ptr_is_owned(o);
16145 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16146 o_conv = PayeePubKey_clone(&o_conv);
16147 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16148 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
16149 return tag_ptr(ret_conv, true);
16152 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
16153 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
16154 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16155 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
16156 return tag_ptr(ret_conv, true);
16159 jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
16160 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
16161 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
16165 void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
16166 if (!ptr_is_owned(_res)) return;
16167 void* _res_ptr = untag_ptr(_res);
16168 CHECK_ACCESS(_res_ptr);
16169 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
16170 FREE(untag_ptr(_res));
16171 CResult_PayeePubKeyErrorZ_free(_res_conv);
16174 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
16175 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16176 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
16177 return tag_ptr(ret_conv, true);
16179 int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
16180 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
16181 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
16185 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
16186 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
16187 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16188 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
16189 return tag_ptr(ret_conv, true);
16192 void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
16193 LDKCVec_PrivateRouteZ _res_constr;
16194 _res_constr.datalen = _res->arr_len;
16195 if (_res_constr.datalen > 0)
16196 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
16198 _res_constr.data = NULL;
16199 uint64_t* _res_vals = _res->elems;
16200 for (size_t o = 0; o < _res_constr.datalen; o++) {
16201 uint64_t _res_conv_14 = _res_vals[o];
16202 LDKPrivateRoute _res_conv_14_conv;
16203 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
16204 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
16205 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
16206 _res_constr.data[o] = _res_conv_14_conv;
16209 CVec_PrivateRouteZ_free(_res_constr);
16212 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
16213 LDKPositiveTimestamp o_conv;
16214 o_conv.inner = untag_ptr(o);
16215 o_conv.is_owned = ptr_is_owned(o);
16216 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16217 o_conv = PositiveTimestamp_clone(&o_conv);
16218 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16219 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
16220 return tag_ptr(ret_conv, true);
16223 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
16224 LDKCreationError e_conv = LDKCreationError_from_js(e);
16225 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16226 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
16227 return tag_ptr(ret_conv, true);
16230 jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
16231 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
16232 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
16236 void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
16237 if (!ptr_is_owned(_res)) return;
16238 void* _res_ptr = untag_ptr(_res);
16239 CHECK_ACCESS(_res_ptr);
16240 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
16241 FREE(untag_ptr(_res));
16242 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
16245 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
16246 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16247 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
16248 return tag_ptr(ret_conv, true);
16250 int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
16251 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
16252 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
16256 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
16257 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
16258 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16259 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
16260 return tag_ptr(ret_conv, true);
16263 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
16264 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16265 *ret_conv = CResult_NoneSemanticErrorZ_ok();
16266 return tag_ptr(ret_conv, true);
16269 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
16270 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16271 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16272 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
16273 return tag_ptr(ret_conv, true);
16276 jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
16277 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
16278 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
16282 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
16283 if (!ptr_is_owned(_res)) return;
16284 void* _res_ptr = untag_ptr(_res);
16285 CHECK_ACCESS(_res_ptr);
16286 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
16287 FREE(untag_ptr(_res));
16288 CResult_NoneSemanticErrorZ_free(_res_conv);
16291 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
16292 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16293 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
16294 return tag_ptr(ret_conv, true);
16296 int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
16297 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
16298 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
16302 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
16303 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
16304 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16305 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
16306 return tag_ptr(ret_conv, true);
16309 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
16311 o_conv.inner = untag_ptr(o);
16312 o_conv.is_owned = ptr_is_owned(o);
16313 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16314 o_conv = Invoice_clone(&o_conv);
16315 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16316 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
16317 return tag_ptr(ret_conv, true);
16320 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
16321 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16322 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16323 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
16324 return tag_ptr(ret_conv, true);
16327 jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
16328 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
16329 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
16333 void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
16334 if (!ptr_is_owned(_res)) return;
16335 void* _res_ptr = untag_ptr(_res);
16336 CHECK_ACCESS(_res_ptr);
16337 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
16338 FREE(untag_ptr(_res));
16339 CResult_InvoiceSemanticErrorZ_free(_res_conv);
16342 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
16343 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16344 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
16345 return tag_ptr(ret_conv, true);
16347 int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
16348 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
16349 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
16353 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
16354 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
16355 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16356 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
16357 return tag_ptr(ret_conv, true);
16360 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
16361 LDKDescription o_conv;
16362 o_conv.inner = untag_ptr(o);
16363 o_conv.is_owned = ptr_is_owned(o);
16364 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16365 o_conv = Description_clone(&o_conv);
16366 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16367 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
16368 return tag_ptr(ret_conv, true);
16371 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
16372 LDKCreationError e_conv = LDKCreationError_from_js(e);
16373 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16374 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
16375 return tag_ptr(ret_conv, true);
16378 jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
16379 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
16380 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
16384 void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
16385 if (!ptr_is_owned(_res)) return;
16386 void* _res_ptr = untag_ptr(_res);
16387 CHECK_ACCESS(_res_ptr);
16388 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
16389 FREE(untag_ptr(_res));
16390 CResult_DescriptionCreationErrorZ_free(_res_conv);
16393 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
16394 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16395 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
16396 return tag_ptr(ret_conv, true);
16398 int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
16399 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
16400 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
16404 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
16405 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
16406 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16407 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
16408 return tag_ptr(ret_conv, true);
16411 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
16412 LDKPrivateRoute o_conv;
16413 o_conv.inner = untag_ptr(o);
16414 o_conv.is_owned = ptr_is_owned(o);
16415 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16416 o_conv = PrivateRoute_clone(&o_conv);
16417 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16418 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
16419 return tag_ptr(ret_conv, true);
16422 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
16423 LDKCreationError e_conv = LDKCreationError_from_js(e);
16424 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16425 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
16426 return tag_ptr(ret_conv, true);
16429 jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
16430 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
16431 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
16435 void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
16436 if (!ptr_is_owned(_res)) return;
16437 void* _res_ptr = untag_ptr(_res);
16438 CHECK_ACCESS(_res_ptr);
16439 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
16440 FREE(untag_ptr(_res));
16441 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
16444 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
16445 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16446 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
16447 return tag_ptr(ret_conv, true);
16449 int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
16450 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
16451 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
16455 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
16456 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
16457 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16458 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
16459 return tag_ptr(ret_conv, true);
16462 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
16463 LDKStr o_conv = str_ref_to_owned_c(o);
16464 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16465 *ret_conv = CResult_StringErrorZ_ok(o_conv);
16466 return tag_ptr(ret_conv, true);
16469 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
16470 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
16471 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16472 *ret_conv = CResult_StringErrorZ_err(e_conv);
16473 return tag_ptr(ret_conv, true);
16476 jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
16477 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
16478 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
16482 void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
16483 if (!ptr_is_owned(_res)) return;
16484 void* _res_ptr = untag_ptr(_res);
16485 CHECK_ACCESS(_res_ptr);
16486 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
16487 FREE(untag_ptr(_res));
16488 CResult_StringErrorZ_free(_res_conv);
16491 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
16492 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16493 *ret_conv = CResult_StringErrorZ_clone(arg);
16494 return tag_ptr(ret_conv, true);
16496 int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
16497 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
16498 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
16502 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
16503 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
16504 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16505 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
16506 return tag_ptr(ret_conv, true);
16509 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
16510 LDKChannelMonitorUpdate o_conv;
16511 o_conv.inner = untag_ptr(o);
16512 o_conv.is_owned = ptr_is_owned(o);
16513 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16514 o_conv = ChannelMonitorUpdate_clone(&o_conv);
16515 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16516 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
16517 return tag_ptr(ret_conv, true);
16520 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
16521 LDKDecodeError e_conv;
16522 e_conv.inner = untag_ptr(e);
16523 e_conv.is_owned = ptr_is_owned(e);
16524 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16525 e_conv = DecodeError_clone(&e_conv);
16526 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16527 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
16528 return tag_ptr(ret_conv, true);
16531 jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
16532 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
16533 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
16537 void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
16538 if (!ptr_is_owned(_res)) return;
16539 void* _res_ptr = untag_ptr(_res);
16540 CHECK_ACCESS(_res_ptr);
16541 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
16542 FREE(untag_ptr(_res));
16543 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
16546 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
16547 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16548 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
16549 return tag_ptr(ret_conv, true);
16551 int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16552 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
16553 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
16557 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
16558 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
16559 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16560 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
16561 return tag_ptr(ret_conv, true);
16564 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
16565 void* o_ptr = untag_ptr(o);
16566 CHECK_ACCESS(o_ptr);
16567 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
16568 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
16569 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16570 *ret_copy = COption_MonitorEventZ_some(o_conv);
16571 uint64_t ret_ref = tag_ptr(ret_copy, true);
16575 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
16576 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16577 *ret_copy = COption_MonitorEventZ_none();
16578 uint64_t ret_ref = tag_ptr(ret_copy, true);
16582 void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
16583 if (!ptr_is_owned(_res)) return;
16584 void* _res_ptr = untag_ptr(_res);
16585 CHECK_ACCESS(_res_ptr);
16586 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
16587 FREE(untag_ptr(_res));
16588 COption_MonitorEventZ_free(_res_conv);
16591 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
16592 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16593 *ret_copy = COption_MonitorEventZ_clone(arg);
16594 uint64_t ret_ref = tag_ptr(ret_copy, true);
16597 int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
16598 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
16599 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
16603 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
16604 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
16605 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16606 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
16607 uint64_t ret_ref = tag_ptr(ret_copy, true);
16611 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
16612 void* o_ptr = untag_ptr(o);
16613 CHECK_ACCESS(o_ptr);
16614 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
16615 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
16616 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16617 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
16618 return tag_ptr(ret_conv, true);
16621 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
16622 LDKDecodeError e_conv;
16623 e_conv.inner = untag_ptr(e);
16624 e_conv.is_owned = ptr_is_owned(e);
16625 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16626 e_conv = DecodeError_clone(&e_conv);
16627 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16628 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
16629 return tag_ptr(ret_conv, true);
16632 jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
16633 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
16634 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
16638 void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
16639 if (!ptr_is_owned(_res)) return;
16640 void* _res_ptr = untag_ptr(_res);
16641 CHECK_ACCESS(_res_ptr);
16642 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
16643 FREE(untag_ptr(_res));
16644 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
16647 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
16648 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16649 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
16650 return tag_ptr(ret_conv, true);
16652 int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
16653 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
16654 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
16658 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
16659 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
16660 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16661 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
16662 return tag_ptr(ret_conv, true);
16665 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
16666 LDKHTLCUpdate o_conv;
16667 o_conv.inner = untag_ptr(o);
16668 o_conv.is_owned = ptr_is_owned(o);
16669 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16670 o_conv = HTLCUpdate_clone(&o_conv);
16671 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16672 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
16673 return tag_ptr(ret_conv, true);
16676 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
16677 LDKDecodeError e_conv;
16678 e_conv.inner = untag_ptr(e);
16679 e_conv.is_owned = ptr_is_owned(e);
16680 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16681 e_conv = DecodeError_clone(&e_conv);
16682 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16683 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
16684 return tag_ptr(ret_conv, true);
16687 jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint64_t o) {
16688 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
16689 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
16693 void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint64_t _res) {
16694 if (!ptr_is_owned(_res)) return;
16695 void* _res_ptr = untag_ptr(_res);
16696 CHECK_ACCESS(_res_ptr);
16697 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
16698 FREE(untag_ptr(_res));
16699 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
16702 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
16703 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16704 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
16705 return tag_ptr(ret_conv, true);
16707 int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16708 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
16709 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
16713 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint64_t orig) {
16714 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
16715 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16716 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
16717 return tag_ptr(ret_conv, true);
16720 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
16721 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16722 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
16723 return tag_ptr(ret_conv, true);
16725 int64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone_ptr"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint64_t arg) {
16726 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
16727 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
16731 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone"))) TS_C2Tuple_OutPointScriptZ_clone(uint64_t orig) {
16732 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
16733 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16734 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
16735 return tag_ptr(ret_conv, true);
16738 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint64_t a, int8_tArray b) {
16739 LDKOutPoint a_conv;
16740 a_conv.inner = untag_ptr(a);
16741 a_conv.is_owned = ptr_is_owned(a);
16742 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16743 a_conv = OutPoint_clone(&a_conv);
16745 b_ref.datalen = b->arr_len;
16746 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16747 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16748 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16749 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
16750 return tag_ptr(ret_conv, true);
16753 void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint64_t _res) {
16754 if (!ptr_is_owned(_res)) return;
16755 void* _res_ptr = untag_ptr(_res);
16756 CHECK_ACCESS(_res_ptr);
16757 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
16758 FREE(untag_ptr(_res));
16759 C2Tuple_OutPointScriptZ_free(_res_conv);
16762 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
16763 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16764 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
16765 return tag_ptr(ret_conv, true);
16767 int64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone_ptr"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint64_t arg) {
16768 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
16769 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
16773 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone"))) TS_C2Tuple_u32ScriptZ_clone(uint64_t orig) {
16774 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
16775 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16776 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
16777 return tag_ptr(ret_conv, true);
16780 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
16782 b_ref.datalen = b->arr_len;
16783 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16784 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16785 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16786 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
16787 return tag_ptr(ret_conv, true);
16790 void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint64_t _res) {
16791 if (!ptr_is_owned(_res)) return;
16792 void* _res_ptr = untag_ptr(_res);
16793 CHECK_ACCESS(_res_ptr);
16794 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
16795 FREE(untag_ptr(_res));
16796 C2Tuple_u32ScriptZ_free(_res_conv);
16799 void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint64_tArray _res) {
16800 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
16801 _res_constr.datalen = _res->arr_len;
16802 if (_res_constr.datalen > 0)
16803 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16805 _res_constr.data = NULL;
16806 uint64_t* _res_vals = _res->elems;
16807 for (size_t v = 0; v < _res_constr.datalen; v++) {
16808 uint64_t _res_conv_21 = _res_vals[v];
16809 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
16810 CHECK_ACCESS(_res_conv_21_ptr);
16811 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
16812 FREE(untag_ptr(_res_conv_21));
16813 _res_constr.data[v] = _res_conv_21_conv;
16816 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
16819 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
16820 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16821 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
16822 return tag_ptr(ret_conv, true);
16824 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint64_t arg) {
16825 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
16826 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
16830 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint64_t orig) {
16831 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
16832 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16833 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
16834 return tag_ptr(ret_conv, true);
16837 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint64_tArray b) {
16838 LDKThirtyTwoBytes a_ref;
16839 CHECK(a->arr_len == 32);
16840 memcpy(a_ref.data, a->elems, 32); FREE(a);
16841 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
16842 b_constr.datalen = b->arr_len;
16843 if (b_constr.datalen > 0)
16844 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16846 b_constr.data = NULL;
16847 uint64_t* b_vals = b->elems;
16848 for (size_t v = 0; v < b_constr.datalen; v++) {
16849 uint64_t b_conv_21 = b_vals[v];
16850 void* b_conv_21_ptr = untag_ptr(b_conv_21);
16851 CHECK_ACCESS(b_conv_21_ptr);
16852 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
16853 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
16854 b_constr.data[v] = b_conv_21_conv;
16857 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16858 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
16859 return tag_ptr(ret_conv, true);
16862 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint64_t _res) {
16863 if (!ptr_is_owned(_res)) return;
16864 void* _res_ptr = untag_ptr(_res);
16865 CHECK_ACCESS(_res_ptr);
16866 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
16867 FREE(untag_ptr(_res));
16868 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
16871 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint64_tArray _res) {
16872 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
16873 _res_constr.datalen = _res->arr_len;
16874 if (_res_constr.datalen > 0)
16875 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
16877 _res_constr.data = NULL;
16878 uint64_t* _res_vals = _res->elems;
16879 for (size_t o = 0; o < _res_constr.datalen; o++) {
16880 uint64_t _res_conv_40 = _res_vals[o];
16881 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
16882 CHECK_ACCESS(_res_conv_40_ptr);
16883 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
16884 FREE(untag_ptr(_res_conv_40));
16885 _res_constr.data[o] = _res_conv_40_conv;
16888 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
16891 void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(uint64_tArray _res) {
16892 LDKCVec_EventZ _res_constr;
16893 _res_constr.datalen = _res->arr_len;
16894 if (_res_constr.datalen > 0)
16895 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
16897 _res_constr.data = NULL;
16898 uint64_t* _res_vals = _res->elems;
16899 for (size_t h = 0; h < _res_constr.datalen; h++) {
16900 uint64_t _res_conv_7 = _res_vals[h];
16901 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
16902 CHECK_ACCESS(_res_conv_7_ptr);
16903 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
16904 FREE(untag_ptr(_res_conv_7));
16905 _res_constr.data[h] = _res_conv_7_conv;
16908 CVec_EventZ_free(_res_constr);
16911 void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) {
16912 LDKCVec_TransactionZ _res_constr;
16913 _res_constr.datalen = _res->arr_len;
16914 if (_res_constr.datalen > 0)
16915 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
16917 _res_constr.data = NULL;
16918 int8_tArray* _res_vals = (void*) _res->elems;
16919 for (size_t m = 0; m < _res_constr.datalen; m++) {
16920 int8_tArray _res_conv_12 = _res_vals[m];
16921 LDKTransaction _res_conv_12_ref;
16922 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
16923 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
16924 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
16925 _res_conv_12_ref.data_is_owned = true;
16926 _res_constr.data[m] = _res_conv_12_ref;
16929 CVec_TransactionZ_free(_res_constr);
16932 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
16933 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16934 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
16935 return tag_ptr(ret_conv, true);
16937 int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint64_t arg) {
16938 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
16939 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
16943 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_u32TxOutZ_clone(uint64_t orig) {
16944 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
16945 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16946 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
16947 return tag_ptr(ret_conv, true);
16950 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint64_t b) {
16951 void* b_ptr = untag_ptr(b);
16952 CHECK_ACCESS(b_ptr);
16953 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
16954 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
16955 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16956 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
16957 return tag_ptr(ret_conv, true);
16960 void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint64_t _res) {
16961 if (!ptr_is_owned(_res)) return;
16962 void* _res_ptr = untag_ptr(_res);
16963 CHECK_ACCESS(_res_ptr);
16964 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
16965 FREE(untag_ptr(_res));
16966 C2Tuple_u32TxOutZ_free(_res_conv);
16969 void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uint64_tArray _res) {
16970 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
16971 _res_constr.datalen = _res->arr_len;
16972 if (_res_constr.datalen > 0)
16973 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
16975 _res_constr.data = NULL;
16976 uint64_t* _res_vals = _res->elems;
16977 for (size_t u = 0; u < _res_constr.datalen; u++) {
16978 uint64_t _res_conv_20 = _res_vals[u];
16979 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
16980 CHECK_ACCESS(_res_conv_20_ptr);
16981 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
16982 FREE(untag_ptr(_res_conv_20));
16983 _res_constr.data[u] = _res_conv_20_conv;
16986 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
16989 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
16990 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
16991 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
16992 return tag_ptr(ret_conv, true);
16994 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint64_t arg) {
16995 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
16996 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
17000 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint64_t orig) {
17001 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
17002 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
17003 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
17004 return tag_ptr(ret_conv, true);
17007 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint64_tArray b) {
17008 LDKThirtyTwoBytes a_ref;
17009 CHECK(a->arr_len == 32);
17010 memcpy(a_ref.data, a->elems, 32); FREE(a);
17011 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
17012 b_constr.datalen = b->arr_len;
17013 if (b_constr.datalen > 0)
17014 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
17016 b_constr.data = NULL;
17017 uint64_t* b_vals = b->elems;
17018 for (size_t u = 0; u < b_constr.datalen; u++) {
17019 uint64_t b_conv_20 = b_vals[u];
17020 void* b_conv_20_ptr = untag_ptr(b_conv_20);
17021 CHECK_ACCESS(b_conv_20_ptr);
17022 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
17023 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
17024 b_constr.data[u] = b_conv_20_conv;
17027 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
17028 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
17029 return tag_ptr(ret_conv, true);
17032 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint64_t _res) {
17033 if (!ptr_is_owned(_res)) return;
17034 void* _res_ptr = untag_ptr(_res);
17035 CHECK_ACCESS(_res_ptr);
17036 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
17037 FREE(untag_ptr(_res));
17038 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
17041 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint64_tArray _res) {
17042 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
17043 _res_constr.datalen = _res->arr_len;
17044 if (_res_constr.datalen > 0)
17045 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
17047 _res_constr.data = NULL;
17048 uint64_t* _res_vals = _res->elems;
17049 for (size_t n = 0; n < _res_constr.datalen; n++) {
17050 uint64_t _res_conv_39 = _res_vals[n];
17051 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
17052 CHECK_ACCESS(_res_conv_39_ptr);
17053 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
17054 FREE(untag_ptr(_res_conv_39));
17055 _res_constr.data[n] = _res_conv_39_conv;
17058 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
17061 void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_free(uint64_tArray _res) {
17062 LDKCVec_BalanceZ _res_constr;
17063 _res_constr.datalen = _res->arr_len;
17064 if (_res_constr.datalen > 0)
17065 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
17067 _res_constr.data = NULL;
17068 uint64_t* _res_vals = _res->elems;
17069 for (size_t j = 0; j < _res_constr.datalen; j++) {
17070 uint64_t _res_conv_9 = _res_vals[j];
17071 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
17072 CHECK_ACCESS(_res_conv_9_ptr);
17073 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
17074 FREE(untag_ptr(_res_conv_9));
17075 _res_constr.data[j] = _res_conv_9_conv;
17078 CVec_BalanceZ_free(_res_constr);
17081 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
17082 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17083 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
17084 return tag_ptr(ret_conv, true);
17086 int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint64_t arg) {
17087 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
17088 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
17092 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint64_t orig) {
17093 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
17094 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17095 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
17096 return tag_ptr(ret_conv, true);
17099 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint64_t b) {
17100 LDKThirtyTwoBytes a_ref;
17101 CHECK(a->arr_len == 32);
17102 memcpy(a_ref.data, a->elems, 32); FREE(a);
17103 LDKChannelMonitor b_conv;
17104 b_conv.inner = untag_ptr(b);
17105 b_conv.is_owned = ptr_is_owned(b);
17106 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
17107 b_conv = ChannelMonitor_clone(&b_conv);
17108 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17109 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
17110 return tag_ptr(ret_conv, true);
17113 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint64_t _res) {
17114 if (!ptr_is_owned(_res)) return;
17115 void* _res_ptr = untag_ptr(_res);
17116 CHECK_ACCESS(_res_ptr);
17117 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
17118 FREE(untag_ptr(_res));
17119 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
17122 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint64_t o) {
17123 void* o_ptr = untag_ptr(o);
17124 CHECK_ACCESS(o_ptr);
17125 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
17126 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
17127 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17128 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
17129 return tag_ptr(ret_conv, true);
17132 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
17133 LDKDecodeError e_conv;
17134 e_conv.inner = untag_ptr(e);
17135 e_conv.is_owned = ptr_is_owned(e);
17136 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17137 e_conv = DecodeError_clone(&e_conv);
17138 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17139 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
17140 return tag_ptr(ret_conv, true);
17143 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint64_t o) {
17144 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
17145 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
17149 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint64_t _res) {
17150 if (!ptr_is_owned(_res)) return;
17151 void* _res_ptr = untag_ptr(_res);
17152 CHECK_ACCESS(_res_ptr);
17153 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
17154 FREE(untag_ptr(_res));
17155 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
17158 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
17159 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17160 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
17161 return tag_ptr(ret_conv, true);
17163 int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint64_t arg) {
17164 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
17165 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
17169 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint64_t orig) {
17170 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
17171 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17172 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
17173 return tag_ptr(ret_conv, true);
17176 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
17177 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17178 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
17179 return tag_ptr(ret_conv, true);
17181 int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint64_t arg) {
17182 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
17183 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
17187 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
17188 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
17189 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17190 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
17191 return tag_ptr(ret_conv, true);
17194 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
17195 LDKPublicKey a_ref;
17196 CHECK(a->arr_len == 33);
17197 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
17198 void* b_ptr = untag_ptr(b);
17199 CHECK_ACCESS(b_ptr);
17200 LDKType b_conv = *(LDKType*)(b_ptr);
17201 if (b_conv.free == LDKType_JCalls_free) {
17202 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
17203 LDKType_JCalls_cloned(&b_conv);
17205 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17206 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
17207 return tag_ptr(ret_conv, true);
17210 void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
17211 if (!ptr_is_owned(_res)) return;
17212 void* _res_ptr = untag_ptr(_res);
17213 CHECK_ACCESS(_res_ptr);
17214 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
17215 FREE(untag_ptr(_res));
17216 C2Tuple_PublicKeyTypeZ_free(_res_conv);
17219 void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
17220 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
17221 _res_constr.datalen = _res->arr_len;
17222 if (_res_constr.datalen > 0)
17223 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
17225 _res_constr.data = NULL;
17226 uint64_t* _res_vals = _res->elems;
17227 for (size_t z = 0; z < _res_constr.datalen; z++) {
17228 uint64_t _res_conv_25 = _res_vals[z];
17229 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
17230 CHECK_ACCESS(_res_conv_25_ptr);
17231 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
17232 FREE(untag_ptr(_res_conv_25));
17233 _res_constr.data[z] = _res_conv_25_conv;
17236 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
17239 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
17240 void* o_ptr = untag_ptr(o);
17241 CHECK_ACCESS(o_ptr);
17242 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17243 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17244 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17245 *ret_copy = COption_NetAddressZ_some(o_conv);
17246 uint64_t ret_ref = tag_ptr(ret_copy, true);
17250 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
17251 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17252 *ret_copy = COption_NetAddressZ_none();
17253 uint64_t ret_ref = tag_ptr(ret_copy, true);
17257 void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
17258 if (!ptr_is_owned(_res)) return;
17259 void* _res_ptr = untag_ptr(_res);
17260 CHECK_ACCESS(_res_ptr);
17261 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
17262 FREE(untag_ptr(_res));
17263 COption_NetAddressZ_free(_res_conv);
17266 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
17267 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17268 *ret_copy = COption_NetAddressZ_clone(arg);
17269 uint64_t ret_ref = tag_ptr(ret_copy, true);
17272 int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
17273 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
17274 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
17278 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
17279 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
17280 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17281 *ret_copy = COption_NetAddressZ_clone(orig_conv);
17282 uint64_t ret_ref = tag_ptr(ret_copy, true);
17286 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
17288 o_ref.datalen = o->arr_len;
17289 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
17290 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
17291 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17292 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
17293 return tag_ptr(ret_conv, true);
17296 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
17297 LDKPeerHandleError e_conv;
17298 e_conv.inner = untag_ptr(e);
17299 e_conv.is_owned = ptr_is_owned(e);
17300 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17301 e_conv = PeerHandleError_clone(&e_conv);
17302 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17303 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
17304 return tag_ptr(ret_conv, true);
17307 jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
17308 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
17309 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
17313 void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
17314 if (!ptr_is_owned(_res)) return;
17315 void* _res_ptr = untag_ptr(_res);
17316 CHECK_ACCESS(_res_ptr);
17317 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
17318 FREE(untag_ptr(_res));
17319 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
17322 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
17323 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17324 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
17325 return tag_ptr(ret_conv, true);
17327 int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17328 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
17329 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
17333 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
17334 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
17335 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17336 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
17337 return tag_ptr(ret_conv, true);
17340 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
17341 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17342 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
17343 return tag_ptr(ret_conv, true);
17346 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
17347 LDKPeerHandleError e_conv;
17348 e_conv.inner = untag_ptr(e);
17349 e_conv.is_owned = ptr_is_owned(e);
17350 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17351 e_conv = PeerHandleError_clone(&e_conv);
17352 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17353 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
17354 return tag_ptr(ret_conv, true);
17357 jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
17358 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
17359 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
17363 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
17364 if (!ptr_is_owned(_res)) return;
17365 void* _res_ptr = untag_ptr(_res);
17366 CHECK_ACCESS(_res_ptr);
17367 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
17368 FREE(untag_ptr(_res));
17369 CResult_NonePeerHandleErrorZ_free(_res_conv);
17372 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
17373 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17374 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
17375 return tag_ptr(ret_conv, true);
17377 int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
17378 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
17379 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
17383 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
17384 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
17385 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17386 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
17387 return tag_ptr(ret_conv, true);
17390 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
17391 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17392 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
17393 return tag_ptr(ret_conv, true);
17396 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
17397 LDKPeerHandleError e_conv;
17398 e_conv.inner = untag_ptr(e);
17399 e_conv.is_owned = ptr_is_owned(e);
17400 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17401 e_conv = PeerHandleError_clone(&e_conv);
17402 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17403 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
17404 return tag_ptr(ret_conv, true);
17407 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
17408 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
17409 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
17413 void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
17414 if (!ptr_is_owned(_res)) return;
17415 void* _res_ptr = untag_ptr(_res);
17416 CHECK_ACCESS(_res_ptr);
17417 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
17418 FREE(untag_ptr(_res));
17419 CResult_boolPeerHandleErrorZ_free(_res_conv);
17422 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
17423 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17424 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
17425 return tag_ptr(ret_conv, true);
17427 int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17428 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
17429 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
17433 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
17434 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
17435 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17436 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
17437 return tag_ptr(ret_conv, true);
17440 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() {
17441 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17442 *ret_conv = CResult_NoneErrorZ_ok();
17443 return tag_ptr(ret_conv, true);
17446 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) {
17447 LDKIOError e_conv = LDKIOError_from_js(e);
17448 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17449 *ret_conv = CResult_NoneErrorZ_err(e_conv);
17450 return tag_ptr(ret_conv, true);
17453 jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) {
17454 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
17455 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
17459 void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) {
17460 if (!ptr_is_owned(_res)) return;
17461 void* _res_ptr = untag_ptr(_res);
17462 CHECK_ACCESS(_res_ptr);
17463 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
17464 FREE(untag_ptr(_res));
17465 CResult_NoneErrorZ_free(_res_conv);
17468 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
17469 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17470 *ret_conv = CResult_NoneErrorZ_clone(arg);
17471 return tag_ptr(ret_conv, true);
17473 int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) {
17474 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
17475 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
17479 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) {
17480 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
17481 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17482 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
17483 return tag_ptr(ret_conv, true);
17486 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint64_t o) {
17487 void* o_ptr = untag_ptr(o);
17488 CHECK_ACCESS(o_ptr);
17489 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17490 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17491 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17492 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
17493 return tag_ptr(ret_conv, true);
17496 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
17497 LDKDecodeError e_conv;
17498 e_conv.inner = untag_ptr(e);
17499 e_conv.is_owned = ptr_is_owned(e);
17500 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17501 e_conv = DecodeError_clone(&e_conv);
17502 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17503 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
17504 return tag_ptr(ret_conv, true);
17507 jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) {
17508 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
17509 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
17513 void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) {
17514 if (!ptr_is_owned(_res)) return;
17515 void* _res_ptr = untag_ptr(_res);
17516 CHECK_ACCESS(_res_ptr);
17517 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
17518 FREE(untag_ptr(_res));
17519 CResult_NetAddressDecodeErrorZ_free(_res_conv);
17522 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
17523 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17524 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
17525 return tag_ptr(ret_conv, true);
17527 int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) {
17528 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
17529 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
17533 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) {
17534 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
17535 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17536 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
17537 return tag_ptr(ret_conv, true);
17540 void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) {
17541 LDKCVec_UpdateAddHTLCZ _res_constr;
17542 _res_constr.datalen = _res->arr_len;
17543 if (_res_constr.datalen > 0)
17544 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
17546 _res_constr.data = NULL;
17547 uint64_t* _res_vals = _res->elems;
17548 for (size_t p = 0; p < _res_constr.datalen; p++) {
17549 uint64_t _res_conv_15 = _res_vals[p];
17550 LDKUpdateAddHTLC _res_conv_15_conv;
17551 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
17552 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
17553 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
17554 _res_constr.data[p] = _res_conv_15_conv;
17557 CVec_UpdateAddHTLCZ_free(_res_constr);
17560 void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) {
17561 LDKCVec_UpdateFulfillHTLCZ _res_constr;
17562 _res_constr.datalen = _res->arr_len;
17563 if (_res_constr.datalen > 0)
17564 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
17566 _res_constr.data = NULL;
17567 uint64_t* _res_vals = _res->elems;
17568 for (size_t t = 0; t < _res_constr.datalen; t++) {
17569 uint64_t _res_conv_19 = _res_vals[t];
17570 LDKUpdateFulfillHTLC _res_conv_19_conv;
17571 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
17572 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
17573 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
17574 _res_constr.data[t] = _res_conv_19_conv;
17577 CVec_UpdateFulfillHTLCZ_free(_res_constr);
17580 void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) {
17581 LDKCVec_UpdateFailHTLCZ _res_constr;
17582 _res_constr.datalen = _res->arr_len;
17583 if (_res_constr.datalen > 0)
17584 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
17586 _res_constr.data = NULL;
17587 uint64_t* _res_vals = _res->elems;
17588 for (size_t q = 0; q < _res_constr.datalen; q++) {
17589 uint64_t _res_conv_16 = _res_vals[q];
17590 LDKUpdateFailHTLC _res_conv_16_conv;
17591 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17592 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17593 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17594 _res_constr.data[q] = _res_conv_16_conv;
17597 CVec_UpdateFailHTLCZ_free(_res_constr);
17600 void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) {
17601 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
17602 _res_constr.datalen = _res->arr_len;
17603 if (_res_constr.datalen > 0)
17604 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
17606 _res_constr.data = NULL;
17607 uint64_t* _res_vals = _res->elems;
17608 for (size_t z = 0; z < _res_constr.datalen; z++) {
17609 uint64_t _res_conv_25 = _res_vals[z];
17610 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
17611 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
17612 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
17613 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
17614 _res_constr.data[z] = _res_conv_25_conv;
17617 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
17620 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) {
17621 LDKAcceptChannel o_conv;
17622 o_conv.inner = untag_ptr(o);
17623 o_conv.is_owned = ptr_is_owned(o);
17624 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17625 o_conv = AcceptChannel_clone(&o_conv);
17626 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17627 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
17628 return tag_ptr(ret_conv, true);
17631 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
17632 LDKDecodeError e_conv;
17633 e_conv.inner = untag_ptr(e);
17634 e_conv.is_owned = ptr_is_owned(e);
17635 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17636 e_conv = DecodeError_clone(&e_conv);
17637 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17638 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
17639 return tag_ptr(ret_conv, true);
17642 jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) {
17643 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
17644 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
17648 void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) {
17649 if (!ptr_is_owned(_res)) return;
17650 void* _res_ptr = untag_ptr(_res);
17651 CHECK_ACCESS(_res_ptr);
17652 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
17653 FREE(untag_ptr(_res));
17654 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
17657 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
17658 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17659 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
17660 return tag_ptr(ret_conv, true);
17662 int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
17663 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
17664 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
17668 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) {
17669 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
17670 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17671 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
17672 return tag_ptr(ret_conv, true);
17675 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) {
17676 LDKAnnouncementSignatures o_conv;
17677 o_conv.inner = untag_ptr(o);
17678 o_conv.is_owned = ptr_is_owned(o);
17679 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17680 o_conv = AnnouncementSignatures_clone(&o_conv);
17681 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17682 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
17683 return tag_ptr(ret_conv, true);
17686 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
17687 LDKDecodeError e_conv;
17688 e_conv.inner = untag_ptr(e);
17689 e_conv.is_owned = ptr_is_owned(e);
17690 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17691 e_conv = DecodeError_clone(&e_conv);
17692 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17693 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
17694 return tag_ptr(ret_conv, true);
17697 jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) {
17698 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
17699 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
17703 void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) {
17704 if (!ptr_is_owned(_res)) return;
17705 void* _res_ptr = untag_ptr(_res);
17706 CHECK_ACCESS(_res_ptr);
17707 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
17708 FREE(untag_ptr(_res));
17709 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
17712 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
17713 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17714 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
17715 return tag_ptr(ret_conv, true);
17717 int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
17718 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
17719 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
17723 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) {
17724 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
17725 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17726 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
17727 return tag_ptr(ret_conv, true);
17730 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) {
17731 LDKChannelReestablish o_conv;
17732 o_conv.inner = untag_ptr(o);
17733 o_conv.is_owned = ptr_is_owned(o);
17734 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17735 o_conv = ChannelReestablish_clone(&o_conv);
17736 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17737 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
17738 return tag_ptr(ret_conv, true);
17741 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
17742 LDKDecodeError e_conv;
17743 e_conv.inner = untag_ptr(e);
17744 e_conv.is_owned = ptr_is_owned(e);
17745 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17746 e_conv = DecodeError_clone(&e_conv);
17747 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17748 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
17749 return tag_ptr(ret_conv, true);
17752 jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) {
17753 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
17754 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
17758 void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) {
17759 if (!ptr_is_owned(_res)) return;
17760 void* _res_ptr = untag_ptr(_res);
17761 CHECK_ACCESS(_res_ptr);
17762 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
17763 FREE(untag_ptr(_res));
17764 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
17767 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
17768 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17769 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
17770 return tag_ptr(ret_conv, true);
17772 int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) {
17773 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
17774 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
17778 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) {
17779 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
17780 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17781 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
17782 return tag_ptr(ret_conv, true);
17785 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) {
17786 LDKClosingSigned o_conv;
17787 o_conv.inner = untag_ptr(o);
17788 o_conv.is_owned = ptr_is_owned(o);
17789 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17790 o_conv = ClosingSigned_clone(&o_conv);
17791 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17792 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
17793 return tag_ptr(ret_conv, true);
17796 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
17797 LDKDecodeError e_conv;
17798 e_conv.inner = untag_ptr(e);
17799 e_conv.is_owned = ptr_is_owned(e);
17800 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17801 e_conv = DecodeError_clone(&e_conv);
17802 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17803 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
17804 return tag_ptr(ret_conv, true);
17807 jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) {
17808 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
17809 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
17813 void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) {
17814 if (!ptr_is_owned(_res)) return;
17815 void* _res_ptr = untag_ptr(_res);
17816 CHECK_ACCESS(_res_ptr);
17817 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
17818 FREE(untag_ptr(_res));
17819 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
17822 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
17823 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17824 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
17825 return tag_ptr(ret_conv, true);
17827 int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17828 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
17829 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
17833 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) {
17834 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
17835 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17836 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
17837 return tag_ptr(ret_conv, true);
17840 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) {
17841 LDKClosingSignedFeeRange o_conv;
17842 o_conv.inner = untag_ptr(o);
17843 o_conv.is_owned = ptr_is_owned(o);
17844 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17845 o_conv = ClosingSignedFeeRange_clone(&o_conv);
17846 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17847 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
17848 return tag_ptr(ret_conv, true);
17851 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
17852 LDKDecodeError e_conv;
17853 e_conv.inner = untag_ptr(e);
17854 e_conv.is_owned = ptr_is_owned(e);
17855 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17856 e_conv = DecodeError_clone(&e_conv);
17857 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17858 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
17859 return tag_ptr(ret_conv, true);
17862 jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) {
17863 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
17864 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
17868 void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) {
17869 if (!ptr_is_owned(_res)) return;
17870 void* _res_ptr = untag_ptr(_res);
17871 CHECK_ACCESS(_res_ptr);
17872 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
17873 FREE(untag_ptr(_res));
17874 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
17877 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
17878 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17879 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
17880 return tag_ptr(ret_conv, true);
17882 int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
17883 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
17884 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
17888 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) {
17889 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
17890 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17891 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
17892 return tag_ptr(ret_conv, true);
17895 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) {
17896 LDKCommitmentSigned o_conv;
17897 o_conv.inner = untag_ptr(o);
17898 o_conv.is_owned = ptr_is_owned(o);
17899 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17900 o_conv = CommitmentSigned_clone(&o_conv);
17901 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17902 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
17903 return tag_ptr(ret_conv, true);
17906 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
17907 LDKDecodeError e_conv;
17908 e_conv.inner = untag_ptr(e);
17909 e_conv.is_owned = ptr_is_owned(e);
17910 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17911 e_conv = DecodeError_clone(&e_conv);
17912 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17913 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
17914 return tag_ptr(ret_conv, true);
17917 jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) {
17918 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
17919 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
17923 void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) {
17924 if (!ptr_is_owned(_res)) return;
17925 void* _res_ptr = untag_ptr(_res);
17926 CHECK_ACCESS(_res_ptr);
17927 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
17928 FREE(untag_ptr(_res));
17929 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
17932 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
17933 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17934 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
17935 return tag_ptr(ret_conv, true);
17937 int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17938 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
17939 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
17943 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) {
17944 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
17945 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17946 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
17947 return tag_ptr(ret_conv, true);
17950 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) {
17951 LDKFundingCreated o_conv;
17952 o_conv.inner = untag_ptr(o);
17953 o_conv.is_owned = ptr_is_owned(o);
17954 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17955 o_conv = FundingCreated_clone(&o_conv);
17956 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17957 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
17958 return tag_ptr(ret_conv, true);
17961 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
17962 LDKDecodeError e_conv;
17963 e_conv.inner = untag_ptr(e);
17964 e_conv.is_owned = ptr_is_owned(e);
17965 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17966 e_conv = DecodeError_clone(&e_conv);
17967 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17968 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
17969 return tag_ptr(ret_conv, true);
17972 jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) {
17973 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
17974 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
17978 void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) {
17979 if (!ptr_is_owned(_res)) return;
17980 void* _res_ptr = untag_ptr(_res);
17981 CHECK_ACCESS(_res_ptr);
17982 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
17983 FREE(untag_ptr(_res));
17984 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
17987 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
17988 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17989 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
17990 return tag_ptr(ret_conv, true);
17992 int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) {
17993 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
17994 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
17998 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) {
17999 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
18000 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
18001 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
18002 return tag_ptr(ret_conv, true);
18005 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) {
18006 LDKFundingSigned o_conv;
18007 o_conv.inner = untag_ptr(o);
18008 o_conv.is_owned = ptr_is_owned(o);
18009 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18010 o_conv = FundingSigned_clone(&o_conv);
18011 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18012 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
18013 return tag_ptr(ret_conv, true);
18016 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
18017 LDKDecodeError e_conv;
18018 e_conv.inner = untag_ptr(e);
18019 e_conv.is_owned = ptr_is_owned(e);
18020 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18021 e_conv = DecodeError_clone(&e_conv);
18022 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18023 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
18024 return tag_ptr(ret_conv, true);
18027 jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) {
18028 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
18029 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
18033 void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) {
18034 if (!ptr_is_owned(_res)) return;
18035 void* _res_ptr = untag_ptr(_res);
18036 CHECK_ACCESS(_res_ptr);
18037 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
18038 FREE(untag_ptr(_res));
18039 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
18042 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
18043 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18044 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
18045 return tag_ptr(ret_conv, true);
18047 int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
18048 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
18049 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
18053 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) {
18054 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
18055 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18056 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
18057 return tag_ptr(ret_conv, true);
18060 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) {
18061 LDKChannelReady o_conv;
18062 o_conv.inner = untag_ptr(o);
18063 o_conv.is_owned = ptr_is_owned(o);
18064 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18065 o_conv = ChannelReady_clone(&o_conv);
18066 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18067 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
18068 return tag_ptr(ret_conv, true);
18071 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
18072 LDKDecodeError e_conv;
18073 e_conv.inner = untag_ptr(e);
18074 e_conv.is_owned = ptr_is_owned(e);
18075 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18076 e_conv = DecodeError_clone(&e_conv);
18077 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18078 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
18079 return tag_ptr(ret_conv, true);
18082 jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) {
18083 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
18084 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
18088 void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) {
18089 if (!ptr_is_owned(_res)) return;
18090 void* _res_ptr = untag_ptr(_res);
18091 CHECK_ACCESS(_res_ptr);
18092 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
18093 FREE(untag_ptr(_res));
18094 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
18097 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
18098 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18099 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
18100 return tag_ptr(ret_conv, true);
18102 int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) {
18103 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
18104 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
18108 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) {
18109 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
18110 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18111 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
18112 return tag_ptr(ret_conv, true);
18115 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) {
18117 o_conv.inner = untag_ptr(o);
18118 o_conv.is_owned = ptr_is_owned(o);
18119 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18120 o_conv = Init_clone(&o_conv);
18121 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18122 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
18123 return tag_ptr(ret_conv, true);
18126 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
18127 LDKDecodeError e_conv;
18128 e_conv.inner = untag_ptr(e);
18129 e_conv.is_owned = ptr_is_owned(e);
18130 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18131 e_conv = DecodeError_clone(&e_conv);
18132 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18133 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
18134 return tag_ptr(ret_conv, true);
18137 jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) {
18138 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
18139 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
18143 void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) {
18144 if (!ptr_is_owned(_res)) return;
18145 void* _res_ptr = untag_ptr(_res);
18146 CHECK_ACCESS(_res_ptr);
18147 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
18148 FREE(untag_ptr(_res));
18149 CResult_InitDecodeErrorZ_free(_res_conv);
18152 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
18153 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18154 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
18155 return tag_ptr(ret_conv, true);
18157 int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) {
18158 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
18159 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
18163 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) {
18164 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
18165 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18166 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
18167 return tag_ptr(ret_conv, true);
18170 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) {
18171 LDKOpenChannel o_conv;
18172 o_conv.inner = untag_ptr(o);
18173 o_conv.is_owned = ptr_is_owned(o);
18174 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18175 o_conv = OpenChannel_clone(&o_conv);
18176 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18177 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
18178 return tag_ptr(ret_conv, true);
18181 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
18182 LDKDecodeError e_conv;
18183 e_conv.inner = untag_ptr(e);
18184 e_conv.is_owned = ptr_is_owned(e);
18185 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18186 e_conv = DecodeError_clone(&e_conv);
18187 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18188 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
18189 return tag_ptr(ret_conv, true);
18192 jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) {
18193 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
18194 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
18198 void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) {
18199 if (!ptr_is_owned(_res)) return;
18200 void* _res_ptr = untag_ptr(_res);
18201 CHECK_ACCESS(_res_ptr);
18202 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
18203 FREE(untag_ptr(_res));
18204 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
18207 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
18208 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18209 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
18210 return tag_ptr(ret_conv, true);
18212 int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
18213 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
18214 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
18218 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) {
18219 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
18220 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18221 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
18222 return tag_ptr(ret_conv, true);
18225 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) {
18226 LDKRevokeAndACK o_conv;
18227 o_conv.inner = untag_ptr(o);
18228 o_conv.is_owned = ptr_is_owned(o);
18229 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18230 o_conv = RevokeAndACK_clone(&o_conv);
18231 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18232 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
18233 return tag_ptr(ret_conv, true);
18236 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
18237 LDKDecodeError e_conv;
18238 e_conv.inner = untag_ptr(e);
18239 e_conv.is_owned = ptr_is_owned(e);
18240 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18241 e_conv = DecodeError_clone(&e_conv);
18242 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18243 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
18244 return tag_ptr(ret_conv, true);
18247 jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) {
18248 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
18249 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
18253 void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) {
18254 if (!ptr_is_owned(_res)) return;
18255 void* _res_ptr = untag_ptr(_res);
18256 CHECK_ACCESS(_res_ptr);
18257 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
18258 FREE(untag_ptr(_res));
18259 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
18262 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
18263 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18264 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
18265 return tag_ptr(ret_conv, true);
18267 int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) {
18268 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
18269 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
18273 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) {
18274 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
18275 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18276 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
18277 return tag_ptr(ret_conv, true);
18280 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) {
18281 LDKShutdown o_conv;
18282 o_conv.inner = untag_ptr(o);
18283 o_conv.is_owned = ptr_is_owned(o);
18284 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18285 o_conv = Shutdown_clone(&o_conv);
18286 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18287 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
18288 return tag_ptr(ret_conv, true);
18291 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
18292 LDKDecodeError e_conv;
18293 e_conv.inner = untag_ptr(e);
18294 e_conv.is_owned = ptr_is_owned(e);
18295 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18296 e_conv = DecodeError_clone(&e_conv);
18297 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18298 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
18299 return tag_ptr(ret_conv, true);
18302 jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) {
18303 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
18304 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
18308 void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) {
18309 if (!ptr_is_owned(_res)) return;
18310 void* _res_ptr = untag_ptr(_res);
18311 CHECK_ACCESS(_res_ptr);
18312 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
18313 FREE(untag_ptr(_res));
18314 CResult_ShutdownDecodeErrorZ_free(_res_conv);
18317 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
18318 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18319 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
18320 return tag_ptr(ret_conv, true);
18322 int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) {
18323 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
18324 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
18328 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) {
18329 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
18330 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18331 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
18332 return tag_ptr(ret_conv, true);
18335 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) {
18336 LDKUpdateFailHTLC o_conv;
18337 o_conv.inner = untag_ptr(o);
18338 o_conv.is_owned = ptr_is_owned(o);
18339 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18340 o_conv = UpdateFailHTLC_clone(&o_conv);
18341 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18342 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
18343 return tag_ptr(ret_conv, true);
18346 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
18347 LDKDecodeError e_conv;
18348 e_conv.inner = untag_ptr(e);
18349 e_conv.is_owned = ptr_is_owned(e);
18350 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18351 e_conv = DecodeError_clone(&e_conv);
18352 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18353 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
18354 return tag_ptr(ret_conv, true);
18357 jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint64_t o) {
18358 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
18359 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
18363 void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint64_t _res) {
18364 if (!ptr_is_owned(_res)) return;
18365 void* _res_ptr = untag_ptr(_res);
18366 CHECK_ACCESS(_res_ptr);
18367 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
18368 FREE(untag_ptr(_res));
18369 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
18372 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
18373 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18374 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
18375 return tag_ptr(ret_conv, true);
18377 int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18378 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
18379 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
18383 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint64_t orig) {
18384 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
18385 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18386 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
18387 return tag_ptr(ret_conv, true);
18390 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint64_t o) {
18391 LDKUpdateFailMalformedHTLC o_conv;
18392 o_conv.inner = untag_ptr(o);
18393 o_conv.is_owned = ptr_is_owned(o);
18394 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18395 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
18396 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18397 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
18398 return tag_ptr(ret_conv, true);
18401 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
18402 LDKDecodeError e_conv;
18403 e_conv.inner = untag_ptr(e);
18404 e_conv.is_owned = ptr_is_owned(e);
18405 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18406 e_conv = DecodeError_clone(&e_conv);
18407 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18408 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
18409 return tag_ptr(ret_conv, true);
18412 jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint64_t o) {
18413 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
18414 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
18418 void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint64_t _res) {
18419 if (!ptr_is_owned(_res)) return;
18420 void* _res_ptr = untag_ptr(_res);
18421 CHECK_ACCESS(_res_ptr);
18422 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
18423 FREE(untag_ptr(_res));
18424 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
18427 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
18428 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18429 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
18430 return tag_ptr(ret_conv, true);
18432 int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18433 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
18434 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
18438 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint64_t orig) {
18439 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
18440 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18441 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
18442 return tag_ptr(ret_conv, true);
18445 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint64_t o) {
18446 LDKUpdateFee o_conv;
18447 o_conv.inner = untag_ptr(o);
18448 o_conv.is_owned = ptr_is_owned(o);
18449 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18450 o_conv = UpdateFee_clone(&o_conv);
18451 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18452 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
18453 return tag_ptr(ret_conv, true);
18456 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
18457 LDKDecodeError e_conv;
18458 e_conv.inner = untag_ptr(e);
18459 e_conv.is_owned = ptr_is_owned(e);
18460 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18461 e_conv = DecodeError_clone(&e_conv);
18462 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18463 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
18464 return tag_ptr(ret_conv, true);
18467 jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint64_t o) {
18468 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
18469 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
18473 void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint64_t _res) {
18474 if (!ptr_is_owned(_res)) return;
18475 void* _res_ptr = untag_ptr(_res);
18476 CHECK_ACCESS(_res_ptr);
18477 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
18478 FREE(untag_ptr(_res));
18479 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
18482 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
18483 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18484 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
18485 return tag_ptr(ret_conv, true);
18487 int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint64_t arg) {
18488 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
18489 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
18493 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint64_t orig) {
18494 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
18495 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18496 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
18497 return tag_ptr(ret_conv, true);
18500 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint64_t o) {
18501 LDKUpdateFulfillHTLC o_conv;
18502 o_conv.inner = untag_ptr(o);
18503 o_conv.is_owned = ptr_is_owned(o);
18504 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18505 o_conv = UpdateFulfillHTLC_clone(&o_conv);
18506 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18507 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
18508 return tag_ptr(ret_conv, true);
18511 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
18512 LDKDecodeError e_conv;
18513 e_conv.inner = untag_ptr(e);
18514 e_conv.is_owned = ptr_is_owned(e);
18515 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18516 e_conv = DecodeError_clone(&e_conv);
18517 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18518 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
18519 return tag_ptr(ret_conv, true);
18522 jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint64_t o) {
18523 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
18524 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
18528 void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint64_t _res) {
18529 if (!ptr_is_owned(_res)) return;
18530 void* _res_ptr = untag_ptr(_res);
18531 CHECK_ACCESS(_res_ptr);
18532 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
18533 FREE(untag_ptr(_res));
18534 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
18537 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
18538 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18539 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
18540 return tag_ptr(ret_conv, true);
18542 int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18543 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
18544 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
18548 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint64_t orig) {
18549 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
18550 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18551 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
18552 return tag_ptr(ret_conv, true);
18555 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint64_t o) {
18556 LDKUpdateAddHTLC o_conv;
18557 o_conv.inner = untag_ptr(o);
18558 o_conv.is_owned = ptr_is_owned(o);
18559 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18560 o_conv = UpdateAddHTLC_clone(&o_conv);
18561 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18562 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
18563 return tag_ptr(ret_conv, true);
18566 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
18567 LDKDecodeError e_conv;
18568 e_conv.inner = untag_ptr(e);
18569 e_conv.is_owned = ptr_is_owned(e);
18570 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18571 e_conv = DecodeError_clone(&e_conv);
18572 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18573 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
18574 return tag_ptr(ret_conv, true);
18577 jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint64_t o) {
18578 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
18579 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
18583 void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint64_t _res) {
18584 if (!ptr_is_owned(_res)) return;
18585 void* _res_ptr = untag_ptr(_res);
18586 CHECK_ACCESS(_res_ptr);
18587 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
18588 FREE(untag_ptr(_res));
18589 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
18592 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
18593 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18594 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
18595 return tag_ptr(ret_conv, true);
18597 int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18598 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
18599 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
18603 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint64_t orig) {
18604 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
18605 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18606 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
18607 return tag_ptr(ret_conv, true);
18610 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
18612 o_conv.inner = untag_ptr(o);
18613 o_conv.is_owned = ptr_is_owned(o);
18614 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18615 o_conv = Ping_clone(&o_conv);
18616 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18617 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
18618 return tag_ptr(ret_conv, true);
18621 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
18622 LDKDecodeError e_conv;
18623 e_conv.inner = untag_ptr(e);
18624 e_conv.is_owned = ptr_is_owned(e);
18625 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18626 e_conv = DecodeError_clone(&e_conv);
18627 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18628 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
18629 return tag_ptr(ret_conv, true);
18632 jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint64_t o) {
18633 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
18634 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
18638 void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint64_t _res) {
18639 if (!ptr_is_owned(_res)) return;
18640 void* _res_ptr = untag_ptr(_res);
18641 CHECK_ACCESS(_res_ptr);
18642 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
18643 FREE(untag_ptr(_res));
18644 CResult_PingDecodeErrorZ_free(_res_conv);
18647 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
18648 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18649 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
18650 return tag_ptr(ret_conv, true);
18652 int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint64_t arg) {
18653 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
18654 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
18658 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_CResult_PingDecodeErrorZ_clone(uint64_t orig) {
18659 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
18660 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18661 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
18662 return tag_ptr(ret_conv, true);
18665 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint64_t o) {
18667 o_conv.inner = untag_ptr(o);
18668 o_conv.is_owned = ptr_is_owned(o);
18669 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18670 o_conv = Pong_clone(&o_conv);
18671 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18672 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
18673 return tag_ptr(ret_conv, true);
18676 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
18677 LDKDecodeError e_conv;
18678 e_conv.inner = untag_ptr(e);
18679 e_conv.is_owned = ptr_is_owned(e);
18680 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18681 e_conv = DecodeError_clone(&e_conv);
18682 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18683 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
18684 return tag_ptr(ret_conv, true);
18687 jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint64_t o) {
18688 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
18689 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
18693 void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint64_t _res) {
18694 if (!ptr_is_owned(_res)) return;
18695 void* _res_ptr = untag_ptr(_res);
18696 CHECK_ACCESS(_res_ptr);
18697 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
18698 FREE(untag_ptr(_res));
18699 CResult_PongDecodeErrorZ_free(_res_conv);
18702 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
18703 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18704 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
18705 return tag_ptr(ret_conv, true);
18707 int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint64_t arg) {
18708 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
18709 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
18713 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_CResult_PongDecodeErrorZ_clone(uint64_t orig) {
18714 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
18715 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18716 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
18717 return tag_ptr(ret_conv, true);
18720 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18721 LDKUnsignedChannelAnnouncement o_conv;
18722 o_conv.inner = untag_ptr(o);
18723 o_conv.is_owned = ptr_is_owned(o);
18724 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18725 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
18726 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18727 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
18728 return tag_ptr(ret_conv, true);
18731 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18732 LDKDecodeError e_conv;
18733 e_conv.inner = untag_ptr(e);
18734 e_conv.is_owned = ptr_is_owned(e);
18735 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18736 e_conv = DecodeError_clone(&e_conv);
18737 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18738 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
18739 return tag_ptr(ret_conv, true);
18742 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18743 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18744 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18748 void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18749 if (!ptr_is_owned(_res)) return;
18750 void* _res_ptr = untag_ptr(_res);
18751 CHECK_ACCESS(_res_ptr);
18752 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18753 FREE(untag_ptr(_res));
18754 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
18757 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18758 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18759 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
18760 return tag_ptr(ret_conv, true);
18762 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18763 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18764 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18768 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18769 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18770 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18771 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18772 return tag_ptr(ret_conv, true);
18775 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18776 LDKChannelAnnouncement o_conv;
18777 o_conv.inner = untag_ptr(o);
18778 o_conv.is_owned = ptr_is_owned(o);
18779 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18780 o_conv = ChannelAnnouncement_clone(&o_conv);
18781 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18782 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
18783 return tag_ptr(ret_conv, true);
18786 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18787 LDKDecodeError e_conv;
18788 e_conv.inner = untag_ptr(e);
18789 e_conv.is_owned = ptr_is_owned(e);
18790 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18791 e_conv = DecodeError_clone(&e_conv);
18792 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18793 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
18794 return tag_ptr(ret_conv, true);
18797 jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18798 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18799 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18803 void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18804 if (!ptr_is_owned(_res)) return;
18805 void* _res_ptr = untag_ptr(_res);
18806 CHECK_ACCESS(_res_ptr);
18807 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18808 FREE(untag_ptr(_res));
18809 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
18812 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18813 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18814 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
18815 return tag_ptr(ret_conv, true);
18817 int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18818 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18819 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18823 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18824 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18825 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18826 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18827 return tag_ptr(ret_conv, true);
18830 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18831 LDKUnsignedChannelUpdate o_conv;
18832 o_conv.inner = untag_ptr(o);
18833 o_conv.is_owned = ptr_is_owned(o);
18834 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18835 o_conv = UnsignedChannelUpdate_clone(&o_conv);
18836 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18837 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
18838 return tag_ptr(ret_conv, true);
18841 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
18842 LDKDecodeError e_conv;
18843 e_conv.inner = untag_ptr(e);
18844 e_conv.is_owned = ptr_is_owned(e);
18845 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18846 e_conv = DecodeError_clone(&e_conv);
18847 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18848 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
18849 return tag_ptr(ret_conv, true);
18852 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18853 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
18854 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
18858 void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18859 if (!ptr_is_owned(_res)) return;
18860 void* _res_ptr = untag_ptr(_res);
18861 CHECK_ACCESS(_res_ptr);
18862 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
18863 FREE(untag_ptr(_res));
18864 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
18867 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18868 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18869 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
18870 return tag_ptr(ret_conv, true);
18872 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18873 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18874 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18878 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18879 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18880 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18881 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
18882 return tag_ptr(ret_conv, true);
18885 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18886 LDKChannelUpdate o_conv;
18887 o_conv.inner = untag_ptr(o);
18888 o_conv.is_owned = ptr_is_owned(o);
18889 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18890 o_conv = ChannelUpdate_clone(&o_conv);
18891 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18892 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
18893 return tag_ptr(ret_conv, true);
18896 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
18897 LDKDecodeError e_conv;
18898 e_conv.inner = untag_ptr(e);
18899 e_conv.is_owned = ptr_is_owned(e);
18900 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18901 e_conv = DecodeError_clone(&e_conv);
18902 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18903 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
18904 return tag_ptr(ret_conv, true);
18907 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18908 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
18909 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
18913 void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18914 if (!ptr_is_owned(_res)) return;
18915 void* _res_ptr = untag_ptr(_res);
18916 CHECK_ACCESS(_res_ptr);
18917 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
18918 FREE(untag_ptr(_res));
18919 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
18922 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18923 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18924 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
18925 return tag_ptr(ret_conv, true);
18927 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18928 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18929 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18933 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18934 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18935 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18936 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
18937 return tag_ptr(ret_conv, true);
18940 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint64_t o) {
18941 LDKErrorMessage o_conv;
18942 o_conv.inner = untag_ptr(o);
18943 o_conv.is_owned = ptr_is_owned(o);
18944 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18945 o_conv = ErrorMessage_clone(&o_conv);
18946 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18947 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
18948 return tag_ptr(ret_conv, true);
18951 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
18952 LDKDecodeError e_conv;
18953 e_conv.inner = untag_ptr(e);
18954 e_conv.is_owned = ptr_is_owned(e);
18955 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18956 e_conv = DecodeError_clone(&e_conv);
18957 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18958 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
18959 return tag_ptr(ret_conv, true);
18962 jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint64_t o) {
18963 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
18964 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
18968 void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint64_t _res) {
18969 if (!ptr_is_owned(_res)) return;
18970 void* _res_ptr = untag_ptr(_res);
18971 CHECK_ACCESS(_res_ptr);
18972 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
18973 FREE(untag_ptr(_res));
18974 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
18977 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
18978 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18979 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
18980 return tag_ptr(ret_conv, true);
18982 int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
18983 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
18984 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
18988 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint64_t orig) {
18989 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
18990 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18991 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
18992 return tag_ptr(ret_conv, true);
18995 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok"))) TS_CResult_WarningMessageDecodeErrorZ_ok(uint64_t o) {
18996 LDKWarningMessage o_conv;
18997 o_conv.inner = untag_ptr(o);
18998 o_conv.is_owned = ptr_is_owned(o);
18999 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19000 o_conv = WarningMessage_clone(&o_conv);
19001 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19002 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
19003 return tag_ptr(ret_conv, true);
19006 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
19007 LDKDecodeError e_conv;
19008 e_conv.inner = untag_ptr(e);
19009 e_conv.is_owned = ptr_is_owned(e);
19010 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19011 e_conv = DecodeError_clone(&e_conv);
19012 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19013 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
19014 return tag_ptr(ret_conv, true);
19017 jboolean __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_is_ok"))) TS_CResult_WarningMessageDecodeErrorZ_is_ok(uint64_t o) {
19018 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
19019 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
19023 void __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_free"))) TS_CResult_WarningMessageDecodeErrorZ_free(uint64_t _res) {
19024 if (!ptr_is_owned(_res)) return;
19025 void* _res_ptr = untag_ptr(_res);
19026 CHECK_ACCESS(_res_ptr);
19027 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
19028 FREE(untag_ptr(_res));
19029 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
19032 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
19033 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19034 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
19035 return tag_ptr(ret_conv, true);
19037 int64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone_ptr"))) TS_CResult_WarningMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
19038 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
19039 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
19043 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone"))) TS_CResult_WarningMessageDecodeErrorZ_clone(uint64_t orig) {
19044 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
19045 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19046 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
19047 return tag_ptr(ret_conv, true);
19050 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
19051 LDKUnsignedNodeAnnouncement o_conv;
19052 o_conv.inner = untag_ptr(o);
19053 o_conv.is_owned = ptr_is_owned(o);
19054 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19055 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
19056 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19057 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
19058 return tag_ptr(ret_conv, true);
19061 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
19062 LDKDecodeError e_conv;
19063 e_conv.inner = untag_ptr(e);
19064 e_conv.is_owned = ptr_is_owned(e);
19065 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19066 e_conv = DecodeError_clone(&e_conv);
19067 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19068 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
19069 return tag_ptr(ret_conv, true);
19072 jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19073 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
19074 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
19078 void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
19079 if (!ptr_is_owned(_res)) return;
19080 void* _res_ptr = untag_ptr(_res);
19081 CHECK_ACCESS(_res_ptr);
19082 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
19083 FREE(untag_ptr(_res));
19084 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
19087 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19088 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19089 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
19090 return tag_ptr(ret_conv, true);
19092 int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19093 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
19094 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19098 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19099 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
19100 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19101 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
19102 return tag_ptr(ret_conv, true);
19105 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
19106 LDKNodeAnnouncement o_conv;
19107 o_conv.inner = untag_ptr(o);
19108 o_conv.is_owned = ptr_is_owned(o);
19109 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19110 o_conv = NodeAnnouncement_clone(&o_conv);
19111 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19112 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
19113 return tag_ptr(ret_conv, true);
19116 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
19117 LDKDecodeError e_conv;
19118 e_conv.inner = untag_ptr(e);
19119 e_conv.is_owned = ptr_is_owned(e);
19120 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19121 e_conv = DecodeError_clone(&e_conv);
19122 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19123 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
19124 return tag_ptr(ret_conv, true);
19127 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19128 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
19129 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
19133 void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
19134 if (!ptr_is_owned(_res)) return;
19135 void* _res_ptr = untag_ptr(_res);
19136 CHECK_ACCESS(_res_ptr);
19137 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
19138 FREE(untag_ptr(_res));
19139 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
19142 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19143 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19144 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
19145 return tag_ptr(ret_conv, true);
19147 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19148 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
19149 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19153 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19154 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
19155 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19156 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
19157 return tag_ptr(ret_conv, true);
19160 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint64_t o) {
19161 LDKQueryShortChannelIds o_conv;
19162 o_conv.inner = untag_ptr(o);
19163 o_conv.is_owned = ptr_is_owned(o);
19164 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19165 o_conv = QueryShortChannelIds_clone(&o_conv);
19166 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19167 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
19168 return tag_ptr(ret_conv, true);
19171 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
19172 LDKDecodeError e_conv;
19173 e_conv.inner = untag_ptr(e);
19174 e_conv.is_owned = ptr_is_owned(e);
19175 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19176 e_conv = DecodeError_clone(&e_conv);
19177 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19178 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
19179 return tag_ptr(ret_conv, true);
19182 jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint64_t o) {
19183 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
19184 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
19188 void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint64_t _res) {
19189 if (!ptr_is_owned(_res)) return;
19190 void* _res_ptr = untag_ptr(_res);
19191 CHECK_ACCESS(_res_ptr);
19192 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
19193 FREE(untag_ptr(_res));
19194 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
19197 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
19198 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19199 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
19200 return tag_ptr(ret_conv, true);
19202 int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint64_t arg) {
19203 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
19204 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
19208 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint64_t orig) {
19209 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
19210 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19211 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
19212 return tag_ptr(ret_conv, true);
19215 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint64_t o) {
19216 LDKReplyShortChannelIdsEnd o_conv;
19217 o_conv.inner = untag_ptr(o);
19218 o_conv.is_owned = ptr_is_owned(o);
19219 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19220 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
19221 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19222 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
19223 return tag_ptr(ret_conv, true);
19226 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
19227 LDKDecodeError e_conv;
19228 e_conv.inner = untag_ptr(e);
19229 e_conv.is_owned = ptr_is_owned(e);
19230 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19231 e_conv = DecodeError_clone(&e_conv);
19232 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19233 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
19234 return tag_ptr(ret_conv, true);
19237 jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint64_t o) {
19238 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
19239 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
19243 void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint64_t _res) {
19244 if (!ptr_is_owned(_res)) return;
19245 void* _res_ptr = untag_ptr(_res);
19246 CHECK_ACCESS(_res_ptr);
19247 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
19248 FREE(untag_ptr(_res));
19249 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
19252 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
19253 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19254 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
19255 return tag_ptr(ret_conv, true);
19257 int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint64_t arg) {
19258 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
19259 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
19263 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint64_t orig) {
19264 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
19265 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19266 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
19267 return tag_ptr(ret_conv, true);
19270 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint64_t o) {
19271 LDKQueryChannelRange o_conv;
19272 o_conv.inner = untag_ptr(o);
19273 o_conv.is_owned = ptr_is_owned(o);
19274 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19275 o_conv = QueryChannelRange_clone(&o_conv);
19276 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19277 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
19278 return tag_ptr(ret_conv, true);
19281 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
19282 LDKDecodeError e_conv;
19283 e_conv.inner = untag_ptr(e);
19284 e_conv.is_owned = ptr_is_owned(e);
19285 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19286 e_conv = DecodeError_clone(&e_conv);
19287 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19288 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
19289 return tag_ptr(ret_conv, true);
19292 jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19293 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
19294 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
19298 void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint64_t _res) {
19299 if (!ptr_is_owned(_res)) return;
19300 void* _res_ptr = untag_ptr(_res);
19301 CHECK_ACCESS(_res_ptr);
19302 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
19303 FREE(untag_ptr(_res));
19304 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
19307 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19308 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19309 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
19310 return tag_ptr(ret_conv, true);
19312 int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19313 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
19314 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19318 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19319 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
19320 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19321 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
19322 return tag_ptr(ret_conv, true);
19325 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint64_t o) {
19326 LDKReplyChannelRange o_conv;
19327 o_conv.inner = untag_ptr(o);
19328 o_conv.is_owned = ptr_is_owned(o);
19329 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19330 o_conv = ReplyChannelRange_clone(&o_conv);
19331 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19332 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
19333 return tag_ptr(ret_conv, true);
19336 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
19337 LDKDecodeError e_conv;
19338 e_conv.inner = untag_ptr(e);
19339 e_conv.is_owned = ptr_is_owned(e);
19340 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19341 e_conv = DecodeError_clone(&e_conv);
19342 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19343 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
19344 return tag_ptr(ret_conv, true);
19347 jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19348 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
19349 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
19353 void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint64_t _res) {
19354 if (!ptr_is_owned(_res)) return;
19355 void* _res_ptr = untag_ptr(_res);
19356 CHECK_ACCESS(_res_ptr);
19357 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
19358 FREE(untag_ptr(_res));
19359 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
19362 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19363 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19364 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
19365 return tag_ptr(ret_conv, true);
19367 int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19368 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
19369 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19373 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19374 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
19375 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19376 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
19377 return tag_ptr(ret_conv, true);
19380 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint64_t o) {
19381 LDKGossipTimestampFilter o_conv;
19382 o_conv.inner = untag_ptr(o);
19383 o_conv.is_owned = ptr_is_owned(o);
19384 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19385 o_conv = GossipTimestampFilter_clone(&o_conv);
19386 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19387 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
19388 return tag_ptr(ret_conv, true);
19391 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
19392 LDKDecodeError e_conv;
19393 e_conv.inner = untag_ptr(e);
19394 e_conv.is_owned = ptr_is_owned(e);
19395 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19396 e_conv = DecodeError_clone(&e_conv);
19397 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19398 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
19399 return tag_ptr(ret_conv, true);
19402 jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint64_t o) {
19403 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
19404 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
19408 void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint64_t _res) {
19409 if (!ptr_is_owned(_res)) return;
19410 void* _res_ptr = untag_ptr(_res);
19411 CHECK_ACCESS(_res_ptr);
19412 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
19413 FREE(untag_ptr(_res));
19414 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
19417 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
19418 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19419 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
19420 return tag_ptr(ret_conv, true);
19422 int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint64_t arg) {
19423 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
19424 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
19428 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint64_t orig) {
19429 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
19430 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19431 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
19432 return tag_ptr(ret_conv, true);
19435 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
19437 o_conv.inner = untag_ptr(o);
19438 o_conv.is_owned = ptr_is_owned(o);
19439 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19440 o_conv = Invoice_clone(&o_conv);
19441 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19442 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
19443 return tag_ptr(ret_conv, true);
19446 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) {
19447 void* e_ptr = untag_ptr(e);
19448 CHECK_ACCESS(e_ptr);
19449 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
19450 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
19451 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19452 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
19453 return tag_ptr(ret_conv, true);
19456 jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) {
19457 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
19458 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
19462 void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) {
19463 if (!ptr_is_owned(_res)) return;
19464 void* _res_ptr = untag_ptr(_res);
19465 CHECK_ACCESS(_res_ptr);
19466 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
19467 FREE(untag_ptr(_res));
19468 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
19471 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
19472 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19473 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
19474 return tag_ptr(ret_conv, true);
19476 int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) {
19477 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
19478 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
19482 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) {
19483 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
19484 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19485 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
19486 return tag_ptr(ret_conv, true);
19489 uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) {
19490 void* o_ptr = untag_ptr(o);
19491 CHECK_ACCESS(o_ptr);
19492 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
19493 if (o_conv.free == LDKFilter_JCalls_free) {
19494 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19495 LDKFilter_JCalls_cloned(&o_conv);
19497 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19498 *ret_copy = COption_FilterZ_some(o_conv);
19499 uint64_t ret_ref = tag_ptr(ret_copy, true);
19503 uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() {
19504 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19505 *ret_copy = COption_FilterZ_none();
19506 uint64_t ret_ref = tag_ptr(ret_copy, true);
19510 void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) {
19511 if (!ptr_is_owned(_res)) return;
19512 void* _res_ptr = untag_ptr(_res);
19513 CHECK_ACCESS(_res_ptr);
19514 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
19515 FREE(untag_ptr(_res));
19516 COption_FilterZ_free(_res_conv);
19519 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) {
19520 LDKLockedChannelMonitor o_conv;
19521 o_conv.inner = untag_ptr(o);
19522 o_conv.is_owned = ptr_is_owned(o);
19523 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19524 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
19526 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19527 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
19528 return tag_ptr(ret_conv, true);
19531 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() {
19532 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19533 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
19534 return tag_ptr(ret_conv, true);
19537 jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) {
19538 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
19539 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
19543 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) {
19544 if (!ptr_is_owned(_res)) return;
19545 void* _res_ptr = untag_ptr(_res);
19546 CHECK_ACCESS(_res_ptr);
19547 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
19548 FREE(untag_ptr(_res));
19549 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
19552 void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) {
19553 LDKCVec_OutPointZ _res_constr;
19554 _res_constr.datalen = _res->arr_len;
19555 if (_res_constr.datalen > 0)
19556 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
19558 _res_constr.data = NULL;
19559 uint64_t* _res_vals = _res->elems;
19560 for (size_t k = 0; k < _res_constr.datalen; k++) {
19561 uint64_t _res_conv_10 = _res_vals[k];
19562 LDKOutPoint _res_conv_10_conv;
19563 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
19564 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
19565 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
19566 _res_constr.data[k] = _res_conv_10_conv;
19569 CVec_OutPointZ_free(_res_constr);
19572 void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
19573 if (!ptr_is_owned(this_ptr)) return;
19574 void* this_ptr_ptr = untag_ptr(this_ptr);
19575 CHECK_ACCESS(this_ptr_ptr);
19576 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
19577 FREE(untag_ptr(this_ptr));
19578 PaymentPurpose_free(this_ptr_conv);
19581 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
19582 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19583 *ret_copy = PaymentPurpose_clone(arg);
19584 uint64_t ret_ref = tag_ptr(ret_copy, true);
19587 int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) {
19588 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
19589 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
19593 uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) {
19594 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
19595 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19596 *ret_copy = PaymentPurpose_clone(orig_conv);
19597 uint64_t ret_ref = tag_ptr(ret_copy, true);
19601 uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
19602 LDKThirtyTwoBytes payment_preimage_ref;
19603 CHECK(payment_preimage->arr_len == 32);
19604 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19605 LDKThirtyTwoBytes payment_secret_ref;
19606 CHECK(payment_secret->arr_len == 32);
19607 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
19608 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19609 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
19610 uint64_t ret_ref = tag_ptr(ret_copy, true);
19614 uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
19615 LDKThirtyTwoBytes a_ref;
19616 CHECK(a->arr_len == 32);
19617 memcpy(a_ref.data, a->elems, 32); FREE(a);
19618 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19619 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
19620 uint64_t ret_ref = tag_ptr(ret_copy, true);
19624 int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
19625 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
19626 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
19627 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19628 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19629 CVec_u8Z_free(ret_var);
19633 uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
19634 LDKu8slice ser_ref;
19635 ser_ref.datalen = ser->arr_len;
19636 ser_ref.data = ser->elems;
19637 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19638 *ret_conv = PaymentPurpose_read(ser_ref);
19640 return tag_ptr(ret_conv, true);
19643 void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
19644 if (!ptr_is_owned(this_ptr)) return;
19645 void* this_ptr_ptr = untag_ptr(this_ptr);
19646 CHECK_ACCESS(this_ptr_ptr);
19647 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
19648 FREE(untag_ptr(this_ptr));
19649 ClosureReason_free(this_ptr_conv);
19652 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
19653 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19654 *ret_copy = ClosureReason_clone(arg);
19655 uint64_t ret_ref = tag_ptr(ret_copy, true);
19658 int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) {
19659 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
19660 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
19664 uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) {
19665 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
19666 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19667 *ret_copy = ClosureReason_clone(orig_conv);
19668 uint64_t ret_ref = tag_ptr(ret_copy, true);
19672 uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) {
19673 LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg);
19674 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19675 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
19676 uint64_t ret_ref = tag_ptr(ret_copy, true);
19680 uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() {
19681 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19682 *ret_copy = ClosureReason_holder_force_closed();
19683 uint64_t ret_ref = tag_ptr(ret_copy, true);
19687 uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() {
19688 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19689 *ret_copy = ClosureReason_cooperative_closure();
19690 uint64_t ret_ref = tag_ptr(ret_copy, true);
19694 uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() {
19695 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19696 *ret_copy = ClosureReason_commitment_tx_confirmed();
19697 uint64_t ret_ref = tag_ptr(ret_copy, true);
19701 uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() {
19702 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19703 *ret_copy = ClosureReason_funding_timed_out();
19704 uint64_t ret_ref = tag_ptr(ret_copy, true);
19708 uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) {
19709 LDKStr err_conv = str_ref_to_owned_c(err);
19710 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19711 *ret_copy = ClosureReason_processing_error(err_conv);
19712 uint64_t ret_ref = tag_ptr(ret_copy, true);
19716 uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() {
19717 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19718 *ret_copy = ClosureReason_disconnected_peer();
19719 uint64_t ret_ref = tag_ptr(ret_copy, true);
19723 uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() {
19724 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19725 *ret_copy = ClosureReason_outdated_channel_manager();
19726 uint64_t ret_ref = tag_ptr(ret_copy, true);
19730 int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
19731 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
19732 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
19733 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19734 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19735 CVec_u8Z_free(ret_var);
19739 uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
19740 LDKu8slice ser_ref;
19741 ser_ref.datalen = ser->arr_len;
19742 ser_ref.data = ser->elems;
19743 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19744 *ret_conv = ClosureReason_read(ser_ref);
19746 return tag_ptr(ret_conv, true);
19749 void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_free(uint64_t this_ptr) {
19750 if (!ptr_is_owned(this_ptr)) return;
19751 void* this_ptr_ptr = untag_ptr(this_ptr);
19752 CHECK_ACCESS(this_ptr_ptr);
19753 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
19754 FREE(untag_ptr(this_ptr));
19755 HTLCDestination_free(this_ptr_conv);
19758 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
19759 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19760 *ret_copy = HTLCDestination_clone(arg);
19761 uint64_t ret_ref = tag_ptr(ret_copy, true);
19764 int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) {
19765 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
19766 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
19770 uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) {
19771 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
19772 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19773 *ret_copy = HTLCDestination_clone(orig_conv);
19774 uint64_t ret_ref = tag_ptr(ret_copy, true);
19778 uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) {
19779 LDKPublicKey node_id_ref;
19780 CHECK(node_id->arr_len == 33);
19781 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
19782 LDKThirtyTwoBytes channel_id_ref;
19783 CHECK(channel_id->arr_len == 32);
19784 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
19785 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19786 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
19787 uint64_t ret_ref = tag_ptr(ret_copy, true);
19791 uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) {
19792 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19793 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
19794 uint64_t ret_ref = tag_ptr(ret_copy, true);
19798 uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
19799 LDKThirtyTwoBytes payment_hash_ref;
19800 CHECK(payment_hash->arr_len == 32);
19801 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19802 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19803 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
19804 uint64_t ret_ref = tag_ptr(ret_copy, true);
19808 int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
19809 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
19810 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
19811 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19812 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19813 CVec_u8Z_free(ret_var);
19817 uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) {
19818 LDKu8slice ser_ref;
19819 ser_ref.datalen = ser->arr_len;
19820 ser_ref.data = ser->elems;
19821 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19822 *ret_conv = HTLCDestination_read(ser_ref);
19824 return tag_ptr(ret_conv, true);
19827 void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint64_t this_ptr) {
19828 if (!ptr_is_owned(this_ptr)) return;
19829 void* this_ptr_ptr = untag_ptr(this_ptr);
19830 CHECK_ACCESS(this_ptr_ptr);
19831 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
19832 FREE(untag_ptr(this_ptr));
19833 Event_free(this_ptr_conv);
19836 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
19837 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19838 *ret_copy = Event_clone(arg);
19839 uint64_t ret_ref = tag_ptr(ret_copy, true);
19842 int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) {
19843 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
19844 int64_t ret_conv = Event_clone_ptr(arg_conv);
19848 uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) {
19849 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
19850 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19851 *ret_copy = Event_clone(orig_conv);
19852 uint64_t ret_ref = tag_ptr(ret_copy, true);
19856 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) {
19857 LDKThirtyTwoBytes temporary_channel_id_ref;
19858 CHECK(temporary_channel_id->arr_len == 32);
19859 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
19860 LDKPublicKey counterparty_node_id_ref;
19861 CHECK(counterparty_node_id->arr_len == 33);
19862 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
19863 LDKCVec_u8Z output_script_ref;
19864 output_script_ref.datalen = output_script->arr_len;
19865 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
19866 memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
19867 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19868 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
19869 uint64_t ret_ref = tag_ptr(ret_copy, true);
19873 uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19874 LDKThirtyTwoBytes payment_hash_ref;
19875 CHECK(payment_hash->arr_len == 32);
19876 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19877 void* purpose_ptr = untag_ptr(purpose);
19878 CHECK_ACCESS(purpose_ptr);
19879 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19880 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19881 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19882 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
19883 uint64_t ret_ref = tag_ptr(ret_copy, true);
19887 uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19888 LDKThirtyTwoBytes payment_hash_ref;
19889 CHECK(payment_hash->arr_len == 32);
19890 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19891 void* purpose_ptr = untag_ptr(purpose);
19892 CHECK_ACCESS(purpose_ptr);
19893 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19894 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19895 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19896 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
19897 uint64_t ret_ref = tag_ptr(ret_copy, true);
19901 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) {
19902 LDKThirtyTwoBytes payment_id_ref;
19903 CHECK(payment_id->arr_len == 32);
19904 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19905 LDKThirtyTwoBytes payment_preimage_ref;
19906 CHECK(payment_preimage->arr_len == 32);
19907 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19908 LDKThirtyTwoBytes payment_hash_ref;
19909 CHECK(payment_hash->arr_len == 32);
19910 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19911 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
19912 CHECK_ACCESS(fee_paid_msat_ptr);
19913 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
19914 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
19915 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19916 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
19917 uint64_t ret_ref = tag_ptr(ret_copy, true);
19921 uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
19922 LDKThirtyTwoBytes payment_id_ref;
19923 CHECK(payment_id->arr_len == 32);
19924 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19925 LDKThirtyTwoBytes payment_hash_ref;
19926 CHECK(payment_hash->arr_len == 32);
19927 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19928 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19929 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
19930 uint64_t ret_ref = tag_ptr(ret_copy, true);
19934 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) {
19935 LDKThirtyTwoBytes payment_id_ref;
19936 CHECK(payment_id->arr_len == 32);
19937 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19938 LDKThirtyTwoBytes payment_hash_ref;
19939 CHECK(payment_hash->arr_len == 32);
19940 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19941 LDKCVec_RouteHopZ path_constr;
19942 path_constr.datalen = path->arr_len;
19943 if (path_constr.datalen > 0)
19944 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19946 path_constr.data = NULL;
19947 uint64_t* path_vals = path->elems;
19948 for (size_t k = 0; k < path_constr.datalen; k++) {
19949 uint64_t path_conv_10 = path_vals[k];
19950 LDKRouteHop path_conv_10_conv;
19951 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19952 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19953 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19954 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19955 path_constr.data[k] = path_conv_10_conv;
19958 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19959 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
19960 uint64_t ret_ref = tag_ptr(ret_copy, true);
19964 uint64_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, uint64_t network_update, jboolean all_paths_failed, uint64_tArray path, uint64_t short_channel_id, uint64_t retry) {
19965 LDKThirtyTwoBytes payment_id_ref;
19966 CHECK(payment_id->arr_len == 32);
19967 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19968 LDKThirtyTwoBytes payment_hash_ref;
19969 CHECK(payment_hash->arr_len == 32);
19970 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19971 void* network_update_ptr = untag_ptr(network_update);
19972 CHECK_ACCESS(network_update_ptr);
19973 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
19974 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
19975 LDKCVec_RouteHopZ path_constr;
19976 path_constr.datalen = path->arr_len;
19977 if (path_constr.datalen > 0)
19978 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19980 path_constr.data = NULL;
19981 uint64_t* path_vals = path->elems;
19982 for (size_t k = 0; k < path_constr.datalen; k++) {
19983 uint64_t path_conv_10 = path_vals[k];
19984 LDKRouteHop path_conv_10_conv;
19985 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19986 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19987 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19988 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19989 path_constr.data[k] = path_conv_10_conv;
19992 void* short_channel_id_ptr = untag_ptr(short_channel_id);
19993 CHECK_ACCESS(short_channel_id_ptr);
19994 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
19995 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
19996 LDKRouteParameters retry_conv;
19997 retry_conv.inner = untag_ptr(retry);
19998 retry_conv.is_owned = ptr_is_owned(retry);
19999 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
20000 retry_conv = RouteParameters_clone(&retry_conv);
20001 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20002 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
20003 uint64_t ret_ref = tag_ptr(ret_copy, true);
20007 uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
20008 LDKThirtyTwoBytes payment_id_ref;
20009 CHECK(payment_id->arr_len == 32);
20010 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
20011 LDKThirtyTwoBytes payment_hash_ref;
20012 CHECK(payment_hash->arr_len == 32);
20013 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20014 LDKCVec_RouteHopZ path_constr;
20015 path_constr.datalen = path->arr_len;
20016 if (path_constr.datalen > 0)
20017 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
20019 path_constr.data = NULL;
20020 uint64_t* path_vals = path->elems;
20021 for (size_t k = 0; k < path_constr.datalen; k++) {
20022 uint64_t path_conv_10 = path_vals[k];
20023 LDKRouteHop path_conv_10_conv;
20024 path_conv_10_conv.inner = untag_ptr(path_conv_10);
20025 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
20026 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
20027 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
20028 path_constr.data[k] = path_conv_10_conv;
20031 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20032 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
20033 uint64_t ret_ref = tag_ptr(ret_copy, true);
20037 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) {
20038 LDKThirtyTwoBytes payment_id_ref;
20039 CHECK(payment_id->arr_len == 32);
20040 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
20041 LDKThirtyTwoBytes payment_hash_ref;
20042 CHECK(payment_hash->arr_len == 32);
20043 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20044 LDKCVec_RouteHopZ path_constr;
20045 path_constr.datalen = path->arr_len;
20046 if (path_constr.datalen > 0)
20047 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
20049 path_constr.data = NULL;
20050 uint64_t* path_vals = path->elems;
20051 for (size_t k = 0; k < path_constr.datalen; k++) {
20052 uint64_t path_conv_10 = path_vals[k];
20053 LDKRouteHop path_conv_10_conv;
20054 path_conv_10_conv.inner = untag_ptr(path_conv_10);
20055 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
20056 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
20057 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
20058 path_constr.data[k] = path_conv_10_conv;
20061 void* short_channel_id_ptr = untag_ptr(short_channel_id);
20062 CHECK_ACCESS(short_channel_id_ptr);
20063 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
20064 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
20065 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20066 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
20067 uint64_t ret_ref = tag_ptr(ret_copy, true);
20071 uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
20072 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20073 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
20074 uint64_t ret_ref = tag_ptr(ret_copy, true);
20078 uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
20079 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
20080 outputs_constr.datalen = outputs->arr_len;
20081 if (outputs_constr.datalen > 0)
20082 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
20084 outputs_constr.data = NULL;
20085 uint64_t* outputs_vals = outputs->elems;
20086 for (size_t b = 0; b < outputs_constr.datalen; b++) {
20087 uint64_t outputs_conv_27 = outputs_vals[b];
20088 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
20089 CHECK_ACCESS(outputs_conv_27_ptr);
20090 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
20091 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
20092 outputs_constr.data[b] = outputs_conv_27_conv;
20095 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20096 *ret_copy = Event_spendable_outputs(outputs_constr);
20097 uint64_t ret_ref = tag_ptr(ret_copy, true);
20101 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) {
20102 LDKThirtyTwoBytes prev_channel_id_ref;
20103 CHECK(prev_channel_id->arr_len == 32);
20104 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
20105 LDKThirtyTwoBytes next_channel_id_ref;
20106 CHECK(next_channel_id->arr_len == 32);
20107 memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id);
20108 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
20109 CHECK_ACCESS(fee_earned_msat_ptr);
20110 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
20111 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
20112 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20113 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
20114 uint64_t ret_ref = tag_ptr(ret_copy, true);
20118 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) {
20119 LDKThirtyTwoBytes channel_id_ref;
20120 CHECK(channel_id->arr_len == 32);
20121 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
20122 void* reason_ptr = untag_ptr(reason);
20123 CHECK_ACCESS(reason_ptr);
20124 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
20125 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
20126 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20127 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
20128 uint64_t ret_ref = tag_ptr(ret_copy, true);
20132 uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) {
20133 LDKThirtyTwoBytes channel_id_ref;
20134 CHECK(channel_id->arr_len == 32);
20135 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
20136 LDKTransaction transaction_ref;
20137 transaction_ref.datalen = transaction->arr_len;
20138 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
20139 memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction);
20140 transaction_ref.data_is_owned = true;
20141 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20142 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
20143 uint64_t ret_ref = tag_ptr(ret_copy, true);
20147 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) {
20148 LDKThirtyTwoBytes temporary_channel_id_ref;
20149 CHECK(temporary_channel_id->arr_len == 32);
20150 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
20151 LDKPublicKey counterparty_node_id_ref;
20152 CHECK(counterparty_node_id->arr_len == 33);
20153 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
20154 LDKChannelTypeFeatures channel_type_conv;
20155 channel_type_conv.inner = untag_ptr(channel_type);
20156 channel_type_conv.is_owned = ptr_is_owned(channel_type);
20157 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
20158 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
20159 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20160 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
20161 uint64_t ret_ref = tag_ptr(ret_copy, true);
20165 uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) {
20166 LDKThirtyTwoBytes prev_channel_id_ref;
20167 CHECK(prev_channel_id->arr_len == 32);
20168 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
20169 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
20170 CHECK_ACCESS(failed_next_destination_ptr);
20171 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
20172 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
20173 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20174 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
20175 uint64_t ret_ref = tag_ptr(ret_copy, true);
20179 int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
20180 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
20181 LDKCVec_u8Z ret_var = Event_write(obj_conv);
20182 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20183 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20184 CVec_u8Z_free(ret_var);
20188 uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
20189 LDKu8slice ser_ref;
20190 ser_ref.datalen = ser->arr_len;
20191 ser_ref.data = ser->elems;
20192 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
20193 *ret_conv = Event_read(ser_ref);
20195 return tag_ptr(ret_conv, true);
20198 void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint64_t this_ptr) {
20199 if (!ptr_is_owned(this_ptr)) return;
20200 void* this_ptr_ptr = untag_ptr(this_ptr);
20201 CHECK_ACCESS(this_ptr_ptr);
20202 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
20203 FREE(untag_ptr(this_ptr));
20204 MessageSendEvent_free(this_ptr_conv);
20207 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
20208 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20209 *ret_copy = MessageSendEvent_clone(arg);
20210 uint64_t ret_ref = tag_ptr(ret_copy, true);
20213 int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) {
20214 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
20215 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
20219 uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) {
20220 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
20221 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20222 *ret_copy = MessageSendEvent_clone(orig_conv);
20223 uint64_t ret_ref = tag_ptr(ret_copy, true);
20227 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) {
20228 LDKPublicKey node_id_ref;
20229 CHECK(node_id->arr_len == 33);
20230 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20231 LDKAcceptChannel msg_conv;
20232 msg_conv.inner = untag_ptr(msg);
20233 msg_conv.is_owned = ptr_is_owned(msg);
20234 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20235 msg_conv = AcceptChannel_clone(&msg_conv);
20236 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20237 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
20238 uint64_t ret_ref = tag_ptr(ret_copy, true);
20242 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) {
20243 LDKPublicKey node_id_ref;
20244 CHECK(node_id->arr_len == 33);
20245 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20246 LDKOpenChannel msg_conv;
20247 msg_conv.inner = untag_ptr(msg);
20248 msg_conv.is_owned = ptr_is_owned(msg);
20249 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20250 msg_conv = OpenChannel_clone(&msg_conv);
20251 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20252 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
20253 uint64_t ret_ref = tag_ptr(ret_copy, true);
20257 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) {
20258 LDKPublicKey node_id_ref;
20259 CHECK(node_id->arr_len == 33);
20260 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20261 LDKFundingCreated msg_conv;
20262 msg_conv.inner = untag_ptr(msg);
20263 msg_conv.is_owned = ptr_is_owned(msg);
20264 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20265 msg_conv = FundingCreated_clone(&msg_conv);
20266 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20267 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
20268 uint64_t ret_ref = tag_ptr(ret_copy, true);
20272 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) {
20273 LDKPublicKey node_id_ref;
20274 CHECK(node_id->arr_len == 33);
20275 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20276 LDKFundingSigned msg_conv;
20277 msg_conv.inner = untag_ptr(msg);
20278 msg_conv.is_owned = ptr_is_owned(msg);
20279 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20280 msg_conv = FundingSigned_clone(&msg_conv);
20281 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20282 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
20283 uint64_t ret_ref = tag_ptr(ret_copy, true);
20287 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) {
20288 LDKPublicKey node_id_ref;
20289 CHECK(node_id->arr_len == 33);
20290 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20291 LDKChannelReady msg_conv;
20292 msg_conv.inner = untag_ptr(msg);
20293 msg_conv.is_owned = ptr_is_owned(msg);
20294 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20295 msg_conv = ChannelReady_clone(&msg_conv);
20296 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20297 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
20298 uint64_t ret_ref = tag_ptr(ret_copy, true);
20302 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) {
20303 LDKPublicKey node_id_ref;
20304 CHECK(node_id->arr_len == 33);
20305 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20306 LDKAnnouncementSignatures msg_conv;
20307 msg_conv.inner = untag_ptr(msg);
20308 msg_conv.is_owned = ptr_is_owned(msg);
20309 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20310 msg_conv = AnnouncementSignatures_clone(&msg_conv);
20311 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20312 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
20313 uint64_t ret_ref = tag_ptr(ret_copy, true);
20317 uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) {
20318 LDKPublicKey node_id_ref;
20319 CHECK(node_id->arr_len == 33);
20320 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20321 LDKCommitmentUpdate updates_conv;
20322 updates_conv.inner = untag_ptr(updates);
20323 updates_conv.is_owned = ptr_is_owned(updates);
20324 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
20325 updates_conv = CommitmentUpdate_clone(&updates_conv);
20326 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20327 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
20328 uint64_t ret_ref = tag_ptr(ret_copy, true);
20332 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) {
20333 LDKPublicKey node_id_ref;
20334 CHECK(node_id->arr_len == 33);
20335 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20336 LDKRevokeAndACK msg_conv;
20337 msg_conv.inner = untag_ptr(msg);
20338 msg_conv.is_owned = ptr_is_owned(msg);
20339 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20340 msg_conv = RevokeAndACK_clone(&msg_conv);
20341 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20342 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
20343 uint64_t ret_ref = tag_ptr(ret_copy, true);
20347 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) {
20348 LDKPublicKey node_id_ref;
20349 CHECK(node_id->arr_len == 33);
20350 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20351 LDKClosingSigned msg_conv;
20352 msg_conv.inner = untag_ptr(msg);
20353 msg_conv.is_owned = ptr_is_owned(msg);
20354 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20355 msg_conv = ClosingSigned_clone(&msg_conv);
20356 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20357 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
20358 uint64_t ret_ref = tag_ptr(ret_copy, true);
20362 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) {
20363 LDKPublicKey node_id_ref;
20364 CHECK(node_id->arr_len == 33);
20365 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20366 LDKShutdown msg_conv;
20367 msg_conv.inner = untag_ptr(msg);
20368 msg_conv.is_owned = ptr_is_owned(msg);
20369 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20370 msg_conv = Shutdown_clone(&msg_conv);
20371 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20372 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
20373 uint64_t ret_ref = tag_ptr(ret_copy, true);
20377 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) {
20378 LDKPublicKey node_id_ref;
20379 CHECK(node_id->arr_len == 33);
20380 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20381 LDKChannelReestablish msg_conv;
20382 msg_conv.inner = untag_ptr(msg);
20383 msg_conv.is_owned = ptr_is_owned(msg);
20384 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20385 msg_conv = ChannelReestablish_clone(&msg_conv);
20386 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20387 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
20388 uint64_t ret_ref = tag_ptr(ret_copy, true);
20392 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
20393 LDKChannelAnnouncement msg_conv;
20394 msg_conv.inner = untag_ptr(msg);
20395 msg_conv.is_owned = ptr_is_owned(msg);
20396 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20397 msg_conv = ChannelAnnouncement_clone(&msg_conv);
20398 LDKChannelUpdate update_msg_conv;
20399 update_msg_conv.inner = untag_ptr(update_msg);
20400 update_msg_conv.is_owned = ptr_is_owned(update_msg);
20401 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
20402 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
20403 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20404 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
20405 uint64_t ret_ref = tag_ptr(ret_copy, true);
20409 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announcement"))) TS_MessageSendEvent_broadcast_node_announcement(uint64_t msg) {
20410 LDKNodeAnnouncement msg_conv;
20411 msg_conv.inner = untag_ptr(msg);
20412 msg_conv.is_owned = ptr_is_owned(msg);
20413 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20414 msg_conv = NodeAnnouncement_clone(&msg_conv);
20415 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20416 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
20417 uint64_t ret_ref = tag_ptr(ret_copy, true);
20421 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) {
20422 LDKChannelUpdate msg_conv;
20423 msg_conv.inner = untag_ptr(msg);
20424 msg_conv.is_owned = ptr_is_owned(msg);
20425 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20426 msg_conv = ChannelUpdate_clone(&msg_conv);
20427 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20428 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
20429 uint64_t ret_ref = tag_ptr(ret_copy, true);
20433 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
20434 LDKPublicKey node_id_ref;
20435 CHECK(node_id->arr_len == 33);
20436 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20437 LDKChannelUpdate msg_conv;
20438 msg_conv.inner = untag_ptr(msg);
20439 msg_conv.is_owned = ptr_is_owned(msg);
20440 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20441 msg_conv = ChannelUpdate_clone(&msg_conv);
20442 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20443 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
20444 uint64_t ret_ref = tag_ptr(ret_copy, true);
20448 uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) {
20449 LDKPublicKey node_id_ref;
20450 CHECK(node_id->arr_len == 33);
20451 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20452 void* action_ptr = untag_ptr(action);
20453 CHECK_ACCESS(action_ptr);
20454 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
20455 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
20456 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20457 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
20458 uint64_t ret_ref = tag_ptr(ret_copy, true);
20462 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) {
20463 LDKPublicKey node_id_ref;
20464 CHECK(node_id->arr_len == 33);
20465 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20466 LDKQueryChannelRange msg_conv;
20467 msg_conv.inner = untag_ptr(msg);
20468 msg_conv.is_owned = ptr_is_owned(msg);
20469 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20470 msg_conv = QueryChannelRange_clone(&msg_conv);
20471 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20472 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
20473 uint64_t ret_ref = tag_ptr(ret_copy, true);
20477 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) {
20478 LDKPublicKey node_id_ref;
20479 CHECK(node_id->arr_len == 33);
20480 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20481 LDKQueryShortChannelIds msg_conv;
20482 msg_conv.inner = untag_ptr(msg);
20483 msg_conv.is_owned = ptr_is_owned(msg);
20484 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20485 msg_conv = QueryShortChannelIds_clone(&msg_conv);
20486 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20487 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
20488 uint64_t ret_ref = tag_ptr(ret_copy, true);
20492 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) {
20493 LDKPublicKey node_id_ref;
20494 CHECK(node_id->arr_len == 33);
20495 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20496 LDKReplyChannelRange msg_conv;
20497 msg_conv.inner = untag_ptr(msg);
20498 msg_conv.is_owned = ptr_is_owned(msg);
20499 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20500 msg_conv = ReplyChannelRange_clone(&msg_conv);
20501 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20502 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
20503 uint64_t ret_ref = tag_ptr(ret_copy, true);
20507 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) {
20508 LDKPublicKey node_id_ref;
20509 CHECK(node_id->arr_len == 33);
20510 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20511 LDKGossipTimestampFilter msg_conv;
20512 msg_conv.inner = untag_ptr(msg);
20513 msg_conv.is_owned = ptr_is_owned(msg);
20514 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20515 msg_conv = GossipTimestampFilter_clone(&msg_conv);
20516 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20517 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
20518 uint64_t ret_ref = tag_ptr(ret_copy, true);
20522 void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint64_t this_ptr) {
20523 if (!ptr_is_owned(this_ptr)) return;
20524 void* this_ptr_ptr = untag_ptr(this_ptr);
20525 CHECK_ACCESS(this_ptr_ptr);
20526 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
20527 FREE(untag_ptr(this_ptr));
20528 MessageSendEventsProvider_free(this_ptr_conv);
20531 void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
20532 if (!ptr_is_owned(this_ptr)) return;
20533 void* this_ptr_ptr = untag_ptr(this_ptr);
20534 CHECK_ACCESS(this_ptr_ptr);
20535 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
20536 FREE(untag_ptr(this_ptr));
20537 EventsProvider_free(this_ptr_conv);
20540 void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint64_t this_ptr) {
20541 if (!ptr_is_owned(this_ptr)) return;
20542 void* this_ptr_ptr = untag_ptr(this_ptr);
20543 CHECK_ACCESS(this_ptr_ptr);
20544 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
20545 FREE(untag_ptr(this_ptr));
20546 EventHandler_free(this_ptr_conv);
20549 void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) {
20550 if (!ptr_is_owned(this_ptr)) return;
20551 void* this_ptr_ptr = untag_ptr(this_ptr);
20552 CHECK_ACCESS(this_ptr_ptr);
20553 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
20554 FREE(untag_ptr(this_ptr));
20555 APIError_free(this_ptr_conv);
20558 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
20559 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20560 *ret_copy = APIError_clone(arg);
20561 uint64_t ret_ref = tag_ptr(ret_copy, true);
20564 int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) {
20565 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
20566 int64_t ret_conv = APIError_clone_ptr(arg_conv);
20570 uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) {
20571 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
20572 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20573 *ret_copy = APIError_clone(orig_conv);
20574 uint64_t ret_ref = tag_ptr(ret_copy, true);
20578 uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) {
20579 LDKStr err_conv = str_ref_to_owned_c(err);
20580 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20581 *ret_copy = APIError_apimisuse_error(err_conv);
20582 uint64_t ret_ref = tag_ptr(ret_copy, true);
20586 uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
20587 LDKStr err_conv = str_ref_to_owned_c(err);
20588 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20589 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
20590 uint64_t ret_ref = tag_ptr(ret_copy, true);
20594 uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
20595 LDKStr err_conv = str_ref_to_owned_c(err);
20596 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20597 *ret_copy = APIError_route_error(err_conv);
20598 uint64_t ret_ref = tag_ptr(ret_copy, true);
20602 uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) {
20603 LDKStr err_conv = str_ref_to_owned_c(err);
20604 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20605 *ret_copy = APIError_channel_unavailable(err_conv);
20606 uint64_t ret_ref = tag_ptr(ret_copy, true);
20610 uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() {
20611 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20612 *ret_copy = APIError_monitor_update_failed();
20613 uint64_t ret_ref = tag_ptr(ret_copy, true);
20617 uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) {
20618 LDKShutdownScript script_conv;
20619 script_conv.inner = untag_ptr(script);
20620 script_conv.is_owned = ptr_is_owned(script);
20621 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
20622 script_conv = ShutdownScript_clone(&script_conv);
20623 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20624 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
20625 uint64_t ret_ref = tag_ptr(ret_copy, true);
20629 void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
20630 LDKBigSize this_obj_conv;
20631 this_obj_conv.inner = untag_ptr(this_obj);
20632 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20634 BigSize_free(this_obj_conv);
20637 int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) {
20638 LDKBigSize this_ptr_conv;
20639 this_ptr_conv.inner = untag_ptr(this_ptr);
20640 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20642 this_ptr_conv.is_owned = false;
20643 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
20647 void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) {
20648 LDKBigSize this_ptr_conv;
20649 this_ptr_conv.inner = untag_ptr(this_ptr);
20650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20652 this_ptr_conv.is_owned = false;
20653 BigSize_set_a(&this_ptr_conv, val);
20656 uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) {
20657 LDKBigSize ret_var = BigSize_new(a_arg);
20658 uint64_t ret_ref = 0;
20659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20664 void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) {
20665 LDKHostname this_obj_conv;
20666 this_obj_conv.inner = untag_ptr(this_obj);
20667 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20669 Hostname_free(this_obj_conv);
20672 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
20673 LDKHostname ret_var = Hostname_clone(arg);
20674 uint64_t ret_ref = 0;
20675 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20676 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20679 int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) {
20680 LDKHostname arg_conv;
20681 arg_conv.inner = untag_ptr(arg);
20682 arg_conv.is_owned = ptr_is_owned(arg);
20683 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20684 arg_conv.is_owned = false;
20685 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
20689 uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) {
20690 LDKHostname orig_conv;
20691 orig_conv.inner = untag_ptr(orig);
20692 orig_conv.is_owned = ptr_is_owned(orig);
20693 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20694 orig_conv.is_owned = false;
20695 LDKHostname ret_var = Hostname_clone(&orig_conv);
20696 uint64_t ret_ref = 0;
20697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20702 int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
20703 LDKHostname this_arg_conv;
20704 this_arg_conv.inner = untag_ptr(this_arg);
20705 this_arg_conv.is_owned = ptr_is_owned(this_arg);
20706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
20707 this_arg_conv.is_owned = false;
20708 int8_t ret_conv = Hostname_len(&this_arg_conv);
20712 uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
20713 LDKu8slice msg_ref;
20714 msg_ref.datalen = msg->arr_len;
20715 msg_ref.data = msg->elems;
20716 unsigned char sk_arr[32];
20717 CHECK(sk->arr_len == 32);
20718 memcpy(sk_arr, sk->elems, 32); FREE(sk);
20719 unsigned char (*sk_ref)[32] = &sk_arr;
20720 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
20721 *ret_conv = sign(msg_ref, sk_ref);
20723 return tag_ptr(ret_conv, true);
20726 uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
20727 LDKu8slice msg_ref;
20728 msg_ref.datalen = msg->arr_len;
20729 msg_ref.data = msg->elems;
20730 LDKStr sig_conv = str_ref_to_owned_c(sig);
20731 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
20732 *ret_conv = recover_pk(msg_ref, sig_conv);
20734 return tag_ptr(ret_conv, true);
20737 jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
20738 LDKu8slice msg_ref;
20739 msg_ref.datalen = msg->arr_len;
20740 msg_ref.data = msg->elems;
20741 LDKStr sig_conv = str_ref_to_owned_c(sig);
20742 LDKPublicKey pk_ref;
20743 CHECK(pk->arr_len == 33);
20744 memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
20745 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
20750 int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
20751 LDKu8slice hrp_bytes_ref;
20752 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
20753 hrp_bytes_ref.data = hrp_bytes->elems;
20754 LDKCVec_u5Z data_without_signature_constr;
20755 data_without_signature_constr.datalen = data_without_signature->arr_len;
20756 if (data_without_signature_constr.datalen > 0)
20757 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
20759 data_without_signature_constr.data = NULL;
20760 int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
20761 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
20762 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
20764 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
20766 FREE(data_without_signature);
20767 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
20768 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20769 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20770 CVec_u8Z_free(ret_var);
20775 void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64_t this_ptr) {
20776 if (!ptr_is_owned(this_ptr)) return;
20777 void* this_ptr_ptr = untag_ptr(this_ptr);
20778 CHECK_ACCESS(this_ptr_ptr);
20779 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
20780 FREE(untag_ptr(this_ptr));
20781 Persister_free(this_ptr_conv);
20784 uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
20785 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
20786 uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
20790 uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() {
20791 uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
20795 uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() {
20796 uint32_t ret_conv = LDKLevel_to_js(Level_trace());
20800 uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() {
20801 uint32_t ret_conv = LDKLevel_to_js(Level_debug());
20805 uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() {
20806 uint32_t ret_conv = LDKLevel_to_js(Level_info());
20810 uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() {
20811 uint32_t ret_conv = LDKLevel_to_js(Level_warn());
20815 uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() {
20816 uint32_t ret_conv = LDKLevel_to_js(Level_error());
20820 jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) {
20821 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
20822 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
20823 jboolean ret_conv = Level_eq(a_conv, b_conv);
20827 int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) {
20828 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
20829 int64_t ret_conv = Level_hash(o_conv);
20833 uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() {
20834 uint32_t ret_conv = LDKLevel_to_js(Level_max());
20838 void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) {
20839 LDKRecord this_obj_conv;
20840 this_obj_conv.inner = untag_ptr(this_obj);
20841 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20842 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20843 Record_free(this_obj_conv);
20846 uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) {
20847 LDKRecord this_ptr_conv;
20848 this_ptr_conv.inner = untag_ptr(this_ptr);
20849 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20851 this_ptr_conv.is_owned = false;
20852 uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv));
20856 void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) {
20857 LDKRecord this_ptr_conv;
20858 this_ptr_conv.inner = untag_ptr(this_ptr);
20859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20861 this_ptr_conv.is_owned = false;
20862 LDKLevel val_conv = LDKLevel_from_js(val);
20863 Record_set_level(&this_ptr_conv, val_conv);
20866 jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) {
20867 LDKRecord this_ptr_conv;
20868 this_ptr_conv.inner = untag_ptr(this_ptr);
20869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20871 this_ptr_conv.is_owned = false;
20872 LDKStr ret_str = Record_get_args(&this_ptr_conv);
20873 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20878 void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) {
20879 LDKRecord this_ptr_conv;
20880 this_ptr_conv.inner = untag_ptr(this_ptr);
20881 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20883 this_ptr_conv.is_owned = false;
20884 LDKStr val_conv = str_ref_to_owned_c(val);
20885 Record_set_args(&this_ptr_conv, val_conv);
20888 jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) {
20889 LDKRecord this_ptr_conv;
20890 this_ptr_conv.inner = untag_ptr(this_ptr);
20891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20893 this_ptr_conv.is_owned = false;
20894 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
20895 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20900 void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) {
20901 LDKRecord this_ptr_conv;
20902 this_ptr_conv.inner = untag_ptr(this_ptr);
20903 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20905 this_ptr_conv.is_owned = false;
20906 LDKStr val_conv = str_ref_to_owned_c(val);
20907 Record_set_module_path(&this_ptr_conv, val_conv);
20910 jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) {
20911 LDKRecord this_ptr_conv;
20912 this_ptr_conv.inner = untag_ptr(this_ptr);
20913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20915 this_ptr_conv.is_owned = false;
20916 LDKStr ret_str = Record_get_file(&this_ptr_conv);
20917 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20922 void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) {
20923 LDKRecord this_ptr_conv;
20924 this_ptr_conv.inner = untag_ptr(this_ptr);
20925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20927 this_ptr_conv.is_owned = false;
20928 LDKStr val_conv = str_ref_to_owned_c(val);
20929 Record_set_file(&this_ptr_conv, val_conv);
20932 int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) {
20933 LDKRecord this_ptr_conv;
20934 this_ptr_conv.inner = untag_ptr(this_ptr);
20935 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20937 this_ptr_conv.is_owned = false;
20938 int32_t ret_conv = Record_get_line(&this_ptr_conv);
20942 void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) {
20943 LDKRecord this_ptr_conv;
20944 this_ptr_conv.inner = untag_ptr(this_ptr);
20945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20947 this_ptr_conv.is_owned = false;
20948 Record_set_line(&this_ptr_conv, val);
20951 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
20952 LDKRecord ret_var = Record_clone(arg);
20953 uint64_t ret_ref = 0;
20954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20955 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20958 int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) {
20959 LDKRecord arg_conv;
20960 arg_conv.inner = untag_ptr(arg);
20961 arg_conv.is_owned = ptr_is_owned(arg);
20962 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20963 arg_conv.is_owned = false;
20964 int64_t ret_conv = Record_clone_ptr(&arg_conv);
20968 uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) {
20969 LDKRecord orig_conv;
20970 orig_conv.inner = untag_ptr(orig);
20971 orig_conv.is_owned = ptr_is_owned(orig);
20972 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20973 orig_conv.is_owned = false;
20974 LDKRecord ret_var = Record_clone(&orig_conv);
20975 uint64_t ret_ref = 0;
20976 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20977 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20981 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint64_t this_ptr) {
20982 if (!ptr_is_owned(this_ptr)) return;
20983 void* this_ptr_ptr = untag_ptr(this_ptr);
20984 CHECK_ACCESS(this_ptr_ptr);
20985 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
20986 FREE(untag_ptr(this_ptr));
20987 Logger_free(this_ptr_conv);
20990 void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) {
20991 LDKChannelHandshakeConfig this_obj_conv;
20992 this_obj_conv.inner = untag_ptr(this_obj);
20993 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20995 ChannelHandshakeConfig_free(this_obj_conv);
20998 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) {
20999 LDKChannelHandshakeConfig this_ptr_conv;
21000 this_ptr_conv.inner = untag_ptr(this_ptr);
21001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21003 this_ptr_conv.is_owned = false;
21004 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
21008 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) {
21009 LDKChannelHandshakeConfig this_ptr_conv;
21010 this_ptr_conv.inner = untag_ptr(this_ptr);
21011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21013 this_ptr_conv.is_owned = false;
21014 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
21017 int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(uint64_t this_ptr) {
21018 LDKChannelHandshakeConfig this_ptr_conv;
21019 this_ptr_conv.inner = untag_ptr(this_ptr);
21020 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21022 this_ptr_conv.is_owned = false;
21023 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
21027 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) {
21028 LDKChannelHandshakeConfig this_ptr_conv;
21029 this_ptr_conv.inner = untag_ptr(this_ptr);
21030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21032 this_ptr_conv.is_owned = false;
21033 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
21036 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint64_t this_ptr) {
21037 LDKChannelHandshakeConfig this_ptr_conv;
21038 this_ptr_conv.inner = untag_ptr(this_ptr);
21039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21041 this_ptr_conv.is_owned = false;
21042 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
21046 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) {
21047 LDKChannelHandshakeConfig this_ptr_conv;
21048 this_ptr_conv.inner = untag_ptr(this_ptr);
21049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21051 this_ptr_conv.is_owned = false;
21052 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
21055 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) {
21056 LDKChannelHandshakeConfig this_ptr_conv;
21057 this_ptr_conv.inner = untag_ptr(this_ptr);
21058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21060 this_ptr_conv.is_owned = false;
21061 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
21065 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) {
21066 LDKChannelHandshakeConfig this_ptr_conv;
21067 this_ptr_conv.inner = untag_ptr(this_ptr);
21068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21070 this_ptr_conv.is_owned = false;
21071 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
21074 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(uint64_t this_ptr) {
21075 LDKChannelHandshakeConfig this_ptr_conv;
21076 this_ptr_conv.inner = untag_ptr(this_ptr);
21077 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21078 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21079 this_ptr_conv.is_owned = false;
21080 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
21084 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean val) {
21085 LDKChannelHandshakeConfig this_ptr_conv;
21086 this_ptr_conv.inner = untag_ptr(this_ptr);
21087 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21089 this_ptr_conv.is_owned = false;
21090 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
21093 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(uint64_t this_ptr) {
21094 LDKChannelHandshakeConfig this_ptr_conv;
21095 this_ptr_conv.inner = untag_ptr(this_ptr);
21096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21098 this_ptr_conv.is_owned = false;
21099 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
21103 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean val) {
21104 LDKChannelHandshakeConfig this_ptr_conv;
21105 this_ptr_conv.inner = untag_ptr(this_ptr);
21106 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21108 this_ptr_conv.is_owned = false;
21109 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
21112 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(uint64_t this_ptr) {
21113 LDKChannelHandshakeConfig this_ptr_conv;
21114 this_ptr_conv.inner = untag_ptr(this_ptr);
21115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21117 this_ptr_conv.is_owned = false;
21118 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
21122 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean val) {
21123 LDKChannelHandshakeConfig this_ptr_conv;
21124 this_ptr_conv.inner = untag_ptr(this_ptr);
21125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21127 this_ptr_conv.is_owned = false;
21128 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
21131 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) {
21132 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);
21133 uint64_t ret_ref = 0;
21134 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21135 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21139 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
21140 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
21141 uint64_t ret_ref = 0;
21142 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21143 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21146 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) {
21147 LDKChannelHandshakeConfig arg_conv;
21148 arg_conv.inner = untag_ptr(arg);
21149 arg_conv.is_owned = ptr_is_owned(arg);
21150 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21151 arg_conv.is_owned = false;
21152 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
21156 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) {
21157 LDKChannelHandshakeConfig orig_conv;
21158 orig_conv.inner = untag_ptr(orig);
21159 orig_conv.is_owned = ptr_is_owned(orig);
21160 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21161 orig_conv.is_owned = false;
21162 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
21163 uint64_t ret_ref = 0;
21164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21165 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21169 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() {
21170 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
21171 uint64_t ret_ref = 0;
21172 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21173 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21177 void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) {
21178 LDKChannelHandshakeLimits this_obj_conv;
21179 this_obj_conv.inner = untag_ptr(this_obj);
21180 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21182 ChannelHandshakeLimits_free(this_obj_conv);
21185 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) {
21186 LDKChannelHandshakeLimits this_ptr_conv;
21187 this_ptr_conv.inner = untag_ptr(this_ptr);
21188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21190 this_ptr_conv.is_owned = false;
21191 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
21195 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) {
21196 LDKChannelHandshakeLimits this_ptr_conv;
21197 this_ptr_conv.inner = untag_ptr(this_ptr);
21198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21200 this_ptr_conv.is_owned = false;
21201 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
21204 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) {
21205 LDKChannelHandshakeLimits this_ptr_conv;
21206 this_ptr_conv.inner = untag_ptr(this_ptr);
21207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21209 this_ptr_conv.is_owned = false;
21210 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
21214 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) {
21215 LDKChannelHandshakeLimits this_ptr_conv;
21216 this_ptr_conv.inner = untag_ptr(this_ptr);
21217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21219 this_ptr_conv.is_owned = false;
21220 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
21223 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) {
21224 LDKChannelHandshakeLimits this_ptr_conv;
21225 this_ptr_conv.inner = untag_ptr(this_ptr);
21226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21228 this_ptr_conv.is_owned = false;
21229 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
21233 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) {
21234 LDKChannelHandshakeLimits this_ptr_conv;
21235 this_ptr_conv.inner = untag_ptr(this_ptr);
21236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21238 this_ptr_conv.is_owned = false;
21239 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
21242 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) {
21243 LDKChannelHandshakeLimits this_ptr_conv;
21244 this_ptr_conv.inner = untag_ptr(this_ptr);
21245 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21247 this_ptr_conv.is_owned = false;
21248 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
21252 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) {
21253 LDKChannelHandshakeLimits this_ptr_conv;
21254 this_ptr_conv.inner = untag_ptr(this_ptr);
21255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21257 this_ptr_conv.is_owned = false;
21258 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
21261 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) {
21262 LDKChannelHandshakeLimits this_ptr_conv;
21263 this_ptr_conv.inner = untag_ptr(this_ptr);
21264 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21266 this_ptr_conv.is_owned = false;
21267 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
21271 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) {
21272 LDKChannelHandshakeLimits this_ptr_conv;
21273 this_ptr_conv.inner = untag_ptr(this_ptr);
21274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21276 this_ptr_conv.is_owned = false;
21277 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
21280 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) {
21281 LDKChannelHandshakeLimits this_ptr_conv;
21282 this_ptr_conv.inner = untag_ptr(this_ptr);
21283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21285 this_ptr_conv.is_owned = false;
21286 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
21290 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) {
21291 LDKChannelHandshakeLimits this_ptr_conv;
21292 this_ptr_conv.inner = untag_ptr(this_ptr);
21293 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21295 this_ptr_conv.is_owned = false;
21296 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
21299 int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) {
21300 LDKChannelHandshakeLimits this_ptr_conv;
21301 this_ptr_conv.inner = untag_ptr(this_ptr);
21302 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21304 this_ptr_conv.is_owned = false;
21305 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
21309 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) {
21310 LDKChannelHandshakeLimits this_ptr_conv;
21311 this_ptr_conv.inner = untag_ptr(this_ptr);
21312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21314 this_ptr_conv.is_owned = false;
21315 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
21318 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) {
21319 LDKChannelHandshakeLimits this_ptr_conv;
21320 this_ptr_conv.inner = untag_ptr(this_ptr);
21321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21323 this_ptr_conv.is_owned = false;
21324 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
21328 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) {
21329 LDKChannelHandshakeLimits this_ptr_conv;
21330 this_ptr_conv.inner = untag_ptr(this_ptr);
21331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21333 this_ptr_conv.is_owned = false;
21334 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
21337 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) {
21338 LDKChannelHandshakeLimits this_ptr_conv;
21339 this_ptr_conv.inner = untag_ptr(this_ptr);
21340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21342 this_ptr_conv.is_owned = false;
21343 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
21347 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) {
21348 LDKChannelHandshakeLimits this_ptr_conv;
21349 this_ptr_conv.inner = untag_ptr(this_ptr);
21350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21352 this_ptr_conv.is_owned = false;
21353 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
21356 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) {
21357 LDKChannelHandshakeLimits this_ptr_conv;
21358 this_ptr_conv.inner = untag_ptr(this_ptr);
21359 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21361 this_ptr_conv.is_owned = false;
21362 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
21366 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) {
21367 LDKChannelHandshakeLimits this_ptr_conv;
21368 this_ptr_conv.inner = untag_ptr(this_ptr);
21369 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21371 this_ptr_conv.is_owned = false;
21372 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
21375 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) {
21376 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);
21377 uint64_t ret_ref = 0;
21378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21383 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
21384 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
21385 uint64_t ret_ref = 0;
21386 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21387 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21390 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) {
21391 LDKChannelHandshakeLimits arg_conv;
21392 arg_conv.inner = untag_ptr(arg);
21393 arg_conv.is_owned = ptr_is_owned(arg);
21394 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21395 arg_conv.is_owned = false;
21396 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
21400 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) {
21401 LDKChannelHandshakeLimits orig_conv;
21402 orig_conv.inner = untag_ptr(orig);
21403 orig_conv.is_owned = ptr_is_owned(orig);
21404 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21405 orig_conv.is_owned = false;
21406 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
21407 uint64_t ret_ref = 0;
21408 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21409 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21413 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() {
21414 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
21415 uint64_t ret_ref = 0;
21416 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21417 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21421 void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) {
21422 LDKChannelConfig this_obj_conv;
21423 this_obj_conv.inner = untag_ptr(this_obj);
21424 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21426 ChannelConfig_free(this_obj_conv);
21429 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) {
21430 LDKChannelConfig this_ptr_conv;
21431 this_ptr_conv.inner = untag_ptr(this_ptr);
21432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21434 this_ptr_conv.is_owned = false;
21435 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
21439 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) {
21440 LDKChannelConfig this_ptr_conv;
21441 this_ptr_conv.inner = untag_ptr(this_ptr);
21442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21444 this_ptr_conv.is_owned = false;
21445 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
21448 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) {
21449 LDKChannelConfig this_ptr_conv;
21450 this_ptr_conv.inner = untag_ptr(this_ptr);
21451 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21453 this_ptr_conv.is_owned = false;
21454 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
21458 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) {
21459 LDKChannelConfig this_ptr_conv;
21460 this_ptr_conv.inner = untag_ptr(this_ptr);
21461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21463 this_ptr_conv.is_owned = false;
21464 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
21467 int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) {
21468 LDKChannelConfig this_ptr_conv;
21469 this_ptr_conv.inner = untag_ptr(this_ptr);
21470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21472 this_ptr_conv.is_owned = false;
21473 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
21477 void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
21478 LDKChannelConfig this_ptr_conv;
21479 this_ptr_conv.inner = untag_ptr(this_ptr);
21480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21482 this_ptr_conv.is_owned = false;
21483 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
21486 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) {
21487 LDKChannelConfig this_ptr_conv;
21488 this_ptr_conv.inner = untag_ptr(this_ptr);
21489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21491 this_ptr_conv.is_owned = false;
21492 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
21496 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) {
21497 LDKChannelConfig this_ptr_conv;
21498 this_ptr_conv.inner = untag_ptr(this_ptr);
21499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21501 this_ptr_conv.is_owned = false;
21502 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
21505 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) {
21506 LDKChannelConfig this_ptr_conv;
21507 this_ptr_conv.inner = untag_ptr(this_ptr);
21508 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21510 this_ptr_conv.is_owned = false;
21511 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
21515 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) {
21516 LDKChannelConfig this_ptr_conv;
21517 this_ptr_conv.inner = untag_ptr(this_ptr);
21518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21520 this_ptr_conv.is_owned = false;
21521 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
21524 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) {
21525 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);
21526 uint64_t ret_ref = 0;
21527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21532 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
21533 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
21534 uint64_t ret_ref = 0;
21535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21539 int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) {
21540 LDKChannelConfig arg_conv;
21541 arg_conv.inner = untag_ptr(arg);
21542 arg_conv.is_owned = ptr_is_owned(arg);
21543 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21544 arg_conv.is_owned = false;
21545 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
21549 uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) {
21550 LDKChannelConfig orig_conv;
21551 orig_conv.inner = untag_ptr(orig);
21552 orig_conv.is_owned = ptr_is_owned(orig);
21553 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21554 orig_conv.is_owned = false;
21555 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
21556 uint64_t ret_ref = 0;
21557 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21558 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21562 uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
21563 LDKChannelConfig ret_var = ChannelConfig_default();
21564 uint64_t ret_ref = 0;
21565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21570 int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) {
21571 LDKChannelConfig obj_conv;
21572 obj_conv.inner = untag_ptr(obj);
21573 obj_conv.is_owned = ptr_is_owned(obj);
21574 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
21575 obj_conv.is_owned = false;
21576 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
21577 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21578 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21579 CVec_u8Z_free(ret_var);
21583 uint64_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
21584 LDKu8slice ser_ref;
21585 ser_ref.datalen = ser->arr_len;
21586 ser_ref.data = ser->elems;
21587 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21588 *ret_conv = ChannelConfig_read(ser_ref);
21590 return tag_ptr(ret_conv, true);
21593 void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) {
21594 LDKUserConfig this_obj_conv;
21595 this_obj_conv.inner = untag_ptr(this_obj);
21596 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21598 UserConfig_free(this_obj_conv);
21601 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) {
21602 LDKUserConfig this_ptr_conv;
21603 this_ptr_conv.inner = untag_ptr(this_ptr);
21604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21606 this_ptr_conv.is_owned = false;
21607 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
21608 uint64_t ret_ref = 0;
21609 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21610 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21614 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) {
21615 LDKUserConfig this_ptr_conv;
21616 this_ptr_conv.inner = untag_ptr(this_ptr);
21617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21619 this_ptr_conv.is_owned = false;
21620 LDKChannelHandshakeConfig val_conv;
21621 val_conv.inner = untag_ptr(val);
21622 val_conv.is_owned = ptr_is_owned(val);
21623 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21624 val_conv = ChannelHandshakeConfig_clone(&val_conv);
21625 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
21628 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) {
21629 LDKUserConfig this_ptr_conv;
21630 this_ptr_conv.inner = untag_ptr(this_ptr);
21631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21633 this_ptr_conv.is_owned = false;
21634 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
21635 uint64_t ret_ref = 0;
21636 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21637 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21641 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) {
21642 LDKUserConfig this_ptr_conv;
21643 this_ptr_conv.inner = untag_ptr(this_ptr);
21644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21646 this_ptr_conv.is_owned = false;
21647 LDKChannelHandshakeLimits val_conv;
21648 val_conv.inner = untag_ptr(val);
21649 val_conv.is_owned = ptr_is_owned(val);
21650 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21651 val_conv = ChannelHandshakeLimits_clone(&val_conv);
21652 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
21655 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) {
21656 LDKUserConfig this_ptr_conv;
21657 this_ptr_conv.inner = untag_ptr(this_ptr);
21658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21660 this_ptr_conv.is_owned = false;
21661 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
21662 uint64_t ret_ref = 0;
21663 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21664 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21668 void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) {
21669 LDKUserConfig this_ptr_conv;
21670 this_ptr_conv.inner = untag_ptr(this_ptr);
21671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21673 this_ptr_conv.is_owned = false;
21674 LDKChannelConfig val_conv;
21675 val_conv.inner = untag_ptr(val);
21676 val_conv.is_owned = ptr_is_owned(val);
21677 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21678 val_conv = ChannelConfig_clone(&val_conv);
21679 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
21682 jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) {
21683 LDKUserConfig this_ptr_conv;
21684 this_ptr_conv.inner = untag_ptr(this_ptr);
21685 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21687 this_ptr_conv.is_owned = false;
21688 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
21692 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) {
21693 LDKUserConfig this_ptr_conv;
21694 this_ptr_conv.inner = untag_ptr(this_ptr);
21695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21697 this_ptr_conv.is_owned = false;
21698 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
21701 jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) {
21702 LDKUserConfig this_ptr_conv;
21703 this_ptr_conv.inner = untag_ptr(this_ptr);
21704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21706 this_ptr_conv.is_owned = false;
21707 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
21711 void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21712 LDKUserConfig this_ptr_conv;
21713 this_ptr_conv.inner = untag_ptr(this_ptr);
21714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21716 this_ptr_conv.is_owned = false;
21717 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
21720 jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) {
21721 LDKUserConfig this_ptr_conv;
21722 this_ptr_conv.inner = untag_ptr(this_ptr);
21723 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21725 this_ptr_conv.is_owned = false;
21726 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
21730 void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21731 LDKUserConfig this_ptr_conv;
21732 this_ptr_conv.inner = untag_ptr(this_ptr);
21733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21735 this_ptr_conv.is_owned = false;
21736 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
21739 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) {
21740 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
21741 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
21742 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
21743 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
21744 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
21745 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
21746 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
21747 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
21748 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
21749 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
21750 LDKChannelConfig channel_config_arg_conv;
21751 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
21752 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
21753 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
21754 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
21755 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);
21756 uint64_t ret_ref = 0;
21757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21762 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
21763 LDKUserConfig ret_var = UserConfig_clone(arg);
21764 uint64_t ret_ref = 0;
21765 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21766 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21769 int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) {
21770 LDKUserConfig arg_conv;
21771 arg_conv.inner = untag_ptr(arg);
21772 arg_conv.is_owned = ptr_is_owned(arg);
21773 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21774 arg_conv.is_owned = false;
21775 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
21779 uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) {
21780 LDKUserConfig orig_conv;
21781 orig_conv.inner = untag_ptr(orig);
21782 orig_conv.is_owned = ptr_is_owned(orig);
21783 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21784 orig_conv.is_owned = false;
21785 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
21786 uint64_t ret_ref = 0;
21787 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21788 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21792 uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() {
21793 LDKUserConfig ret_var = UserConfig_default();
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);
21800 void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) {
21801 LDKBestBlock this_obj_conv;
21802 this_obj_conv.inner = untag_ptr(this_obj);
21803 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21805 BestBlock_free(this_obj_conv);
21808 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
21809 LDKBestBlock ret_var = BestBlock_clone(arg);
21810 uint64_t ret_ref = 0;
21811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21815 int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) {
21816 LDKBestBlock arg_conv;
21817 arg_conv.inner = untag_ptr(arg);
21818 arg_conv.is_owned = ptr_is_owned(arg);
21819 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21820 arg_conv.is_owned = false;
21821 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
21825 uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) {
21826 LDKBestBlock orig_conv;
21827 orig_conv.inner = untag_ptr(orig);
21828 orig_conv.is_owned = ptr_is_owned(orig);
21829 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21830 orig_conv.is_owned = false;
21831 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
21832 uint64_t ret_ref = 0;
21833 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21834 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21838 uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
21839 LDKNetwork network_conv = LDKNetwork_from_js(network);
21840 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
21841 uint64_t ret_ref = 0;
21842 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21843 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21847 uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
21848 LDKThirtyTwoBytes block_hash_ref;
21849 CHECK(block_hash->arr_len == 32);
21850 memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash);
21851 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
21852 uint64_t ret_ref = 0;
21853 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21854 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21858 int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) {
21859 LDKBestBlock this_arg_conv;
21860 this_arg_conv.inner = untag_ptr(this_arg);
21861 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21863 this_arg_conv.is_owned = false;
21864 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21865 memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32);
21869 int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) {
21870 LDKBestBlock this_arg_conv;
21871 this_arg_conv.inner = untag_ptr(this_arg);
21872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21874 this_arg_conv.is_owned = false;
21875 int32_t ret_conv = BestBlock_height(&this_arg_conv);
21879 uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
21880 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
21881 uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
21885 uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
21886 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
21890 uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
21891 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
21895 void __attribute__((export_name("TS_Access_free"))) TS_Access_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 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
21900 FREE(untag_ptr(this_ptr));
21901 Access_free(this_ptr_conv);
21904 void __attribute__((export_name("TS_Listen_free"))) TS_Listen_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 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
21909 FREE(untag_ptr(this_ptr));
21910 Listen_free(this_ptr_conv);
21913 void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t this_ptr) {
21914 if (!ptr_is_owned(this_ptr)) return;
21915 void* this_ptr_ptr = untag_ptr(this_ptr);
21916 CHECK_ACCESS(this_ptr_ptr);
21917 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
21918 FREE(untag_ptr(this_ptr));
21919 Confirm_free(this_ptr_conv);
21922 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) {
21923 LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
21924 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv));
21928 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
21929 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
21933 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
21934 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
21938 void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint64_t this_ptr) {
21939 if (!ptr_is_owned(this_ptr)) return;
21940 void* this_ptr_ptr = untag_ptr(this_ptr);
21941 CHECK_ACCESS(this_ptr_ptr);
21942 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
21943 FREE(untag_ptr(this_ptr));
21944 Watch_free(this_ptr_conv);
21947 void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint64_t this_ptr) {
21948 if (!ptr_is_owned(this_ptr)) return;
21949 void* this_ptr_ptr = untag_ptr(this_ptr);
21950 CHECK_ACCESS(this_ptr_ptr);
21951 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
21952 FREE(untag_ptr(this_ptr));
21953 Filter_free(this_ptr_conv);
21956 void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) {
21957 LDKWatchedOutput this_obj_conv;
21958 this_obj_conv.inner = untag_ptr(this_obj);
21959 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21961 WatchedOutput_free(this_obj_conv);
21964 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) {
21965 LDKWatchedOutput this_ptr_conv;
21966 this_ptr_conv.inner = untag_ptr(this_ptr);
21967 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21969 this_ptr_conv.is_owned = false;
21970 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21971 memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32);
21975 void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, int8_tArray val) {
21976 LDKWatchedOutput this_ptr_conv;
21977 this_ptr_conv.inner = untag_ptr(this_ptr);
21978 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21980 this_ptr_conv.is_owned = false;
21981 LDKThirtyTwoBytes val_ref;
21982 CHECK(val->arr_len == 32);
21983 memcpy(val_ref.data, val->elems, 32); FREE(val);
21984 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
21987 uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) {
21988 LDKWatchedOutput this_ptr_conv;
21989 this_ptr_conv.inner = untag_ptr(this_ptr);
21990 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21992 this_ptr_conv.is_owned = false;
21993 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
21994 uint64_t ret_ref = 0;
21995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22000 void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) {
22001 LDKWatchedOutput this_ptr_conv;
22002 this_ptr_conv.inner = untag_ptr(this_ptr);
22003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22005 this_ptr_conv.is_owned = false;
22006 LDKOutPoint val_conv;
22007 val_conv.inner = untag_ptr(val);
22008 val_conv.is_owned = ptr_is_owned(val);
22009 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
22010 val_conv = OutPoint_clone(&val_conv);
22011 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
22014 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) {
22015 LDKWatchedOutput this_ptr_conv;
22016 this_ptr_conv.inner = untag_ptr(this_ptr);
22017 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22019 this_ptr_conv.is_owned = false;
22020 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
22021 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22022 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22026 void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) {
22027 LDKWatchedOutput this_ptr_conv;
22028 this_ptr_conv.inner = untag_ptr(this_ptr);
22029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22031 this_ptr_conv.is_owned = false;
22032 LDKCVec_u8Z val_ref;
22033 val_ref.datalen = val->arr_len;
22034 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
22035 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
22036 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
22039 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) {
22040 LDKThirtyTwoBytes block_hash_arg_ref;
22041 CHECK(block_hash_arg->arr_len == 32);
22042 memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg);
22043 LDKOutPoint outpoint_arg_conv;
22044 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
22045 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
22046 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
22047 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
22048 LDKCVec_u8Z script_pubkey_arg_ref;
22049 script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len;
22050 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
22051 memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg);
22052 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
22053 uint64_t ret_ref = 0;
22054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22059 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
22060 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
22061 uint64_t ret_ref = 0;
22062 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22063 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22066 int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) {
22067 LDKWatchedOutput arg_conv;
22068 arg_conv.inner = untag_ptr(arg);
22069 arg_conv.is_owned = ptr_is_owned(arg);
22070 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22071 arg_conv.is_owned = false;
22072 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
22076 uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) {
22077 LDKWatchedOutput orig_conv;
22078 orig_conv.inner = untag_ptr(orig);
22079 orig_conv.is_owned = ptr_is_owned(orig);
22080 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22081 orig_conv.is_owned = false;
22082 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
22083 uint64_t ret_ref = 0;
22084 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22085 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22089 int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
22090 LDKWatchedOutput o_conv;
22091 o_conv.inner = untag_ptr(o);
22092 o_conv.is_owned = ptr_is_owned(o);
22093 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22094 o_conv.is_owned = false;
22095 int64_t ret_conv = WatchedOutput_hash(&o_conv);
22099 void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint64_t this_ptr) {
22100 if (!ptr_is_owned(this_ptr)) return;
22101 void* this_ptr_ptr = untag_ptr(this_ptr);
22102 CHECK_ACCESS(this_ptr_ptr);
22103 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
22104 FREE(untag_ptr(this_ptr));
22105 BroadcasterInterface_free(this_ptr_conv);
22108 uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) {
22109 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
22110 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv));
22114 uint32_t __attribute__((export_name("TS_ConfirmationTarget_background"))) TS_ConfirmationTarget_background() {
22115 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
22119 uint32_t __attribute__((export_name("TS_ConfirmationTarget_normal"))) TS_ConfirmationTarget_normal() {
22120 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
22124 uint32_t __attribute__((export_name("TS_ConfirmationTarget_high_priority"))) TS_ConfirmationTarget_high_priority() {
22125 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
22129 jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
22130 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
22131 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
22132 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
22136 void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) {
22137 if (!ptr_is_owned(this_ptr)) return;
22138 void* this_ptr_ptr = untag_ptr(this_ptr);
22139 CHECK_ACCESS(this_ptr_ptr);
22140 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
22141 FREE(untag_ptr(this_ptr));
22142 FeeEstimator_free(this_ptr_conv);
22145 void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) {
22146 LDKMonitorUpdateId this_obj_conv;
22147 this_obj_conv.inner = untag_ptr(this_obj);
22148 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22150 MonitorUpdateId_free(this_obj_conv);
22153 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
22154 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
22155 uint64_t ret_ref = 0;
22156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22160 int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) {
22161 LDKMonitorUpdateId arg_conv;
22162 arg_conv.inner = untag_ptr(arg);
22163 arg_conv.is_owned = ptr_is_owned(arg);
22164 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22165 arg_conv.is_owned = false;
22166 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
22170 uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) {
22171 LDKMonitorUpdateId orig_conv;
22172 orig_conv.inner = untag_ptr(orig);
22173 orig_conv.is_owned = ptr_is_owned(orig);
22174 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22175 orig_conv.is_owned = false;
22176 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
22177 uint64_t ret_ref = 0;
22178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22183 int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) {
22184 LDKMonitorUpdateId o_conv;
22185 o_conv.inner = untag_ptr(o);
22186 o_conv.is_owned = ptr_is_owned(o);
22187 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22188 o_conv.is_owned = false;
22189 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
22193 jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) {
22194 LDKMonitorUpdateId a_conv;
22195 a_conv.inner = untag_ptr(a);
22196 a_conv.is_owned = ptr_is_owned(a);
22197 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22198 a_conv.is_owned = false;
22199 LDKMonitorUpdateId b_conv;
22200 b_conv.inner = untag_ptr(b);
22201 b_conv.is_owned = ptr_is_owned(b);
22202 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22203 b_conv.is_owned = false;
22204 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
22208 void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint64_t this_ptr) {
22209 if (!ptr_is_owned(this_ptr)) return;
22210 void* this_ptr_ptr = untag_ptr(this_ptr);
22211 CHECK_ACCESS(this_ptr_ptr);
22212 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
22213 FREE(untag_ptr(this_ptr));
22214 Persist_free(this_ptr_conv);
22217 void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) {
22218 LDKLockedChannelMonitor this_obj_conv;
22219 this_obj_conv.inner = untag_ptr(this_obj);
22220 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22222 LockedChannelMonitor_free(this_obj_conv);
22225 void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) {
22226 LDKChainMonitor this_obj_conv;
22227 this_obj_conv.inner = untag_ptr(this_obj);
22228 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22230 ChainMonitor_free(this_obj_conv);
22233 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) {
22234 void* chain_source_ptr = untag_ptr(chain_source);
22235 CHECK_ACCESS(chain_source_ptr);
22236 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
22237 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
22238 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
22239 // Manually implement clone for Java trait instances
22240 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
22241 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22242 LDKFilter_JCalls_cloned(&chain_source_conv.some);
22245 void* broadcaster_ptr = untag_ptr(broadcaster);
22246 CHECK_ACCESS(broadcaster_ptr);
22247 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22248 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22249 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22250 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22252 void* logger_ptr = untag_ptr(logger);
22253 CHECK_ACCESS(logger_ptr);
22254 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22255 if (logger_conv.free == LDKLogger_JCalls_free) {
22256 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22257 LDKLogger_JCalls_cloned(&logger_conv);
22259 void* feeest_ptr = untag_ptr(feeest);
22260 CHECK_ACCESS(feeest_ptr);
22261 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
22262 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
22263 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22264 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
22266 void* persister_ptr = untag_ptr(persister);
22267 CHECK_ACCESS(persister_ptr);
22268 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
22269 if (persister_conv.free == LDKPersist_JCalls_free) {
22270 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22271 LDKPersist_JCalls_cloned(&persister_conv);
22273 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
22274 uint64_t ret_ref = 0;
22275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22280 uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) {
22281 LDKChainMonitor this_arg_conv;
22282 this_arg_conv.inner = untag_ptr(this_arg);
22283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22285 this_arg_conv.is_owned = false;
22286 LDKCVec_ChannelDetailsZ ignored_channels_constr;
22287 ignored_channels_constr.datalen = ignored_channels->arr_len;
22288 if (ignored_channels_constr.datalen > 0)
22289 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
22291 ignored_channels_constr.data = NULL;
22292 uint64_t* ignored_channels_vals = ignored_channels->elems;
22293 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
22294 uint64_t ignored_channels_conv_16 = ignored_channels_vals[q];
22295 LDKChannelDetails ignored_channels_conv_16_conv;
22296 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
22297 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
22298 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
22299 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
22300 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
22302 FREE(ignored_channels);
22303 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
22304 uint64_tArray ret_arr = NULL;
22305 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22306 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22307 for (size_t j = 0; j < ret_var.datalen; j++) {
22308 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22309 *ret_conv_9_copy = ret_var.data[j];
22310 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
22311 ret_arr_ptr[j] = ret_conv_9_ref;
22314 FREE(ret_var.data);
22318 uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) {
22319 LDKChainMonitor this_arg_conv;
22320 this_arg_conv.inner = untag_ptr(this_arg);
22321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22323 this_arg_conv.is_owned = false;
22324 LDKOutPoint funding_txo_conv;
22325 funding_txo_conv.inner = untag_ptr(funding_txo);
22326 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22327 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22328 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22329 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
22330 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
22331 return tag_ptr(ret_conv, true);
22334 uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) {
22335 LDKChainMonitor this_arg_conv;
22336 this_arg_conv.inner = untag_ptr(this_arg);
22337 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22339 this_arg_conv.is_owned = false;
22340 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
22341 uint64_tArray ret_arr = NULL;
22342 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22343 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22344 for (size_t k = 0; k < ret_var.datalen; k++) {
22345 LDKOutPoint ret_conv_10_var = ret_var.data[k];
22346 uint64_t ret_conv_10_ref = 0;
22347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
22348 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
22349 ret_arr_ptr[k] = ret_conv_10_ref;
22352 FREE(ret_var.data);
22356 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) {
22357 LDKChainMonitor this_arg_conv;
22358 this_arg_conv.inner = untag_ptr(this_arg);
22359 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22361 this_arg_conv.is_owned = false;
22362 LDKOutPoint funding_txo_conv;
22363 funding_txo_conv.inner = untag_ptr(funding_txo);
22364 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22365 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22366 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22367 LDKMonitorUpdateId completed_update_id_conv;
22368 completed_update_id_conv.inner = untag_ptr(completed_update_id);
22369 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
22370 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
22371 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
22372 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
22373 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
22374 return tag_ptr(ret_conv, true);
22377 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) {
22378 LDKChainMonitor this_arg_conv;
22379 this_arg_conv.inner = untag_ptr(this_arg);
22380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22382 this_arg_conv.is_owned = false;
22383 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
22384 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
22385 return tag_ptr(ret_ret, true);
22388 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint64_t this_arg) {
22389 LDKChainMonitor this_arg_conv;
22390 this_arg_conv.inner = untag_ptr(this_arg);
22391 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22393 this_arg_conv.is_owned = false;
22394 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
22395 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
22396 return tag_ptr(ret_ret, true);
22399 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint64_t this_arg) {
22400 LDKChainMonitor this_arg_conv;
22401 this_arg_conv.inner = untag_ptr(this_arg);
22402 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22404 this_arg_conv.is_owned = false;
22405 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
22406 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
22407 return tag_ptr(ret_ret, true);
22410 uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) {
22411 LDKChainMonitor this_arg_conv;
22412 this_arg_conv.inner = untag_ptr(this_arg);
22413 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22415 this_arg_conv.is_owned = false;
22416 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
22417 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
22418 return tag_ptr(ret_ret, true);
22421 void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) {
22422 LDKChannelMonitorUpdate this_obj_conv;
22423 this_obj_conv.inner = untag_ptr(this_obj);
22424 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22426 ChannelMonitorUpdate_free(this_obj_conv);
22429 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) {
22430 LDKChannelMonitorUpdate this_ptr_conv;
22431 this_ptr_conv.inner = untag_ptr(this_ptr);
22432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22434 this_ptr_conv.is_owned = false;
22435 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
22439 void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) {
22440 LDKChannelMonitorUpdate this_ptr_conv;
22441 this_ptr_conv.inner = untag_ptr(this_ptr);
22442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22444 this_ptr_conv.is_owned = false;
22445 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
22448 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
22449 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
22450 uint64_t ret_ref = 0;
22451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22455 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) {
22456 LDKChannelMonitorUpdate arg_conv;
22457 arg_conv.inner = untag_ptr(arg);
22458 arg_conv.is_owned = ptr_is_owned(arg);
22459 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22460 arg_conv.is_owned = false;
22461 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
22465 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) {
22466 LDKChannelMonitorUpdate orig_conv;
22467 orig_conv.inner = untag_ptr(orig);
22468 orig_conv.is_owned = ptr_is_owned(orig);
22469 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22470 orig_conv.is_owned = false;
22471 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
22472 uint64_t ret_ref = 0;
22473 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22474 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22478 int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) {
22479 LDKChannelMonitorUpdate obj_conv;
22480 obj_conv.inner = untag_ptr(obj);
22481 obj_conv.is_owned = ptr_is_owned(obj);
22482 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22483 obj_conv.is_owned = false;
22484 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
22485 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22486 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22487 CVec_u8Z_free(ret_var);
22491 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
22492 LDKu8slice ser_ref;
22493 ser_ref.datalen = ser->arr_len;
22494 ser_ref.data = ser->elems;
22495 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22496 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
22498 return tag_ptr(ret_conv, true);
22501 void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint64_t this_ptr) {
22502 if (!ptr_is_owned(this_ptr)) return;
22503 void* this_ptr_ptr = untag_ptr(this_ptr);
22504 CHECK_ACCESS(this_ptr_ptr);
22505 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
22506 FREE(untag_ptr(this_ptr));
22507 MonitorEvent_free(this_ptr_conv);
22510 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
22511 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22512 *ret_copy = MonitorEvent_clone(arg);
22513 uint64_t ret_ref = tag_ptr(ret_copy, true);
22516 int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) {
22517 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
22518 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
22522 uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) {
22523 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
22524 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22525 *ret_copy = MonitorEvent_clone(orig_conv);
22526 uint64_t ret_ref = tag_ptr(ret_copy, true);
22530 uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) {
22531 LDKHTLCUpdate a_conv;
22532 a_conv.inner = untag_ptr(a);
22533 a_conv.is_owned = ptr_is_owned(a);
22534 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22535 a_conv = HTLCUpdate_clone(&a_conv);
22536 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22537 *ret_copy = MonitorEvent_htlcevent(a_conv);
22538 uint64_t ret_ref = tag_ptr(ret_copy, true);
22542 uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed"))) TS_MonitorEvent_commitment_tx_confirmed(uint64_t a) {
22543 LDKOutPoint a_conv;
22544 a_conv.inner = untag_ptr(a);
22545 a_conv.is_owned = ptr_is_owned(a);
22546 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22547 a_conv = OutPoint_clone(&a_conv);
22548 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22549 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
22550 uint64_t ret_ref = tag_ptr(ret_copy, true);
22554 uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) {
22555 LDKOutPoint funding_txo_conv;
22556 funding_txo_conv.inner = untag_ptr(funding_txo);
22557 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22558 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22559 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22560 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22561 *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
22562 uint64_t ret_ref = tag_ptr(ret_copy, true);
22566 uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_MonitorEvent_update_failed(uint64_t a) {
22567 LDKOutPoint a_conv;
22568 a_conv.inner = untag_ptr(a);
22569 a_conv.is_owned = ptr_is_owned(a);
22570 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22571 a_conv = OutPoint_clone(&a_conv);
22572 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22573 *ret_copy = MonitorEvent_update_failed(a_conv);
22574 uint64_t ret_ref = tag_ptr(ret_copy, true);
22578 int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
22579 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
22580 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
22581 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22582 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22583 CVec_u8Z_free(ret_var);
22587 uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
22588 LDKu8slice ser_ref;
22589 ser_ref.datalen = ser->arr_len;
22590 ser_ref.data = ser->elems;
22591 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22592 *ret_conv = MonitorEvent_read(ser_ref);
22594 return tag_ptr(ret_conv, true);
22597 void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) {
22598 LDKHTLCUpdate this_obj_conv;
22599 this_obj_conv.inner = untag_ptr(this_obj);
22600 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22602 HTLCUpdate_free(this_obj_conv);
22605 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
22606 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
22607 uint64_t ret_ref = 0;
22608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22612 int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) {
22613 LDKHTLCUpdate arg_conv;
22614 arg_conv.inner = untag_ptr(arg);
22615 arg_conv.is_owned = ptr_is_owned(arg);
22616 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22617 arg_conv.is_owned = false;
22618 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
22622 uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) {
22623 LDKHTLCUpdate orig_conv;
22624 orig_conv.inner = untag_ptr(orig);
22625 orig_conv.is_owned = ptr_is_owned(orig);
22626 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22627 orig_conv.is_owned = false;
22628 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
22629 uint64_t ret_ref = 0;
22630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22635 int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
22636 LDKHTLCUpdate obj_conv;
22637 obj_conv.inner = untag_ptr(obj);
22638 obj_conv.is_owned = ptr_is_owned(obj);
22639 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22640 obj_conv.is_owned = false;
22641 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
22642 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22643 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22644 CVec_u8Z_free(ret_var);
22648 uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
22649 LDKu8slice ser_ref;
22650 ser_ref.datalen = ser->arr_len;
22651 ser_ref.data = ser->elems;
22652 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22653 *ret_conv = HTLCUpdate_read(ser_ref);
22655 return tag_ptr(ret_conv, true);
22658 void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint64_t this_ptr) {
22659 if (!ptr_is_owned(this_ptr)) return;
22660 void* this_ptr_ptr = untag_ptr(this_ptr);
22661 CHECK_ACCESS(this_ptr_ptr);
22662 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
22663 FREE(untag_ptr(this_ptr));
22664 Balance_free(this_ptr_conv);
22667 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
22668 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22669 *ret_copy = Balance_clone(arg);
22670 uint64_t ret_ref = tag_ptr(ret_copy, true);
22673 int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) {
22674 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
22675 int64_t ret_conv = Balance_clone_ptr(arg_conv);
22679 uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) {
22680 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
22681 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22682 *ret_copy = Balance_clone(orig_conv);
22683 uint64_t ret_ref = tag_ptr(ret_copy, true);
22687 uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) {
22688 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22689 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
22690 uint64_t ret_ref = tag_ptr(ret_copy, true);
22694 uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) {
22695 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22696 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
22697 uint64_t ret_ref = tag_ptr(ret_copy, true);
22701 uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) {
22702 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22703 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
22704 uint64_t ret_ref = tag_ptr(ret_copy, true);
22708 uint64_t __attribute__((export_name("TS_Balance_maybe_claimable_htlcawaiting_timeout"))) TS_Balance_maybe_claimable_htlcawaiting_timeout(int64_t claimable_amount_satoshis, int32_t claimable_height) {
22709 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22710 *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
22711 uint64_t ret_ref = tag_ptr(ret_copy, true);
22715 jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) {
22716 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
22717 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
22718 jboolean ret_conv = Balance_eq(a_conv, b_conv);
22722 void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) {
22723 LDKChannelMonitor this_obj_conv;
22724 this_obj_conv.inner = untag_ptr(this_obj);
22725 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22727 ChannelMonitor_free(this_obj_conv);
22730 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
22731 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
22732 uint64_t ret_ref = 0;
22733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22737 int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) {
22738 LDKChannelMonitor arg_conv;
22739 arg_conv.inner = untag_ptr(arg);
22740 arg_conv.is_owned = ptr_is_owned(arg);
22741 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22742 arg_conv.is_owned = false;
22743 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
22747 uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) {
22748 LDKChannelMonitor orig_conv;
22749 orig_conv.inner = untag_ptr(orig);
22750 orig_conv.is_owned = ptr_is_owned(orig);
22751 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22752 orig_conv.is_owned = false;
22753 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
22754 uint64_t ret_ref = 0;
22755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22760 int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) {
22761 LDKChannelMonitor obj_conv;
22762 obj_conv.inner = untag_ptr(obj);
22763 obj_conv.is_owned = ptr_is_owned(obj);
22764 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22765 obj_conv.is_owned = false;
22766 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
22767 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22768 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22769 CVec_u8Z_free(ret_var);
22773 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) {
22774 LDKChannelMonitor this_arg_conv;
22775 this_arg_conv.inner = untag_ptr(this_arg);
22776 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22778 this_arg_conv.is_owned = false;
22779 LDKChannelMonitorUpdate updates_conv;
22780 updates_conv.inner = untag_ptr(updates);
22781 updates_conv.is_owned = ptr_is_owned(updates);
22782 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
22783 updates_conv.is_owned = false;
22784 void* broadcaster_ptr = untag_ptr(broadcaster);
22785 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
22786 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
22787 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22788 CHECK_ACCESS(fee_estimator_ptr);
22789 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22790 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22791 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22792 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22794 void* logger_ptr = untag_ptr(logger);
22795 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22796 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22797 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
22798 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
22799 return tag_ptr(ret_conv, true);
22802 int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) {
22803 LDKChannelMonitor this_arg_conv;
22804 this_arg_conv.inner = untag_ptr(this_arg);
22805 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22807 this_arg_conv.is_owned = false;
22808 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
22812 uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) {
22813 LDKChannelMonitor this_arg_conv;
22814 this_arg_conv.inner = untag_ptr(this_arg);
22815 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22817 this_arg_conv.is_owned = false;
22818 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22819 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
22820 return tag_ptr(ret_conv, true);
22823 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) {
22824 LDKChannelMonitor this_arg_conv;
22825 this_arg_conv.inner = untag_ptr(this_arg);
22826 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22828 this_arg_conv.is_owned = false;
22829 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
22830 uint64_tArray ret_arr = NULL;
22831 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22832 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22833 for (size_t o = 0; o < ret_var.datalen; o++) {
22834 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22835 *ret_conv_40_conv = ret_var.data[o];
22836 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
22839 FREE(ret_var.data);
22843 void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter) {
22844 LDKChannelMonitor this_arg_conv;
22845 this_arg_conv.inner = untag_ptr(this_arg);
22846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22848 this_arg_conv.is_owned = false;
22849 void* filter_ptr = untag_ptr(filter);
22850 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
22851 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
22852 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
22855 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) {
22856 LDKChannelMonitor this_arg_conv;
22857 this_arg_conv.inner = untag_ptr(this_arg);
22858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22860 this_arg_conv.is_owned = false;
22861 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
22862 uint64_tArray ret_arr = NULL;
22863 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22864 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22865 for (size_t o = 0; o < ret_var.datalen; o++) {
22866 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22867 *ret_conv_14_copy = ret_var.data[o];
22868 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
22869 ret_arr_ptr[o] = ret_conv_14_ref;
22872 FREE(ret_var.data);
22876 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_events"))) TS_ChannelMonitor_get_and_clear_pending_events(uint64_t this_arg) {
22877 LDKChannelMonitor this_arg_conv;
22878 this_arg_conv.inner = untag_ptr(this_arg);
22879 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22881 this_arg_conv.is_owned = false;
22882 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
22883 uint64_tArray ret_arr = NULL;
22884 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22885 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22886 for (size_t h = 0; h < ret_var.datalen; h++) {
22887 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
22888 *ret_conv_7_copy = ret_var.data[h];
22889 uint64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
22890 ret_arr_ptr[h] = ret_conv_7_ref;
22893 FREE(ret_var.data);
22897 int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) {
22898 LDKChannelMonitor this_arg_conv;
22899 this_arg_conv.inner = untag_ptr(this_arg);
22900 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22902 this_arg_conv.is_owned = false;
22903 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
22904 memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33);
22908 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) {
22909 LDKChannelMonitor this_arg_conv;
22910 this_arg_conv.inner = untag_ptr(this_arg);
22911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22913 this_arg_conv.is_owned = false;
22914 void* logger_ptr = untag_ptr(logger);
22915 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22916 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22917 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
22918 ptrArray ret_arr = NULL;
22919 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
22920 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
22921 for (size_t m = 0; m < ret_var.datalen; m++) {
22922 LDKTransaction ret_conv_12_var = ret_var.data[m];
22923 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
22924 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
22925 Transaction_free(ret_conv_12_var);
22926 ret_arr_ptr[m] = ret_conv_12_arr;
22929 FREE(ret_var.data);
22933 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) {
22934 LDKChannelMonitor this_arg_conv;
22935 this_arg_conv.inner = untag_ptr(this_arg);
22936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22938 this_arg_conv.is_owned = false;
22939 unsigned char header_arr[80];
22940 CHECK(header->arr_len == 80);
22941 memcpy(header_arr, header->elems, 80); FREE(header);
22942 unsigned char (*header_ref)[80] = &header_arr;
22943 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
22944 txdata_constr.datalen = txdata->arr_len;
22945 if (txdata_constr.datalen > 0)
22946 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
22948 txdata_constr.data = NULL;
22949 uint64_t* txdata_vals = txdata->elems;
22950 for (size_t c = 0; c < txdata_constr.datalen; c++) {
22951 uint64_t txdata_conv_28 = txdata_vals[c];
22952 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
22953 CHECK_ACCESS(txdata_conv_28_ptr);
22954 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
22955 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
22956 txdata_constr.data[c] = txdata_conv_28_conv;
22959 void* broadcaster_ptr = untag_ptr(broadcaster);
22960 CHECK_ACCESS(broadcaster_ptr);
22961 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22962 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22963 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22964 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22966 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22967 CHECK_ACCESS(fee_estimator_ptr);
22968 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22969 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22970 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22971 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22973 void* logger_ptr = untag_ptr(logger);
22974 CHECK_ACCESS(logger_ptr);
22975 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22976 if (logger_conv.free == LDKLogger_JCalls_free) {
22977 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22978 LDKLogger_JCalls_cloned(&logger_conv);
22980 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);
22981 uint64_tArray ret_arr = NULL;
22982 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22983 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22984 for (size_t n = 0; n < ret_var.datalen; n++) {
22985 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22986 *ret_conv_39_conv = ret_var.data[n];
22987 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
22990 FREE(ret_var.data);
22994 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) {
22995 LDKChannelMonitor this_arg_conv;
22996 this_arg_conv.inner = untag_ptr(this_arg);
22997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22999 this_arg_conv.is_owned = false;
23000 unsigned char header_arr[80];
23001 CHECK(header->arr_len == 80);
23002 memcpy(header_arr, header->elems, 80); FREE(header);
23003 unsigned char (*header_ref)[80] = &header_arr;
23004 void* broadcaster_ptr = untag_ptr(broadcaster);
23005 CHECK_ACCESS(broadcaster_ptr);
23006 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23007 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23008 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23009 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23011 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23012 CHECK_ACCESS(fee_estimator_ptr);
23013 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23014 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23015 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23016 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23018 void* logger_ptr = untag_ptr(logger);
23019 CHECK_ACCESS(logger_ptr);
23020 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23021 if (logger_conv.free == LDKLogger_JCalls_free) {
23022 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23023 LDKLogger_JCalls_cloned(&logger_conv);
23025 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
23028 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) {
23029 LDKChannelMonitor this_arg_conv;
23030 this_arg_conv.inner = untag_ptr(this_arg);
23031 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23033 this_arg_conv.is_owned = false;
23034 unsigned char header_arr[80];
23035 CHECK(header->arr_len == 80);
23036 memcpy(header_arr, header->elems, 80); FREE(header);
23037 unsigned char (*header_ref)[80] = &header_arr;
23038 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
23039 txdata_constr.datalen = txdata->arr_len;
23040 if (txdata_constr.datalen > 0)
23041 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
23043 txdata_constr.data = NULL;
23044 uint64_t* txdata_vals = txdata->elems;
23045 for (size_t c = 0; c < txdata_constr.datalen; c++) {
23046 uint64_t txdata_conv_28 = txdata_vals[c];
23047 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
23048 CHECK_ACCESS(txdata_conv_28_ptr);
23049 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
23050 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
23051 txdata_constr.data[c] = txdata_conv_28_conv;
23054 void* broadcaster_ptr = untag_ptr(broadcaster);
23055 CHECK_ACCESS(broadcaster_ptr);
23056 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23057 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23058 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23059 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23061 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23062 CHECK_ACCESS(fee_estimator_ptr);
23063 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23064 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23065 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23066 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23068 void* logger_ptr = untag_ptr(logger);
23069 CHECK_ACCESS(logger_ptr);
23070 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23071 if (logger_conv.free == LDKLogger_JCalls_free) {
23072 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23073 LDKLogger_JCalls_cloned(&logger_conv);
23075 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);
23076 uint64_tArray ret_arr = NULL;
23077 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23078 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23079 for (size_t n = 0; n < ret_var.datalen; n++) {
23080 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23081 *ret_conv_39_conv = ret_var.data[n];
23082 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
23085 FREE(ret_var.data);
23089 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) {
23090 LDKChannelMonitor this_arg_conv;
23091 this_arg_conv.inner = untag_ptr(this_arg);
23092 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23094 this_arg_conv.is_owned = false;
23095 unsigned char txid_arr[32];
23096 CHECK(txid->arr_len == 32);
23097 memcpy(txid_arr, txid->elems, 32); FREE(txid);
23098 unsigned char (*txid_ref)[32] = &txid_arr;
23099 void* broadcaster_ptr = untag_ptr(broadcaster);
23100 CHECK_ACCESS(broadcaster_ptr);
23101 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23102 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23103 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23104 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23106 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23107 CHECK_ACCESS(fee_estimator_ptr);
23108 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23109 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23110 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23111 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23113 void* logger_ptr = untag_ptr(logger);
23114 CHECK_ACCESS(logger_ptr);
23115 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23116 if (logger_conv.free == LDKLogger_JCalls_free) {
23117 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23118 LDKLogger_JCalls_cloned(&logger_conv);
23120 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
23123 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) {
23124 LDKChannelMonitor this_arg_conv;
23125 this_arg_conv.inner = untag_ptr(this_arg);
23126 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23128 this_arg_conv.is_owned = false;
23129 unsigned char header_arr[80];
23130 CHECK(header->arr_len == 80);
23131 memcpy(header_arr, header->elems, 80); FREE(header);
23132 unsigned char (*header_ref)[80] = &header_arr;
23133 void* broadcaster_ptr = untag_ptr(broadcaster);
23134 CHECK_ACCESS(broadcaster_ptr);
23135 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23136 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23137 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23138 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23140 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23141 CHECK_ACCESS(fee_estimator_ptr);
23142 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23143 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23144 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23145 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23147 void* logger_ptr = untag_ptr(logger);
23148 CHECK_ACCESS(logger_ptr);
23149 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23150 if (logger_conv.free == LDKLogger_JCalls_free) {
23151 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23152 LDKLogger_JCalls_cloned(&logger_conv);
23154 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
23155 uint64_tArray ret_arr = NULL;
23156 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23157 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23158 for (size_t n = 0; n < ret_var.datalen; n++) {
23159 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23160 *ret_conv_39_conv = ret_var.data[n];
23161 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
23164 FREE(ret_var.data);
23168 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
23169 LDKChannelMonitor this_arg_conv;
23170 this_arg_conv.inner = untag_ptr(this_arg);
23171 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23172 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23173 this_arg_conv.is_owned = false;
23174 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
23175 ptrArray ret_arr = NULL;
23176 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
23177 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
23178 for (size_t m = 0; m < ret_var.datalen; m++) {
23179 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
23180 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
23181 ret_arr_ptr[m] = ret_conv_12_arr;
23184 FREE(ret_var.data);
23188 uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) {
23189 LDKChannelMonitor this_arg_conv;
23190 this_arg_conv.inner = untag_ptr(this_arg);
23191 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23193 this_arg_conv.is_owned = false;
23194 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
23195 uint64_t ret_ref = 0;
23196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23201 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) {
23202 LDKChannelMonitor this_arg_conv;
23203 this_arg_conv.inner = untag_ptr(this_arg);
23204 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23206 this_arg_conv.is_owned = false;
23207 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
23208 uint64_tArray ret_arr = NULL;
23209 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23210 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23211 for (size_t j = 0; j < ret_var.datalen; j++) {
23212 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23213 *ret_conv_9_copy = ret_var.data[j];
23214 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
23215 ret_arr_ptr[j] = ret_conv_9_ref;
23218 FREE(ret_var.data);
23222 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
23223 LDKu8slice ser_ref;
23224 ser_ref.datalen = ser->arr_len;
23225 ser_ref.data = ser->elems;
23226 void* arg_ptr = untag_ptr(arg);
23227 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23228 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
23229 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23230 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
23232 return tag_ptr(ret_conv, true);
23235 void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) {
23236 LDKOutPoint this_obj_conv;
23237 this_obj_conv.inner = untag_ptr(this_obj);
23238 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23240 OutPoint_free(this_obj_conv);
23243 int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) {
23244 LDKOutPoint this_ptr_conv;
23245 this_ptr_conv.inner = untag_ptr(this_ptr);
23246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23248 this_ptr_conv.is_owned = false;
23249 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23250 memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32);
23254 void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) {
23255 LDKOutPoint this_ptr_conv;
23256 this_ptr_conv.inner = untag_ptr(this_ptr);
23257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23259 this_ptr_conv.is_owned = false;
23260 LDKThirtyTwoBytes val_ref;
23261 CHECK(val->arr_len == 32);
23262 memcpy(val_ref.data, val->elems, 32); FREE(val);
23263 OutPoint_set_txid(&this_ptr_conv, val_ref);
23266 int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) {
23267 LDKOutPoint this_ptr_conv;
23268 this_ptr_conv.inner = untag_ptr(this_ptr);
23269 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23270 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23271 this_ptr_conv.is_owned = false;
23272 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
23276 void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) {
23277 LDKOutPoint this_ptr_conv;
23278 this_ptr_conv.inner = untag_ptr(this_ptr);
23279 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23281 this_ptr_conv.is_owned = false;
23282 OutPoint_set_index(&this_ptr_conv, val);
23285 uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
23286 LDKThirtyTwoBytes txid_arg_ref;
23287 CHECK(txid_arg->arr_len == 32);
23288 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
23289 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
23290 uint64_t ret_ref = 0;
23291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23296 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
23297 LDKOutPoint ret_var = OutPoint_clone(arg);
23298 uint64_t ret_ref = 0;
23299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23303 int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) {
23304 LDKOutPoint arg_conv;
23305 arg_conv.inner = untag_ptr(arg);
23306 arg_conv.is_owned = ptr_is_owned(arg);
23307 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23308 arg_conv.is_owned = false;
23309 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
23313 uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) {
23314 LDKOutPoint orig_conv;
23315 orig_conv.inner = untag_ptr(orig);
23316 orig_conv.is_owned = ptr_is_owned(orig);
23317 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23318 orig_conv.is_owned = false;
23319 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
23320 uint64_t ret_ref = 0;
23321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23326 jboolean __attribute__((export_name("TS_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) {
23327 LDKOutPoint a_conv;
23328 a_conv.inner = untag_ptr(a);
23329 a_conv.is_owned = ptr_is_owned(a);
23330 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23331 a_conv.is_owned = false;
23332 LDKOutPoint b_conv;
23333 b_conv.inner = untag_ptr(b);
23334 b_conv.is_owned = ptr_is_owned(b);
23335 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23336 b_conv.is_owned = false;
23337 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
23341 int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) {
23342 LDKOutPoint o_conv;
23343 o_conv.inner = untag_ptr(o);
23344 o_conv.is_owned = ptr_is_owned(o);
23345 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23346 o_conv.is_owned = false;
23347 int64_t ret_conv = OutPoint_hash(&o_conv);
23351 int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) {
23352 LDKOutPoint this_arg_conv;
23353 this_arg_conv.inner = untag_ptr(this_arg);
23354 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23356 this_arg_conv.is_owned = false;
23357 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23358 memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32);
23362 int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) {
23363 LDKOutPoint obj_conv;
23364 obj_conv.inner = untag_ptr(obj);
23365 obj_conv.is_owned = ptr_is_owned(obj);
23366 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23367 obj_conv.is_owned = false;
23368 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
23369 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23370 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23371 CVec_u8Z_free(ret_var);
23375 uint64_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
23376 LDKu8slice ser_ref;
23377 ser_ref.datalen = ser->arr_len;
23378 ser_ref.data = ser->elems;
23379 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
23380 *ret_conv = OutPoint_read(ser_ref);
23382 return tag_ptr(ret_conv, true);
23385 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint64_t this_obj) {
23386 LDKDelayedPaymentOutputDescriptor this_obj_conv;
23387 this_obj_conv.inner = untag_ptr(this_obj);
23388 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23390 DelayedPaymentOutputDescriptor_free(this_obj_conv);
23393 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outpoint"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23394 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23395 this_ptr_conv.inner = untag_ptr(this_ptr);
23396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23398 this_ptr_conv.is_owned = false;
23399 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23400 uint64_t ret_ref = 0;
23401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23406 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_outpoint"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23407 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23408 this_ptr_conv.inner = untag_ptr(this_ptr);
23409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23411 this_ptr_conv.is_owned = false;
23412 LDKOutPoint val_conv;
23413 val_conv.inner = untag_ptr(val);
23414 val_conv.is_owned = ptr_is_owned(val);
23415 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23416 val_conv = OutPoint_clone(&val_conv);
23417 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23420 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint64_t this_ptr) {
23421 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23422 this_ptr_conv.inner = untag_ptr(this_ptr);
23423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23425 this_ptr_conv.is_owned = false;
23426 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23427 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
23431 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
23432 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23433 this_ptr_conv.inner = untag_ptr(this_ptr);
23434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23436 this_ptr_conv.is_owned = false;
23437 LDKPublicKey val_ref;
23438 CHECK(val->arr_len == 33);
23439 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23440 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
23443 int16_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint64_t this_ptr) {
23444 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23445 this_ptr_conv.inner = untag_ptr(this_ptr);
23446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23448 this_ptr_conv.is_owned = false;
23449 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
23453 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint64_t this_ptr, int16_t val) {
23454 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23455 this_ptr_conv.inner = untag_ptr(this_ptr);
23456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23458 this_ptr_conv.is_owned = false;
23459 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
23462 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_output"))) TS_DelayedPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23463 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23464 this_ptr_conv.inner = untag_ptr(this_ptr);
23465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23467 this_ptr_conv.is_owned = false;
23468 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23469 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
23470 return tag_ptr(ret_ref, true);
23473 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output"))) TS_DelayedPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23474 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23475 this_ptr_conv.inner = untag_ptr(this_ptr);
23476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23478 this_ptr_conv.is_owned = false;
23479 void* val_ptr = untag_ptr(val);
23480 CHECK_ACCESS(val_ptr);
23481 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23482 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23483 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23486 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint64_t this_ptr) {
23487 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23488 this_ptr_conv.inner = untag_ptr(this_ptr);
23489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23491 this_ptr_conv.is_owned = false;
23492 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23493 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
23497 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint64_t this_ptr, int8_tArray val) {
23498 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23499 this_ptr_conv.inner = untag_ptr(this_ptr);
23500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23502 this_ptr_conv.is_owned = false;
23503 LDKPublicKey val_ref;
23504 CHECK(val->arr_len == 33);
23505 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23506 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
23509 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23510 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23511 this_ptr_conv.inner = untag_ptr(this_ptr);
23512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23514 this_ptr_conv.is_owned = false;
23515 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23516 memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23520 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23521 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23522 this_ptr_conv.inner = untag_ptr(this_ptr);
23523 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23525 this_ptr_conv.is_owned = false;
23526 LDKThirtyTwoBytes val_ref;
23527 CHECK(val->arr_len == 32);
23528 memcpy(val_ref.data, val->elems, 32); FREE(val);
23529 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23532 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23533 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23534 this_ptr_conv.inner = untag_ptr(this_ptr);
23535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23537 this_ptr_conv.is_owned = false;
23538 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23542 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23543 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23544 this_ptr_conv.inner = untag_ptr(this_ptr);
23545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23547 this_ptr_conv.is_owned = false;
23548 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23551 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) {
23552 LDKOutPoint outpoint_arg_conv;
23553 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23554 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23555 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23556 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23557 LDKPublicKey per_commitment_point_arg_ref;
23558 CHECK(per_commitment_point_arg->arr_len == 33);
23559 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
23560 void* output_arg_ptr = untag_ptr(output_arg);
23561 CHECK_ACCESS(output_arg_ptr);
23562 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23563 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23564 LDKPublicKey revocation_pubkey_arg_ref;
23565 CHECK(revocation_pubkey_arg->arr_len == 33);
23566 memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg);
23567 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23568 CHECK(channel_keys_id_arg->arr_len == 32);
23569 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23570 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);
23571 uint64_t ret_ref = 0;
23572 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23573 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23577 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
23578 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
23579 uint64_t ret_ref = 0;
23580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23584 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23585 LDKDelayedPaymentOutputDescriptor arg_conv;
23586 arg_conv.inner = untag_ptr(arg);
23587 arg_conv.is_owned = ptr_is_owned(arg);
23588 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23589 arg_conv.is_owned = false;
23590 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
23594 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone"))) TS_DelayedPaymentOutputDescriptor_clone(uint64_t orig) {
23595 LDKDelayedPaymentOutputDescriptor orig_conv;
23596 orig_conv.inner = untag_ptr(orig);
23597 orig_conv.is_owned = ptr_is_owned(orig);
23598 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23599 orig_conv.is_owned = false;
23600 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
23601 uint64_t ret_ref = 0;
23602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23607 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
23608 LDKDelayedPaymentOutputDescriptor obj_conv;
23609 obj_conv.inner = untag_ptr(obj);
23610 obj_conv.is_owned = ptr_is_owned(obj);
23611 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23612 obj_conv.is_owned = false;
23613 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
23614 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23615 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23616 CVec_u8Z_free(ret_var);
23620 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
23621 LDKu8slice ser_ref;
23622 ser_ref.datalen = ser->arr_len;
23623 ser_ref.data = ser->elems;
23624 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
23625 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
23627 return tag_ptr(ret_conv, true);
23630 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint64_t this_obj) {
23631 LDKStaticPaymentOutputDescriptor this_obj_conv;
23632 this_obj_conv.inner = untag_ptr(this_obj);
23633 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23635 StaticPaymentOutputDescriptor_free(this_obj_conv);
23638 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpoint"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23639 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23640 this_ptr_conv.inner = untag_ptr(this_ptr);
23641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23643 this_ptr_conv.is_owned = false;
23644 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23645 uint64_t ret_ref = 0;
23646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23651 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_outpoint"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23652 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23653 this_ptr_conv.inner = untag_ptr(this_ptr);
23654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23656 this_ptr_conv.is_owned = false;
23657 LDKOutPoint val_conv;
23658 val_conv.inner = untag_ptr(val);
23659 val_conv.is_owned = ptr_is_owned(val);
23660 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23661 val_conv = OutPoint_clone(&val_conv);
23662 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23665 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_output"))) TS_StaticPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23666 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23667 this_ptr_conv.inner = untag_ptr(this_ptr);
23668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23670 this_ptr_conv.is_owned = false;
23671 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23672 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
23673 return tag_ptr(ret_ref, true);
23676 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output"))) TS_StaticPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23677 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23678 this_ptr_conv.inner = untag_ptr(this_ptr);
23679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23681 this_ptr_conv.is_owned = false;
23682 void* val_ptr = untag_ptr(val);
23683 CHECK_ACCESS(val_ptr);
23684 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23685 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23686 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23689 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23690 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23691 this_ptr_conv.inner = untag_ptr(this_ptr);
23692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23694 this_ptr_conv.is_owned = false;
23695 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23696 memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23700 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23701 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23702 this_ptr_conv.inner = untag_ptr(this_ptr);
23703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23705 this_ptr_conv.is_owned = false;
23706 LDKThirtyTwoBytes val_ref;
23707 CHECK(val->arr_len == 32);
23708 memcpy(val_ref.data, val->elems, 32); FREE(val);
23709 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23712 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23713 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23714 this_ptr_conv.inner = untag_ptr(this_ptr);
23715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23717 this_ptr_conv.is_owned = false;
23718 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23722 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23723 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23724 this_ptr_conv.inner = untag_ptr(this_ptr);
23725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23727 this_ptr_conv.is_owned = false;
23728 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23731 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) {
23732 LDKOutPoint outpoint_arg_conv;
23733 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23734 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23735 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23736 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23737 void* output_arg_ptr = untag_ptr(output_arg);
23738 CHECK_ACCESS(output_arg_ptr);
23739 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23740 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23741 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23742 CHECK(channel_keys_id_arg->arr_len == 32);
23743 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23744 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
23745 uint64_t ret_ref = 0;
23746 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23747 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23751 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
23752 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
23753 uint64_t ret_ref = 0;
23754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23758 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23759 LDKStaticPaymentOutputDescriptor arg_conv;
23760 arg_conv.inner = untag_ptr(arg);
23761 arg_conv.is_owned = ptr_is_owned(arg);
23762 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23763 arg_conv.is_owned = false;
23764 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
23768 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) TS_StaticPaymentOutputDescriptor_clone(uint64_t orig) {
23769 LDKStaticPaymentOutputDescriptor orig_conv;
23770 orig_conv.inner = untag_ptr(orig);
23771 orig_conv.is_owned = ptr_is_owned(orig);
23772 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23773 orig_conv.is_owned = false;
23774 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
23775 uint64_t ret_ref = 0;
23776 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23777 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23781 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
23782 LDKStaticPaymentOutputDescriptor obj_conv;
23783 obj_conv.inner = untag_ptr(obj);
23784 obj_conv.is_owned = ptr_is_owned(obj);
23785 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23786 obj_conv.is_owned = false;
23787 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
23788 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23789 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23790 CVec_u8Z_free(ret_var);
23794 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
23795 LDKu8slice ser_ref;
23796 ser_ref.datalen = ser->arr_len;
23797 ser_ref.data = ser->elems;
23798 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
23799 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
23801 return tag_ptr(ret_conv, true);
23804 void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint64_t this_ptr) {
23805 if (!ptr_is_owned(this_ptr)) return;
23806 void* this_ptr_ptr = untag_ptr(this_ptr);
23807 CHECK_ACCESS(this_ptr_ptr);
23808 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
23809 FREE(untag_ptr(this_ptr));
23810 SpendableOutputDescriptor_free(this_ptr_conv);
23813 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
23814 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23815 *ret_copy = SpendableOutputDescriptor_clone(arg);
23816 uint64_t ret_ref = tag_ptr(ret_copy, true);
23819 int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint64_t arg) {
23820 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
23821 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
23825 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_SpendableOutputDescriptor_clone(uint64_t orig) {
23826 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
23827 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23828 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
23829 uint64_t ret_ref = tag_ptr(ret_copy, true);
23833 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output"))) TS_SpendableOutputDescriptor_static_output(uint64_t outpoint, uint64_t output) {
23834 LDKOutPoint outpoint_conv;
23835 outpoint_conv.inner = untag_ptr(outpoint);
23836 outpoint_conv.is_owned = ptr_is_owned(outpoint);
23837 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
23838 outpoint_conv = OutPoint_clone(&outpoint_conv);
23839 void* output_ptr = untag_ptr(output);
23840 CHECK_ACCESS(output_ptr);
23841 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
23842 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
23843 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23844 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
23845 uint64_t ret_ref = tag_ptr(ret_copy, true);
23849 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payment_output"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint64_t a) {
23850 LDKDelayedPaymentOutputDescriptor a_conv;
23851 a_conv.inner = untag_ptr(a);
23852 a_conv.is_owned = ptr_is_owned(a);
23853 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23854 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
23855 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23856 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
23857 uint64_t ret_ref = tag_ptr(ret_copy, true);
23861 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_payment_output"))) TS_SpendableOutputDescriptor_static_payment_output(uint64_t a) {
23862 LDKStaticPaymentOutputDescriptor a_conv;
23863 a_conv.inner = untag_ptr(a);
23864 a_conv.is_owned = ptr_is_owned(a);
23865 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23866 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
23867 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23868 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
23869 uint64_t ret_ref = tag_ptr(ret_copy, true);
23873 int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
23874 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
23875 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
23876 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23877 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23878 CVec_u8Z_free(ret_var);
23882 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
23883 LDKu8slice ser_ref;
23884 ser_ref.datalen = ser->arr_len;
23885 ser_ref.data = ser->elems;
23886 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
23887 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
23889 return tag_ptr(ret_conv, true);
23892 void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
23893 if (!ptr_is_owned(this_ptr)) return;
23894 void* this_ptr_ptr = untag_ptr(this_ptr);
23895 CHECK_ACCESS(this_ptr_ptr);
23896 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
23897 FREE(untag_ptr(this_ptr));
23898 BaseSign_free(this_ptr_conv);
23901 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
23902 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23903 *ret_ret = Sign_clone(arg);
23904 return tag_ptr(ret_ret, true);
23906 int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
23907 void* arg_ptr = untag_ptr(arg);
23908 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23909 LDKSign* arg_conv = (LDKSign*)arg_ptr;
23910 int64_t ret_conv = Sign_clone_ptr(arg_conv);
23914 uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
23915 void* orig_ptr = untag_ptr(orig);
23916 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
23917 LDKSign* orig_conv = (LDKSign*)orig_ptr;
23918 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23919 *ret_ret = Sign_clone(orig_conv);
23920 return tag_ptr(ret_ret, true);
23923 void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
23924 if (!ptr_is_owned(this_ptr)) return;
23925 void* this_ptr_ptr = untag_ptr(this_ptr);
23926 CHECK_ACCESS(this_ptr_ptr);
23927 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
23928 FREE(untag_ptr(this_ptr));
23929 Sign_free(this_ptr_conv);
23932 uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
23933 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
23934 uint32_t ret_conv = LDKRecipient_to_js(Recipient_clone(orig_conv));
23938 uint32_t __attribute__((export_name("TS_Recipient_node"))) TS_Recipient_node() {
23939 uint32_t ret_conv = LDKRecipient_to_js(Recipient_node());
23943 uint32_t __attribute__((export_name("TS_Recipient_phantom_node"))) TS_Recipient_phantom_node() {
23944 uint32_t ret_conv = LDKRecipient_to_js(Recipient_phantom_node());
23948 void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
23949 if (!ptr_is_owned(this_ptr)) return;
23950 void* this_ptr_ptr = untag_ptr(this_ptr);
23951 CHECK_ACCESS(this_ptr_ptr);
23952 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
23953 FREE(untag_ptr(this_ptr));
23954 KeysInterface_free(this_ptr_conv);
23957 void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
23958 LDKInMemorySigner this_obj_conv;
23959 this_obj_conv.inner = untag_ptr(this_obj);
23960 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23962 InMemorySigner_free(this_obj_conv);
23965 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) TS_InMemorySigner_get_funding_key(uint64_t this_ptr) {
23966 LDKInMemorySigner this_ptr_conv;
23967 this_ptr_conv.inner = untag_ptr(this_ptr);
23968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23970 this_ptr_conv.is_owned = false;
23971 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23972 memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
23976 void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMemorySigner_set_funding_key(uint64_t this_ptr, int8_tArray val) {
23977 LDKInMemorySigner this_ptr_conv;
23978 this_ptr_conv.inner = untag_ptr(this_ptr);
23979 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23980 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23981 this_ptr_conv.is_owned = false;
23982 LDKSecretKey val_ref;
23983 CHECK(val->arr_len == 32);
23984 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23985 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
23988 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_key"))) TS_InMemorySigner_get_revocation_base_key(uint64_t this_ptr) {
23989 LDKInMemorySigner this_ptr_conv;
23990 this_ptr_conv.inner = untag_ptr(this_ptr);
23991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23993 this_ptr_conv.is_owned = false;
23994 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23995 memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
23999 void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) TS_InMemorySigner_set_revocation_base_key(uint64_t this_ptr, int8_tArray val) {
24000 LDKInMemorySigner this_ptr_conv;
24001 this_ptr_conv.inner = untag_ptr(this_ptr);
24002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24004 this_ptr_conv.is_owned = false;
24005 LDKSecretKey val_ref;
24006 CHECK(val->arr_len == 32);
24007 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24008 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
24011 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) TS_InMemorySigner_get_payment_key(uint64_t this_ptr) {
24012 LDKInMemorySigner this_ptr_conv;
24013 this_ptr_conv.inner = untag_ptr(this_ptr);
24014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24016 this_ptr_conv.is_owned = false;
24017 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24018 memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
24022 void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMemorySigner_set_payment_key(uint64_t this_ptr, int8_tArray val) {
24023 LDKInMemorySigner this_ptr_conv;
24024 this_ptr_conv.inner = untag_ptr(this_ptr);
24025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24027 this_ptr_conv.is_owned = false;
24028 LDKSecretKey val_ref;
24029 CHECK(val->arr_len == 32);
24030 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24031 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
24034 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_base_key"))) TS_InMemorySigner_get_delayed_payment_base_key(uint64_t this_ptr) {
24035 LDKInMemorySigner this_ptr_conv;
24036 this_ptr_conv.inner = untag_ptr(this_ptr);
24037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24039 this_ptr_conv.is_owned = false;
24040 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24041 memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
24045 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) {
24046 LDKInMemorySigner this_ptr_conv;
24047 this_ptr_conv.inner = untag_ptr(this_ptr);
24048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24050 this_ptr_conv.is_owned = false;
24051 LDKSecretKey val_ref;
24052 CHECK(val->arr_len == 32);
24053 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24054 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
24057 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) TS_InMemorySigner_get_htlc_base_key(uint64_t this_ptr) {
24058 LDKInMemorySigner this_ptr_conv;
24059 this_ptr_conv.inner = untag_ptr(this_ptr);
24060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24062 this_ptr_conv.is_owned = false;
24063 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24064 memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
24068 void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InMemorySigner_set_htlc_base_key(uint64_t this_ptr, int8_tArray val) {
24069 LDKInMemorySigner this_ptr_conv;
24070 this_ptr_conv.inner = untag_ptr(this_ptr);
24071 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24073 this_ptr_conv.is_owned = false;
24074 LDKSecretKey val_ref;
24075 CHECK(val->arr_len == 32);
24076 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24077 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
24080 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed"))) TS_InMemorySigner_get_commitment_seed(uint64_t this_ptr) {
24081 LDKInMemorySigner this_ptr_conv;
24082 this_ptr_conv.inner = untag_ptr(this_ptr);
24083 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24085 this_ptr_conv.is_owned = false;
24086 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24087 memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
24091 void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_InMemorySigner_set_commitment_seed(uint64_t this_ptr, int8_tArray val) {
24092 LDKInMemorySigner this_ptr_conv;
24093 this_ptr_conv.inner = untag_ptr(this_ptr);
24094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24096 this_ptr_conv.is_owned = false;
24097 LDKThirtyTwoBytes val_ref;
24098 CHECK(val->arr_len == 32);
24099 memcpy(val_ref.data, val->elems, 32); FREE(val);
24100 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
24103 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
24104 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
24105 uint64_t ret_ref = 0;
24106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24110 int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint64_t arg) {
24111 LDKInMemorySigner arg_conv;
24112 arg_conv.inner = untag_ptr(arg);
24113 arg_conv.is_owned = ptr_is_owned(arg);
24114 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24115 arg_conv.is_owned = false;
24116 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
24120 uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySigner_clone(uint64_t orig) {
24121 LDKInMemorySigner orig_conv;
24122 orig_conv.inner = untag_ptr(orig);
24123 orig_conv.is_owned = ptr_is_owned(orig);
24124 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24125 orig_conv.is_owned = false;
24126 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
24127 uint64_t ret_ref = 0;
24128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24133 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) {
24134 LDKSecretKey node_secret_ref;
24135 CHECK(node_secret->arr_len == 32);
24136 memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
24137 LDKSecretKey funding_key_ref;
24138 CHECK(funding_key->arr_len == 32);
24139 memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
24140 LDKSecretKey revocation_base_key_ref;
24141 CHECK(revocation_base_key->arr_len == 32);
24142 memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key);
24143 LDKSecretKey payment_key_ref;
24144 CHECK(payment_key->arr_len == 32);
24145 memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key);
24146 LDKSecretKey delayed_payment_base_key_ref;
24147 CHECK(delayed_payment_base_key->arr_len == 32);
24148 memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key);
24149 LDKSecretKey htlc_base_key_ref;
24150 CHECK(htlc_base_key->arr_len == 32);
24151 memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key);
24152 LDKThirtyTwoBytes commitment_seed_ref;
24153 CHECK(commitment_seed->arr_len == 32);
24154 memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed);
24155 LDKThirtyTwoBytes channel_keys_id_ref;
24156 CHECK(channel_keys_id->arr_len == 32);
24157 memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
24158 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);
24159 uint64_t ret_ref = 0;
24160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24165 uint64_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) TS_InMemorySigner_counterparty_pubkeys(uint64_t this_arg) {
24166 LDKInMemorySigner this_arg_conv;
24167 this_arg_conv.inner = untag_ptr(this_arg);
24168 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24170 this_arg_conv.is_owned = false;
24171 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
24172 uint64_t ret_ref = 0;
24173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24178 int16_t __attribute__((export_name("TS_InMemorySigner_counterparty_selected_contest_delay"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint64_t this_arg) {
24179 LDKInMemorySigner this_arg_conv;
24180 this_arg_conv.inner = untag_ptr(this_arg);
24181 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24183 this_arg_conv.is_owned = false;
24184 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
24188 int16_t __attribute__((export_name("TS_InMemorySigner_holder_selected_contest_delay"))) TS_InMemorySigner_holder_selected_contest_delay(uint64_t this_arg) {
24189 LDKInMemorySigner this_arg_conv;
24190 this_arg_conv.inner = untag_ptr(this_arg);
24191 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24193 this_arg_conv.is_owned = false;
24194 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
24198 jboolean __attribute__((export_name("TS_InMemorySigner_is_outbound"))) TS_InMemorySigner_is_outbound(uint64_t this_arg) {
24199 LDKInMemorySigner this_arg_conv;
24200 this_arg_conv.inner = untag_ptr(this_arg);
24201 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24203 this_arg_conv.is_owned = false;
24204 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
24208 uint64_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_InMemorySigner_funding_outpoint(uint64_t this_arg) {
24209 LDKInMemorySigner this_arg_conv;
24210 this_arg_conv.inner = untag_ptr(this_arg);
24211 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24213 this_arg_conv.is_owned = false;
24214 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
24215 uint64_t ret_ref = 0;
24216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24221 uint64_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters"))) TS_InMemorySigner_get_channel_parameters(uint64_t this_arg) {
24222 LDKInMemorySigner this_arg_conv;
24223 this_arg_conv.inner = untag_ptr(this_arg);
24224 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24226 this_arg_conv.is_owned = false;
24227 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
24228 uint64_t ret_ref = 0;
24229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24234 jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMemorySigner_opt_anchors(uint64_t this_arg) {
24235 LDKInMemorySigner this_arg_conv;
24236 this_arg_conv.inner = untag_ptr(this_arg);
24237 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24239 this_arg_conv.is_owned = false;
24240 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
24244 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) {
24245 LDKInMemorySigner this_arg_conv;
24246 this_arg_conv.inner = untag_ptr(this_arg);
24247 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24249 this_arg_conv.is_owned = false;
24250 LDKTransaction spend_tx_ref;
24251 spend_tx_ref.datalen = spend_tx->arr_len;
24252 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24253 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24254 spend_tx_ref.data_is_owned = true;
24255 LDKStaticPaymentOutputDescriptor descriptor_conv;
24256 descriptor_conv.inner = untag_ptr(descriptor);
24257 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24258 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24259 descriptor_conv.is_owned = false;
24260 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24261 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24262 return tag_ptr(ret_conv, true);
24265 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) {
24266 LDKInMemorySigner this_arg_conv;
24267 this_arg_conv.inner = untag_ptr(this_arg);
24268 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24270 this_arg_conv.is_owned = false;
24271 LDKTransaction spend_tx_ref;
24272 spend_tx_ref.datalen = spend_tx->arr_len;
24273 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24274 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24275 spend_tx_ref.data_is_owned = true;
24276 LDKDelayedPaymentOutputDescriptor descriptor_conv;
24277 descriptor_conv.inner = untag_ptr(descriptor);
24278 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24279 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24280 descriptor_conv.is_owned = false;
24281 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24282 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24283 return tag_ptr(ret_conv, true);
24286 uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
24287 LDKInMemorySigner this_arg_conv;
24288 this_arg_conv.inner = untag_ptr(this_arg);
24289 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24291 this_arg_conv.is_owned = false;
24292 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
24293 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
24294 return tag_ptr(ret_ret, true);
24297 uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
24298 LDKInMemorySigner this_arg_conv;
24299 this_arg_conv.inner = untag_ptr(this_arg);
24300 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24302 this_arg_conv.is_owned = false;
24303 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
24304 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
24305 return tag_ptr(ret_ret, true);
24308 int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint64_t obj) {
24309 LDKInMemorySigner obj_conv;
24310 obj_conv.inner = untag_ptr(obj);
24311 obj_conv.is_owned = ptr_is_owned(obj);
24312 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24313 obj_conv.is_owned = false;
24314 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
24315 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24316 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24317 CVec_u8Z_free(ret_var);
24321 uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
24322 LDKu8slice ser_ref;
24323 ser_ref.datalen = ser->arr_len;
24324 ser_ref.data = ser->elems;
24325 LDKSecretKey arg_ref;
24326 CHECK(arg->arr_len == 32);
24327 memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
24328 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
24329 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
24331 return tag_ptr(ret_conv, true);
24334 void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint64_t this_obj) {
24335 LDKKeysManager this_obj_conv;
24336 this_obj_conv.inner = untag_ptr(this_obj);
24337 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24339 KeysManager_free(this_obj_conv);
24342 uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
24343 unsigned char seed_arr[32];
24344 CHECK(seed->arr_len == 32);
24345 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24346 unsigned char (*seed_ref)[32] = &seed_arr;
24347 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
24348 uint64_t ret_ref = 0;
24349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24354 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) {
24355 LDKKeysManager 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 unsigned char params_arr[32];
24361 CHECK(params->arr_len == 32);
24362 memcpy(params_arr, params->elems, 32); FREE(params);
24363 unsigned char (*params_ref)[32] = ¶ms_arr;
24364 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24365 uint64_t ret_ref = 0;
24366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24371 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) {
24372 LDKKeysManager this_arg_conv;
24373 this_arg_conv.inner = untag_ptr(this_arg);
24374 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24376 this_arg_conv.is_owned = false;
24377 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24378 descriptors_constr.datalen = descriptors->arr_len;
24379 if (descriptors_constr.datalen > 0)
24380 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24382 descriptors_constr.data = NULL;
24383 uint64_t* descriptors_vals = descriptors->elems;
24384 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24385 uint64_t descriptors_conv_27 = descriptors_vals[b];
24386 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24387 CHECK_ACCESS(descriptors_conv_27_ptr);
24388 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24389 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24390 descriptors_constr.data[b] = descriptors_conv_27_conv;
24393 LDKCVec_TxOutZ outputs_constr;
24394 outputs_constr.datalen = outputs->arr_len;
24395 if (outputs_constr.datalen > 0)
24396 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24398 outputs_constr.data = NULL;
24399 uint64_t* outputs_vals = outputs->elems;
24400 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24401 uint64_t outputs_conv_7 = outputs_vals[h];
24402 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24403 CHECK_ACCESS(outputs_conv_7_ptr);
24404 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24405 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24406 outputs_constr.data[h] = outputs_conv_7_conv;
24409 LDKCVec_u8Z change_destination_script_ref;
24410 change_destination_script_ref.datalen = change_destination_script->arr_len;
24411 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24412 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24413 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24414 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24415 return tag_ptr(ret_conv, true);
24418 uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
24419 LDKKeysManager this_arg_conv;
24420 this_arg_conv.inner = untag_ptr(this_arg);
24421 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24423 this_arg_conv.is_owned = false;
24424 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24425 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
24426 return tag_ptr(ret_ret, true);
24429 void __attribute__((export_name("TS_PhantomKeysManager_free"))) TS_PhantomKeysManager_free(uint64_t this_obj) {
24430 LDKPhantomKeysManager this_obj_conv;
24431 this_obj_conv.inner = untag_ptr(this_obj);
24432 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24434 PhantomKeysManager_free(this_obj_conv);
24437 uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
24438 LDKPhantomKeysManager this_arg_conv;
24439 this_arg_conv.inner = untag_ptr(this_arg);
24440 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24442 this_arg_conv.is_owned = false;
24443 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24444 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
24445 return tag_ptr(ret_ret, true);
24448 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) {
24449 unsigned char seed_arr[32];
24450 CHECK(seed->arr_len == 32);
24451 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24452 unsigned char (*seed_ref)[32] = &seed_arr;
24453 unsigned char cross_node_seed_arr[32];
24454 CHECK(cross_node_seed->arr_len == 32);
24455 memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
24456 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
24457 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
24458 uint64_t ret_ref = 0;
24459 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24460 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24464 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) {
24465 LDKPhantomKeysManager this_arg_conv;
24466 this_arg_conv.inner = untag_ptr(this_arg);
24467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24469 this_arg_conv.is_owned = false;
24470 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24471 descriptors_constr.datalen = descriptors->arr_len;
24472 if (descriptors_constr.datalen > 0)
24473 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24475 descriptors_constr.data = NULL;
24476 uint64_t* descriptors_vals = descriptors->elems;
24477 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24478 uint64_t descriptors_conv_27 = descriptors_vals[b];
24479 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24480 CHECK_ACCESS(descriptors_conv_27_ptr);
24481 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24482 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24483 descriptors_constr.data[b] = descriptors_conv_27_conv;
24486 LDKCVec_TxOutZ outputs_constr;
24487 outputs_constr.datalen = outputs->arr_len;
24488 if (outputs_constr.datalen > 0)
24489 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24491 outputs_constr.data = NULL;
24492 uint64_t* outputs_vals = outputs->elems;
24493 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24494 uint64_t outputs_conv_7 = outputs_vals[h];
24495 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24496 CHECK_ACCESS(outputs_conv_7_ptr);
24497 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24498 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24499 outputs_constr.data[h] = outputs_conv_7_conv;
24502 LDKCVec_u8Z change_destination_script_ref;
24503 change_destination_script_ref.datalen = change_destination_script->arr_len;
24504 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24505 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24506 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24507 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24508 return tag_ptr(ret_conv, true);
24511 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) {
24512 LDKPhantomKeysManager this_arg_conv;
24513 this_arg_conv.inner = untag_ptr(this_arg);
24514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24516 this_arg_conv.is_owned = false;
24517 unsigned char params_arr[32];
24518 CHECK(params->arr_len == 32);
24519 memcpy(params_arr, params->elems, 32); FREE(params);
24520 unsigned char (*params_ref)[32] = ¶ms_arr;
24521 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24522 uint64_t ret_ref = 0;
24523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24528 void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
24529 LDKChannelManager this_obj_conv;
24530 this_obj_conv.inner = untag_ptr(this_obj);
24531 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24533 ChannelManager_free(this_obj_conv);
24536 void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) {
24537 LDKChainParameters this_obj_conv;
24538 this_obj_conv.inner = untag_ptr(this_obj);
24539 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24541 ChainParameters_free(this_obj_conv);
24544 uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) {
24545 LDKChainParameters this_ptr_conv;
24546 this_ptr_conv.inner = untag_ptr(this_ptr);
24547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24549 this_ptr_conv.is_owned = false;
24550 uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv));
24554 void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) {
24555 LDKChainParameters this_ptr_conv;
24556 this_ptr_conv.inner = untag_ptr(this_ptr);
24557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24559 this_ptr_conv.is_owned = false;
24560 LDKNetwork val_conv = LDKNetwork_from_js(val);
24561 ChainParameters_set_network(&this_ptr_conv, val_conv);
24564 uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) {
24565 LDKChainParameters this_ptr_conv;
24566 this_ptr_conv.inner = untag_ptr(this_ptr);
24567 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24569 this_ptr_conv.is_owned = false;
24570 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
24571 uint64_t ret_ref = 0;
24572 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24573 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24577 void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) {
24578 LDKChainParameters this_ptr_conv;
24579 this_ptr_conv.inner = untag_ptr(this_ptr);
24580 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24582 this_ptr_conv.is_owned = false;
24583 LDKBestBlock val_conv;
24584 val_conv.inner = untag_ptr(val);
24585 val_conv.is_owned = ptr_is_owned(val);
24586 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24587 val_conv = BestBlock_clone(&val_conv);
24588 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
24591 uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) {
24592 LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg);
24593 LDKBestBlock best_block_arg_conv;
24594 best_block_arg_conv.inner = untag_ptr(best_block_arg);
24595 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
24596 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
24597 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
24598 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
24599 uint64_t ret_ref = 0;
24600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24605 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
24606 LDKChainParameters ret_var = ChainParameters_clone(arg);
24607 uint64_t ret_ref = 0;
24608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24612 int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) {
24613 LDKChainParameters arg_conv;
24614 arg_conv.inner = untag_ptr(arg);
24615 arg_conv.is_owned = ptr_is_owned(arg);
24616 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24617 arg_conv.is_owned = false;
24618 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
24622 uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) {
24623 LDKChainParameters orig_conv;
24624 orig_conv.inner = untag_ptr(orig);
24625 orig_conv.is_owned = ptr_is_owned(orig);
24626 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24627 orig_conv.is_owned = false;
24628 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
24629 uint64_t ret_ref = 0;
24630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24635 void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) {
24636 LDKCounterpartyForwardingInfo this_obj_conv;
24637 this_obj_conv.inner = untag_ptr(this_obj);
24638 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24640 CounterpartyForwardingInfo_free(this_obj_conv);
24643 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) {
24644 LDKCounterpartyForwardingInfo this_ptr_conv;
24645 this_ptr_conv.inner = untag_ptr(this_ptr);
24646 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24648 this_ptr_conv.is_owned = false;
24649 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
24653 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
24654 LDKCounterpartyForwardingInfo this_ptr_conv;
24655 this_ptr_conv.inner = untag_ptr(this_ptr);
24656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24658 this_ptr_conv.is_owned = false;
24659 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
24662 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) {
24663 LDKCounterpartyForwardingInfo this_ptr_conv;
24664 this_ptr_conv.inner = untag_ptr(this_ptr);
24665 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24667 this_ptr_conv.is_owned = false;
24668 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
24672 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
24673 LDKCounterpartyForwardingInfo 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 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
24681 int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
24682 LDKCounterpartyForwardingInfo this_ptr_conv;
24683 this_ptr_conv.inner = untag_ptr(this_ptr);
24684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24686 this_ptr_conv.is_owned = false;
24687 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
24691 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
24692 LDKCounterpartyForwardingInfo this_ptr_conv;
24693 this_ptr_conv.inner = untag_ptr(this_ptr);
24694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24696 this_ptr_conv.is_owned = false;
24697 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
24700 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) {
24701 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
24702 uint64_t ret_ref = 0;
24703 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24704 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24708 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
24709 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
24710 uint64_t ret_ref = 0;
24711 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24712 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24715 int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) {
24716 LDKCounterpartyForwardingInfo arg_conv;
24717 arg_conv.inner = untag_ptr(arg);
24718 arg_conv.is_owned = ptr_is_owned(arg);
24719 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24720 arg_conv.is_owned = false;
24721 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
24725 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) {
24726 LDKCounterpartyForwardingInfo orig_conv;
24727 orig_conv.inner = untag_ptr(orig);
24728 orig_conv.is_owned = ptr_is_owned(orig);
24729 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24730 orig_conv.is_owned = false;
24731 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
24732 uint64_t ret_ref = 0;
24733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24738 void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) {
24739 LDKChannelCounterparty this_obj_conv;
24740 this_obj_conv.inner = untag_ptr(this_obj);
24741 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24743 ChannelCounterparty_free(this_obj_conv);
24746 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) {
24747 LDKChannelCounterparty this_ptr_conv;
24748 this_ptr_conv.inner = untag_ptr(this_ptr);
24749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24751 this_ptr_conv.is_owned = false;
24752 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24753 memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
24757 void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) {
24758 LDKChannelCounterparty this_ptr_conv;
24759 this_ptr_conv.inner = untag_ptr(this_ptr);
24760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24762 this_ptr_conv.is_owned = false;
24763 LDKPublicKey val_ref;
24764 CHECK(val->arr_len == 33);
24765 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24766 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
24769 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) {
24770 LDKChannelCounterparty this_ptr_conv;
24771 this_ptr_conv.inner = untag_ptr(this_ptr);
24772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24774 this_ptr_conv.is_owned = false;
24775 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
24776 uint64_t ret_ref = 0;
24777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24782 void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) {
24783 LDKChannelCounterparty this_ptr_conv;
24784 this_ptr_conv.inner = untag_ptr(this_ptr);
24785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24787 this_ptr_conv.is_owned = false;
24788 LDKInitFeatures val_conv;
24789 val_conv.inner = untag_ptr(val);
24790 val_conv.is_owned = ptr_is_owned(val);
24791 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24792 val_conv = InitFeatures_clone(&val_conv);
24793 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
24796 int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) {
24797 LDKChannelCounterparty this_ptr_conv;
24798 this_ptr_conv.inner = untag_ptr(this_ptr);
24799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24801 this_ptr_conv.is_owned = false;
24802 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
24806 void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) {
24807 LDKChannelCounterparty this_ptr_conv;
24808 this_ptr_conv.inner = untag_ptr(this_ptr);
24809 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24811 this_ptr_conv.is_owned = false;
24812 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
24815 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) {
24816 LDKChannelCounterparty this_ptr_conv;
24817 this_ptr_conv.inner = untag_ptr(this_ptr);
24818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24820 this_ptr_conv.is_owned = false;
24821 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
24822 uint64_t ret_ref = 0;
24823 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24824 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24828 void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) {
24829 LDKChannelCounterparty this_ptr_conv;
24830 this_ptr_conv.inner = untag_ptr(this_ptr);
24831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24833 this_ptr_conv.is_owned = false;
24834 LDKCounterpartyForwardingInfo val_conv;
24835 val_conv.inner = untag_ptr(val);
24836 val_conv.is_owned = ptr_is_owned(val);
24837 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24838 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
24839 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
24842 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) {
24843 LDKChannelCounterparty this_ptr_conv;
24844 this_ptr_conv.inner = untag_ptr(this_ptr);
24845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24847 this_ptr_conv.is_owned = false;
24848 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24849 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
24850 uint64_t ret_ref = tag_ptr(ret_copy, true);
24854 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) {
24855 LDKChannelCounterparty this_ptr_conv;
24856 this_ptr_conv.inner = untag_ptr(this_ptr);
24857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24859 this_ptr_conv.is_owned = false;
24860 void* val_ptr = untag_ptr(val);
24861 CHECK_ACCESS(val_ptr);
24862 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24863 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24864 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
24867 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) {
24868 LDKChannelCounterparty this_ptr_conv;
24869 this_ptr_conv.inner = untag_ptr(this_ptr);
24870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24872 this_ptr_conv.is_owned = false;
24873 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24874 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
24875 uint64_t ret_ref = tag_ptr(ret_copy, true);
24879 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) {
24880 LDKChannelCounterparty this_ptr_conv;
24881 this_ptr_conv.inner = untag_ptr(this_ptr);
24882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24884 this_ptr_conv.is_owned = false;
24885 void* val_ptr = untag_ptr(val);
24886 CHECK_ACCESS(val_ptr);
24887 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24888 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24889 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
24892 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) {
24893 LDKPublicKey node_id_arg_ref;
24894 CHECK(node_id_arg->arr_len == 33);
24895 memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg);
24896 LDKInitFeatures features_arg_conv;
24897 features_arg_conv.inner = untag_ptr(features_arg);
24898 features_arg_conv.is_owned = ptr_is_owned(features_arg);
24899 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
24900 features_arg_conv = InitFeatures_clone(&features_arg_conv);
24901 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
24902 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
24903 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
24904 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
24905 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
24906 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
24907 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
24908 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
24909 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
24910 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
24911 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
24912 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
24913 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
24914 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);
24915 uint64_t ret_ref = 0;
24916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24921 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
24922 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
24923 uint64_t ret_ref = 0;
24924 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24925 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24928 int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) {
24929 LDKChannelCounterparty arg_conv;
24930 arg_conv.inner = untag_ptr(arg);
24931 arg_conv.is_owned = ptr_is_owned(arg);
24932 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24933 arg_conv.is_owned = false;
24934 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
24938 uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) {
24939 LDKChannelCounterparty orig_conv;
24940 orig_conv.inner = untag_ptr(orig);
24941 orig_conv.is_owned = ptr_is_owned(orig);
24942 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24943 orig_conv.is_owned = false;
24944 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
24945 uint64_t ret_ref = 0;
24946 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24947 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24951 void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) {
24952 LDKChannelDetails this_obj_conv;
24953 this_obj_conv.inner = untag_ptr(this_obj);
24954 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24956 ChannelDetails_free(this_obj_conv);
24959 int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) {
24960 LDKChannelDetails this_ptr_conv;
24961 this_ptr_conv.inner = untag_ptr(this_ptr);
24962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24964 this_ptr_conv.is_owned = false;
24965 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24966 memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32);
24970 void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) {
24971 LDKChannelDetails this_ptr_conv;
24972 this_ptr_conv.inner = untag_ptr(this_ptr);
24973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24975 this_ptr_conv.is_owned = false;
24976 LDKThirtyTwoBytes val_ref;
24977 CHECK(val->arr_len == 32);
24978 memcpy(val_ref.data, val->elems, 32); FREE(val);
24979 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
24982 uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) {
24983 LDKChannelDetails this_ptr_conv;
24984 this_ptr_conv.inner = untag_ptr(this_ptr);
24985 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24987 this_ptr_conv.is_owned = false;
24988 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
24989 uint64_t ret_ref = 0;
24990 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24991 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24995 void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) {
24996 LDKChannelDetails this_ptr_conv;
24997 this_ptr_conv.inner = untag_ptr(this_ptr);
24998 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25000 this_ptr_conv.is_owned = false;
25001 LDKChannelCounterparty val_conv;
25002 val_conv.inner = untag_ptr(val);
25003 val_conv.is_owned = ptr_is_owned(val);
25004 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25005 val_conv = ChannelCounterparty_clone(&val_conv);
25006 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
25009 uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) {
25010 LDKChannelDetails this_ptr_conv;
25011 this_ptr_conv.inner = untag_ptr(this_ptr);
25012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25014 this_ptr_conv.is_owned = false;
25015 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
25016 uint64_t ret_ref = 0;
25017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25022 void __attribute__((export_name("TS_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) {
25023 LDKChannelDetails this_ptr_conv;
25024 this_ptr_conv.inner = untag_ptr(this_ptr);
25025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25027 this_ptr_conv.is_owned = false;
25028 LDKOutPoint val_conv;
25029 val_conv.inner = untag_ptr(val);
25030 val_conv.is_owned = ptr_is_owned(val);
25031 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25032 val_conv = OutPoint_clone(&val_conv);
25033 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
25036 uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(uint64_t this_ptr) {
25037 LDKChannelDetails this_ptr_conv;
25038 this_ptr_conv.inner = untag_ptr(this_ptr);
25039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25041 this_ptr_conv.is_owned = false;
25042 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
25043 uint64_t ret_ref = 0;
25044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25049 void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(uint64_t this_ptr, uint64_t val) {
25050 LDKChannelDetails this_ptr_conv;
25051 this_ptr_conv.inner = untag_ptr(this_ptr);
25052 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25054 this_ptr_conv.is_owned = false;
25055 LDKChannelTypeFeatures val_conv;
25056 val_conv.inner = untag_ptr(val);
25057 val_conv.is_owned = ptr_is_owned(val);
25058 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25059 val_conv = ChannelTypeFeatures_clone(&val_conv);
25060 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
25063 uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) {
25064 LDKChannelDetails this_ptr_conv;
25065 this_ptr_conv.inner = untag_ptr(this_ptr);
25066 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25068 this_ptr_conv.is_owned = false;
25069 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25070 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
25071 uint64_t ret_ref = tag_ptr(ret_copy, true);
25075 void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(uint64_t this_ptr, uint64_t val) {
25076 LDKChannelDetails this_ptr_conv;
25077 this_ptr_conv.inner = untag_ptr(this_ptr);
25078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25080 this_ptr_conv.is_owned = false;
25081 void* val_ptr = untag_ptr(val);
25082 CHECK_ACCESS(val_ptr);
25083 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25084 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25085 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
25088 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(uint64_t this_ptr) {
25089 LDKChannelDetails this_ptr_conv;
25090 this_ptr_conv.inner = untag_ptr(this_ptr);
25091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25093 this_ptr_conv.is_owned = false;
25094 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25095 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
25096 uint64_t ret_ref = tag_ptr(ret_copy, true);
25100 void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(uint64_t this_ptr, uint64_t val) {
25101 LDKChannelDetails this_ptr_conv;
25102 this_ptr_conv.inner = untag_ptr(this_ptr);
25103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25105 this_ptr_conv.is_owned = false;
25106 void* val_ptr = untag_ptr(val);
25107 CHECK_ACCESS(val_ptr);
25108 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25109 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25110 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
25113 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(uint64_t this_ptr) {
25114 LDKChannelDetails this_ptr_conv;
25115 this_ptr_conv.inner = untag_ptr(this_ptr);
25116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25118 this_ptr_conv.is_owned = false;
25119 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25120 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
25121 uint64_t ret_ref = tag_ptr(ret_copy, true);
25125 void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(uint64_t this_ptr, uint64_t val) {
25126 LDKChannelDetails this_ptr_conv;
25127 this_ptr_conv.inner = untag_ptr(this_ptr);
25128 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25130 this_ptr_conv.is_owned = false;
25131 void* val_ptr = untag_ptr(val);
25132 CHECK_ACCESS(val_ptr);
25133 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25134 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25135 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
25138 int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) {
25139 LDKChannelDetails this_ptr_conv;
25140 this_ptr_conv.inner = untag_ptr(this_ptr);
25141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25143 this_ptr_conv.is_owned = false;
25144 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
25148 void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
25149 LDKChannelDetails this_ptr_conv;
25150 this_ptr_conv.inner = untag_ptr(this_ptr);
25151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25153 this_ptr_conv.is_owned = false;
25154 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
25157 uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint64_t this_ptr) {
25158 LDKChannelDetails this_ptr_conv;
25159 this_ptr_conv.inner = untag_ptr(this_ptr);
25160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25162 this_ptr_conv.is_owned = false;
25163 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25164 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
25165 uint64_t ret_ref = tag_ptr(ret_copy, true);
25169 void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint64_t this_ptr, uint64_t val) {
25170 LDKChannelDetails this_ptr_conv;
25171 this_ptr_conv.inner = untag_ptr(this_ptr);
25172 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25173 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25174 this_ptr_conv.is_owned = false;
25175 void* val_ptr = untag_ptr(val);
25176 CHECK_ACCESS(val_ptr);
25177 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25178 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25179 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
25182 int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
25183 LDKChannelDetails this_ptr_conv;
25184 this_ptr_conv.inner = untag_ptr(this_ptr);
25185 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25187 this_ptr_conv.is_owned = false;
25188 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
25192 void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
25193 LDKChannelDetails this_ptr_conv;
25194 this_ptr_conv.inner = untag_ptr(this_ptr);
25195 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25197 this_ptr_conv.is_owned = false;
25198 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
25201 int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
25202 LDKChannelDetails this_ptr_conv;
25203 this_ptr_conv.inner = untag_ptr(this_ptr);
25204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25206 this_ptr_conv.is_owned = false;
25207 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
25211 void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_t val) {
25212 LDKChannelDetails this_ptr_conv;
25213 this_ptr_conv.inner = untag_ptr(this_ptr);
25214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25216 this_ptr_conv.is_owned = false;
25217 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
25220 int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) {
25221 LDKChannelDetails 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 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
25230 void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25231 LDKChannelDetails this_ptr_conv;
25232 this_ptr_conv.inner = untag_ptr(this_ptr);
25233 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25235 this_ptr_conv.is_owned = false;
25236 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
25239 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) {
25240 LDKChannelDetails this_ptr_conv;
25241 this_ptr_conv.inner = untag_ptr(this_ptr);
25242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25244 this_ptr_conv.is_owned = false;
25245 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
25249 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) {
25250 LDKChannelDetails this_ptr_conv;
25251 this_ptr_conv.inner = untag_ptr(this_ptr);
25252 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25254 this_ptr_conv.is_owned = false;
25255 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
25258 int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) {
25259 LDKChannelDetails this_ptr_conv;
25260 this_ptr_conv.inner = untag_ptr(this_ptr);
25261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25263 this_ptr_conv.is_owned = false;
25264 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
25268 void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25269 LDKChannelDetails this_ptr_conv;
25270 this_ptr_conv.inner = untag_ptr(this_ptr);
25271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25273 this_ptr_conv.is_owned = false;
25274 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
25277 uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) {
25278 LDKChannelDetails 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 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
25284 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
25285 uint64_t ret_ref = tag_ptr(ret_copy, true);
25289 void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) {
25290 LDKChannelDetails this_ptr_conv;
25291 this_ptr_conv.inner = untag_ptr(this_ptr);
25292 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25294 this_ptr_conv.is_owned = false;
25295 void* val_ptr = untag_ptr(val);
25296 CHECK_ACCESS(val_ptr);
25297 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
25298 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
25299 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
25302 uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) {
25303 LDKChannelDetails this_ptr_conv;
25304 this_ptr_conv.inner = untag_ptr(this_ptr);
25305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25307 this_ptr_conv.is_owned = false;
25308 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
25309 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
25310 uint64_t ret_ref = tag_ptr(ret_copy, true);
25314 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) {
25315 LDKChannelDetails this_ptr_conv;
25316 this_ptr_conv.inner = untag_ptr(this_ptr);
25317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25319 this_ptr_conv.is_owned = false;
25320 void* val_ptr = untag_ptr(val);
25321 CHECK_ACCESS(val_ptr);
25322 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
25323 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
25324 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
25327 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(uint64_t this_ptr) {
25328 LDKChannelDetails this_ptr_conv;
25329 this_ptr_conv.inner = untag_ptr(this_ptr);
25330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25332 this_ptr_conv.is_owned = false;
25333 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
25337 void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) {
25338 LDKChannelDetails this_ptr_conv;
25339 this_ptr_conv.inner = untag_ptr(this_ptr);
25340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25342 this_ptr_conv.is_owned = false;
25343 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
25346 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(uint64_t this_ptr) {
25347 LDKChannelDetails this_ptr_conv;
25348 this_ptr_conv.inner = untag_ptr(this_ptr);
25349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25351 this_ptr_conv.is_owned = false;
25352 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
25356 void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) {
25357 LDKChannelDetails this_ptr_conv;
25358 this_ptr_conv.inner = untag_ptr(this_ptr);
25359 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25361 this_ptr_conv.is_owned = false;
25362 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
25365 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(uint64_t this_ptr) {
25366 LDKChannelDetails this_ptr_conv;
25367 this_ptr_conv.inner = untag_ptr(this_ptr);
25368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25370 this_ptr_conv.is_owned = false;
25371 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
25375 void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) {
25376 LDKChannelDetails this_ptr_conv;
25377 this_ptr_conv.inner = untag_ptr(this_ptr);
25378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25380 this_ptr_conv.is_owned = false;
25381 ChannelDetails_set_is_usable(&this_ptr_conv, val);
25384 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) {
25385 LDKChannelDetails this_ptr_conv;
25386 this_ptr_conv.inner = untag_ptr(this_ptr);
25387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25389 this_ptr_conv.is_owned = false;
25390 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
25394 void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) {
25395 LDKChannelDetails this_ptr_conv;
25396 this_ptr_conv.inner = untag_ptr(this_ptr);
25397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25399 this_ptr_conv.is_owned = false;
25400 ChannelDetails_set_is_public(&this_ptr_conv, val);
25403 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) {
25404 LDKChannelDetails this_ptr_conv;
25405 this_ptr_conv.inner = untag_ptr(this_ptr);
25406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25408 this_ptr_conv.is_owned = false;
25409 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25410 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
25411 uint64_t ret_ref = tag_ptr(ret_copy, true);
25415 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) {
25416 LDKChannelDetails this_ptr_conv;
25417 this_ptr_conv.inner = untag_ptr(this_ptr);
25418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25420 this_ptr_conv.is_owned = false;
25421 void* val_ptr = untag_ptr(val);
25422 CHECK_ACCESS(val_ptr);
25423 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25424 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25425 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
25428 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(uint64_t this_ptr) {
25429 LDKChannelDetails this_ptr_conv;
25430 this_ptr_conv.inner = untag_ptr(this_ptr);
25431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25433 this_ptr_conv.is_owned = false;
25434 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25435 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
25436 uint64_t ret_ref = tag_ptr(ret_copy, true);
25440 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) {
25441 LDKChannelDetails this_ptr_conv;
25442 this_ptr_conv.inner = untag_ptr(this_ptr);
25443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25445 this_ptr_conv.is_owned = false;
25446 void* val_ptr = untag_ptr(val);
25447 CHECK_ACCESS(val_ptr);
25448 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25449 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25450 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
25453 uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(uint64_t this_ptr) {
25454 LDKChannelDetails this_ptr_conv;
25455 this_ptr_conv.inner = untag_ptr(this_ptr);
25456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25458 this_ptr_conv.is_owned = false;
25459 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
25460 uint64_t ret_ref = 0;
25461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25466 void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(uint64_t this_ptr, uint64_t val) {
25467 LDKChannelDetails this_ptr_conv;
25468 this_ptr_conv.inner = untag_ptr(this_ptr);
25469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25471 this_ptr_conv.is_owned = false;
25472 LDKChannelConfig val_conv;
25473 val_conv.inner = untag_ptr(val);
25474 val_conv.is_owned = ptr_is_owned(val);
25475 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25476 val_conv = ChannelConfig_clone(&val_conv);
25477 ChannelDetails_set_config(&this_ptr_conv, val_conv);
25480 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) {
25481 LDKThirtyTwoBytes channel_id_arg_ref;
25482 CHECK(channel_id_arg->arr_len == 32);
25483 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
25484 LDKChannelCounterparty counterparty_arg_conv;
25485 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
25486 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
25487 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
25488 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
25489 LDKOutPoint funding_txo_arg_conv;
25490 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
25491 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
25492 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
25493 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
25494 LDKChannelTypeFeatures channel_type_arg_conv;
25495 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
25496 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
25497 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
25498 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
25499 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
25500 CHECK_ACCESS(short_channel_id_arg_ptr);
25501 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
25502 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
25503 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
25504 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
25505 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
25506 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
25507 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
25508 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
25509 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
25510 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
25511 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
25512 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
25513 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
25514 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
25515 CHECK_ACCESS(confirmations_required_arg_ptr);
25516 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
25517 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
25518 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
25519 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
25520 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
25521 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
25522 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
25523 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
25524 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
25525 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
25526 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
25527 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
25528 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
25529 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
25530 LDKChannelConfig config_arg_conv;
25531 config_arg_conv.inner = untag_ptr(config_arg);
25532 config_arg_conv.is_owned = ptr_is_owned(config_arg);
25533 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
25534 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
25535 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);
25536 uint64_t ret_ref = 0;
25537 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25538 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25542 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
25543 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
25544 uint64_t ret_ref = 0;
25545 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25546 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25549 int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) {
25550 LDKChannelDetails arg_conv;
25551 arg_conv.inner = untag_ptr(arg);
25552 arg_conv.is_owned = ptr_is_owned(arg);
25553 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25554 arg_conv.is_owned = false;
25555 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
25559 uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) {
25560 LDKChannelDetails orig_conv;
25561 orig_conv.inner = untag_ptr(orig);
25562 orig_conv.is_owned = ptr_is_owned(orig);
25563 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25564 orig_conv.is_owned = false;
25565 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
25566 uint64_t ret_ref = 0;
25567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25572 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) {
25573 LDKChannelDetails this_arg_conv;
25574 this_arg_conv.inner = untag_ptr(this_arg);
25575 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25577 this_arg_conv.is_owned = false;
25578 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25579 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
25580 uint64_t ret_ref = tag_ptr(ret_copy, true);
25584 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) {
25585 LDKChannelDetails this_arg_conv;
25586 this_arg_conv.inner = untag_ptr(this_arg);
25587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25589 this_arg_conv.is_owned = false;
25590 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25591 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
25592 uint64_t ret_ref = tag_ptr(ret_copy, true);
25596 void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
25597 if (!ptr_is_owned(this_ptr)) return;
25598 void* this_ptr_ptr = untag_ptr(this_ptr);
25599 CHECK_ACCESS(this_ptr_ptr);
25600 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
25601 FREE(untag_ptr(this_ptr));
25602 PaymentSendFailure_free(this_ptr_conv);
25605 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
25606 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25607 *ret_copy = PaymentSendFailure_clone(arg);
25608 uint64_t ret_ref = tag_ptr(ret_copy, true);
25611 int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
25612 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
25613 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
25617 uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
25618 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
25619 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25620 *ret_copy = PaymentSendFailure_clone(orig_conv);
25621 uint64_t ret_ref = tag_ptr(ret_copy, true);
25625 uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
25626 void* a_ptr = untag_ptr(a);
25627 CHECK_ACCESS(a_ptr);
25628 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
25629 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
25630 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25631 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
25632 uint64_t ret_ref = tag_ptr(ret_copy, true);
25636 uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
25637 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
25638 a_constr.datalen = a->arr_len;
25639 if (a_constr.datalen > 0)
25640 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25642 a_constr.data = NULL;
25643 uint64_t* a_vals = a->elems;
25644 for (size_t w = 0; w < a_constr.datalen; w++) {
25645 uint64_t a_conv_22 = a_vals[w];
25646 void* a_conv_22_ptr = untag_ptr(a_conv_22);
25647 CHECK_ACCESS(a_conv_22_ptr);
25648 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
25649 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
25650 a_constr.data[w] = a_conv_22_conv;
25653 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25654 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
25655 uint64_t ret_ref = tag_ptr(ret_copy, true);
25659 uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
25660 LDKCVec_APIErrorZ a_constr;
25661 a_constr.datalen = a->arr_len;
25662 if (a_constr.datalen > 0)
25663 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
25665 a_constr.data = NULL;
25666 uint64_t* a_vals = a->elems;
25667 for (size_t k = 0; k < a_constr.datalen; k++) {
25668 uint64_t a_conv_10 = a_vals[k];
25669 void* a_conv_10_ptr = untag_ptr(a_conv_10);
25670 CHECK_ACCESS(a_conv_10_ptr);
25671 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
25672 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
25673 a_constr.data[k] = a_conv_10_conv;
25676 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25677 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
25678 uint64_t ret_ref = tag_ptr(ret_copy, true);
25682 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) {
25683 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
25684 results_constr.datalen = results->arr_len;
25685 if (results_constr.datalen > 0)
25686 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25688 results_constr.data = NULL;
25689 uint64_t* results_vals = results->elems;
25690 for (size_t w = 0; w < results_constr.datalen; w++) {
25691 uint64_t results_conv_22 = results_vals[w];
25692 void* results_conv_22_ptr = untag_ptr(results_conv_22);
25693 CHECK_ACCESS(results_conv_22_ptr);
25694 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
25695 results_constr.data[w] = results_conv_22_conv;
25698 LDKRouteParameters failed_paths_retry_conv;
25699 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
25700 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
25701 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
25702 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
25703 LDKThirtyTwoBytes payment_id_ref;
25704 CHECK(payment_id->arr_len == 32);
25705 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
25706 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25707 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
25708 uint64_t ret_ref = tag_ptr(ret_copy, true);
25712 void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) {
25713 LDKPhantomRouteHints this_obj_conv;
25714 this_obj_conv.inner = untag_ptr(this_obj);
25715 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25717 PhantomRouteHints_free(this_obj_conv);
25720 uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) {
25721 LDKPhantomRouteHints this_ptr_conv;
25722 this_ptr_conv.inner = untag_ptr(this_ptr);
25723 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25725 this_ptr_conv.is_owned = false;
25726 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
25727 uint64_tArray ret_arr = NULL;
25728 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25729 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25730 for (size_t q = 0; q < ret_var.datalen; q++) {
25731 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25732 uint64_t ret_conv_16_ref = 0;
25733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25734 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25735 ret_arr_ptr[q] = ret_conv_16_ref;
25738 FREE(ret_var.data);
25742 void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) {
25743 LDKPhantomRouteHints this_ptr_conv;
25744 this_ptr_conv.inner = untag_ptr(this_ptr);
25745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25747 this_ptr_conv.is_owned = false;
25748 LDKCVec_ChannelDetailsZ val_constr;
25749 val_constr.datalen = val->arr_len;
25750 if (val_constr.datalen > 0)
25751 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25753 val_constr.data = NULL;
25754 uint64_t* val_vals = val->elems;
25755 for (size_t q = 0; q < val_constr.datalen; q++) {
25756 uint64_t val_conv_16 = val_vals[q];
25757 LDKChannelDetails val_conv_16_conv;
25758 val_conv_16_conv.inner = untag_ptr(val_conv_16);
25759 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
25760 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
25761 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
25762 val_constr.data[q] = val_conv_16_conv;
25765 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
25768 int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) {
25769 LDKPhantomRouteHints this_ptr_conv;
25770 this_ptr_conv.inner = untag_ptr(this_ptr);
25771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25773 this_ptr_conv.is_owned = false;
25774 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
25778 void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) {
25779 LDKPhantomRouteHints this_ptr_conv;
25780 this_ptr_conv.inner = untag_ptr(this_ptr);
25781 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25783 this_ptr_conv.is_owned = false;
25784 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
25787 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) {
25788 LDKPhantomRouteHints this_ptr_conv;
25789 this_ptr_conv.inner = untag_ptr(this_ptr);
25790 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25792 this_ptr_conv.is_owned = false;
25793 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
25794 memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33);
25798 void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) {
25799 LDKPhantomRouteHints this_ptr_conv;
25800 this_ptr_conv.inner = untag_ptr(this_ptr);
25801 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25803 this_ptr_conv.is_owned = false;
25804 LDKPublicKey val_ref;
25805 CHECK(val->arr_len == 33);
25806 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
25807 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
25810 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) {
25811 LDKCVec_ChannelDetailsZ channels_arg_constr;
25812 channels_arg_constr.datalen = channels_arg->arr_len;
25813 if (channels_arg_constr.datalen > 0)
25814 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25816 channels_arg_constr.data = NULL;
25817 uint64_t* channels_arg_vals = channels_arg->elems;
25818 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
25819 uint64_t channels_arg_conv_16 = channels_arg_vals[q];
25820 LDKChannelDetails channels_arg_conv_16_conv;
25821 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
25822 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
25823 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
25824 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
25825 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
25827 FREE(channels_arg);
25828 LDKPublicKey real_node_pubkey_arg_ref;
25829 CHECK(real_node_pubkey_arg->arr_len == 33);
25830 memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
25831 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
25832 uint64_t ret_ref = 0;
25833 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25834 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25838 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
25839 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
25840 uint64_t ret_ref = 0;
25841 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25842 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25845 int64_t __attribute__((export_name("TS_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) {
25846 LDKPhantomRouteHints arg_conv;
25847 arg_conv.inner = untag_ptr(arg);
25848 arg_conv.is_owned = ptr_is_owned(arg);
25849 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25850 arg_conv.is_owned = false;
25851 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
25855 uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) {
25856 LDKPhantomRouteHints orig_conv;
25857 orig_conv.inner = untag_ptr(orig);
25858 orig_conv.is_owned = ptr_is_owned(orig);
25859 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25860 orig_conv.is_owned = false;
25861 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
25862 uint64_t ret_ref = 0;
25863 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25864 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25868 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) {
25869 void* fee_est_ptr = untag_ptr(fee_est);
25870 CHECK_ACCESS(fee_est_ptr);
25871 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
25872 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
25873 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25874 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
25876 void* chain_monitor_ptr = untag_ptr(chain_monitor);
25877 CHECK_ACCESS(chain_monitor_ptr);
25878 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
25879 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
25880 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25881 LDKWatch_JCalls_cloned(&chain_monitor_conv);
25883 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
25884 CHECK_ACCESS(tx_broadcaster_ptr);
25885 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
25886 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
25887 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25888 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
25890 void* logger_ptr = untag_ptr(logger);
25891 CHECK_ACCESS(logger_ptr);
25892 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
25893 if (logger_conv.free == LDKLogger_JCalls_free) {
25894 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25895 LDKLogger_JCalls_cloned(&logger_conv);
25897 void* keys_manager_ptr = untag_ptr(keys_manager);
25898 CHECK_ACCESS(keys_manager_ptr);
25899 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
25900 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
25901 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25902 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
25904 LDKUserConfig config_conv;
25905 config_conv.inner = untag_ptr(config);
25906 config_conv.is_owned = ptr_is_owned(config);
25907 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
25908 config_conv = UserConfig_clone(&config_conv);
25909 LDKChainParameters params_conv;
25910 params_conv.inner = untag_ptr(params);
25911 params_conv.is_owned = ptr_is_owned(params);
25912 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
25913 params_conv = ChainParameters_clone(¶ms_conv);
25914 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
25915 uint64_t ret_ref = 0;
25916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25921 uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(uint64_t this_arg) {
25922 LDKChannelManager this_arg_conv;
25923 this_arg_conv.inner = untag_ptr(this_arg);
25924 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25926 this_arg_conv.is_owned = false;
25927 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
25928 uint64_t ret_ref = 0;
25929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25934 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) {
25935 LDKChannelManager this_arg_conv;
25936 this_arg_conv.inner = untag_ptr(this_arg);
25937 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25939 this_arg_conv.is_owned = false;
25940 LDKPublicKey their_network_key_ref;
25941 CHECK(their_network_key->arr_len == 33);
25942 memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
25943 LDKUserConfig override_config_conv;
25944 override_config_conv.inner = untag_ptr(override_config);
25945 override_config_conv.is_owned = ptr_is_owned(override_config);
25946 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
25947 override_config_conv = UserConfig_clone(&override_config_conv);
25948 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
25949 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
25950 return tag_ptr(ret_conv, true);
25953 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) {
25954 LDKChannelManager this_arg_conv;
25955 this_arg_conv.inner = untag_ptr(this_arg);
25956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25958 this_arg_conv.is_owned = false;
25959 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
25960 uint64_tArray ret_arr = NULL;
25961 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25962 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25963 for (size_t q = 0; q < ret_var.datalen; q++) {
25964 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25965 uint64_t ret_conv_16_ref = 0;
25966 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25967 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25968 ret_arr_ptr[q] = ret_conv_16_ref;
25971 FREE(ret_var.data);
25975 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) {
25976 LDKChannelManager this_arg_conv;
25977 this_arg_conv.inner = untag_ptr(this_arg);
25978 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25980 this_arg_conv.is_owned = false;
25981 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
25982 uint64_tArray ret_arr = NULL;
25983 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25984 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25985 for (size_t q = 0; q < ret_var.datalen; q++) {
25986 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25987 uint64_t ret_conv_16_ref = 0;
25988 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25989 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25990 ret_arr_ptr[q] = ret_conv_16_ref;
25993 FREE(ret_var.data);
25997 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) {
25998 LDKChannelManager this_arg_conv;
25999 this_arg_conv.inner = untag_ptr(this_arg);
26000 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26002 this_arg_conv.is_owned = false;
26003 unsigned char channel_id_arr[32];
26004 CHECK(channel_id->arr_len == 32);
26005 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26006 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26007 LDKPublicKey counterparty_node_id_ref;
26008 CHECK(counterparty_node_id->arr_len == 33);
26009 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26010 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26011 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26012 return tag_ptr(ret_conv, true);
26015 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) {
26016 LDKChannelManager this_arg_conv;
26017 this_arg_conv.inner = untag_ptr(this_arg);
26018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26020 this_arg_conv.is_owned = false;
26021 unsigned char channel_id_arr[32];
26022 CHECK(channel_id->arr_len == 32);
26023 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26024 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26025 LDKPublicKey counterparty_node_id_ref;
26026 CHECK(counterparty_node_id->arr_len == 33);
26027 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26028 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26029 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
26030 return tag_ptr(ret_conv, true);
26033 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) {
26034 LDKChannelManager this_arg_conv;
26035 this_arg_conv.inner = untag_ptr(this_arg);
26036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26038 this_arg_conv.is_owned = false;
26039 unsigned char channel_id_arr[32];
26040 CHECK(channel_id->arr_len == 32);
26041 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26042 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26043 LDKPublicKey counterparty_node_id_ref;
26044 CHECK(counterparty_node_id->arr_len == 33);
26045 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26046 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26047 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26048 return tag_ptr(ret_conv, true);
26051 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) {
26052 LDKChannelManager this_arg_conv;
26053 this_arg_conv.inner = untag_ptr(this_arg);
26054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26056 this_arg_conv.is_owned = false;
26057 unsigned char channel_id_arr[32];
26058 CHECK(channel_id->arr_len == 32);
26059 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26060 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26061 LDKPublicKey counterparty_node_id_ref;
26062 CHECK(counterparty_node_id->arr_len == 33);
26063 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26064 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26065 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26066 return tag_ptr(ret_conv, true);
26069 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) {
26070 LDKChannelManager this_arg_conv;
26071 this_arg_conv.inner = untag_ptr(this_arg);
26072 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26074 this_arg_conv.is_owned = false;
26075 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
26078 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) {
26079 LDKChannelManager this_arg_conv;
26080 this_arg_conv.inner = untag_ptr(this_arg);
26081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26083 this_arg_conv.is_owned = false;
26084 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
26087 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) {
26088 LDKChannelManager this_arg_conv;
26089 this_arg_conv.inner = untag_ptr(this_arg);
26090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26092 this_arg_conv.is_owned = false;
26093 LDKRoute route_conv;
26094 route_conv.inner = untag_ptr(route);
26095 route_conv.is_owned = ptr_is_owned(route);
26096 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26097 route_conv.is_owned = false;
26098 LDKThirtyTwoBytes payment_hash_ref;
26099 CHECK(payment_hash->arr_len == 32);
26100 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26101 LDKThirtyTwoBytes payment_secret_ref;
26102 CHECK(payment_secret->arr_len == 32);
26103 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
26104 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
26105 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
26106 return tag_ptr(ret_conv, true);
26109 uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
26110 LDKChannelManager this_arg_conv;
26111 this_arg_conv.inner = untag_ptr(this_arg);
26112 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26114 this_arg_conv.is_owned = false;
26115 LDKRoute route_conv;
26116 route_conv.inner = untag_ptr(route);
26117 route_conv.is_owned = ptr_is_owned(route);
26118 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26119 route_conv.is_owned = false;
26120 LDKThirtyTwoBytes payment_id_ref;
26121 CHECK(payment_id->arr_len == 32);
26122 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
26123 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
26124 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
26125 return tag_ptr(ret_conv, true);
26128 void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
26129 LDKChannelManager this_arg_conv;
26130 this_arg_conv.inner = untag_ptr(this_arg);
26131 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26133 this_arg_conv.is_owned = false;
26134 LDKThirtyTwoBytes payment_id_ref;
26135 CHECK(payment_id->arr_len == 32);
26136 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
26137 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
26140 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) {
26141 LDKChannelManager this_arg_conv;
26142 this_arg_conv.inner = untag_ptr(this_arg);
26143 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26145 this_arg_conv.is_owned = false;
26146 LDKRoute route_conv;
26147 route_conv.inner = untag_ptr(route);
26148 route_conv.is_owned = ptr_is_owned(route);
26149 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26150 route_conv.is_owned = false;
26151 LDKThirtyTwoBytes payment_preimage_ref;
26152 CHECK(payment_preimage->arr_len == 32);
26153 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
26154 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
26155 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
26156 return tag_ptr(ret_conv, true);
26159 uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) {
26160 LDKChannelManager this_arg_conv;
26161 this_arg_conv.inner = untag_ptr(this_arg);
26162 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26164 this_arg_conv.is_owned = false;
26165 LDKCVec_RouteHopZ hops_constr;
26166 hops_constr.datalen = hops->arr_len;
26167 if (hops_constr.datalen > 0)
26168 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26170 hops_constr.data = NULL;
26171 uint64_t* hops_vals = hops->elems;
26172 for (size_t k = 0; k < hops_constr.datalen; k++) {
26173 uint64_t hops_conv_10 = hops_vals[k];
26174 LDKRouteHop hops_conv_10_conv;
26175 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
26176 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
26177 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
26178 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
26179 hops_constr.data[k] = hops_conv_10_conv;
26182 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
26183 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
26184 return tag_ptr(ret_conv, true);
26187 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) {
26188 LDKChannelManager this_arg_conv;
26189 this_arg_conv.inner = untag_ptr(this_arg);
26190 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26192 this_arg_conv.is_owned = false;
26193 unsigned char temporary_channel_id_arr[32];
26194 CHECK(temporary_channel_id->arr_len == 32);
26195 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26196 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26197 LDKPublicKey counterparty_node_id_ref;
26198 CHECK(counterparty_node_id->arr_len == 33);
26199 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26200 LDKTransaction funding_transaction_ref;
26201 funding_transaction_ref.datalen = funding_transaction->arr_len;
26202 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
26203 memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction);
26204 funding_transaction_ref.data_is_owned = true;
26205 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26206 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
26207 return tag_ptr(ret_conv, true);
26210 void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement"))) TS_ChannelManager_broadcast_node_announcement(uint64_t this_arg, int8_tArray rgb, int8_tArray alias, uint64_tArray addresses) {
26211 LDKChannelManager this_arg_conv;
26212 this_arg_conv.inner = untag_ptr(this_arg);
26213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26215 this_arg_conv.is_owned = false;
26216 LDKThreeBytes rgb_ref;
26217 CHECK(rgb->arr_len == 3);
26218 memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
26219 LDKThirtyTwoBytes alias_ref;
26220 CHECK(alias->arr_len == 32);
26221 memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
26222 LDKCVec_NetAddressZ addresses_constr;
26223 addresses_constr.datalen = addresses->arr_len;
26224 if (addresses_constr.datalen > 0)
26225 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
26227 addresses_constr.data = NULL;
26228 uint64_t* addresses_vals = addresses->elems;
26229 for (size_t m = 0; m < addresses_constr.datalen; m++) {
26230 uint64_t addresses_conv_12 = addresses_vals[m];
26231 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
26232 CHECK_ACCESS(addresses_conv_12_ptr);
26233 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
26234 addresses_constr.data[m] = addresses_conv_12_conv;
26237 ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
26240 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) {
26241 LDKChannelManager this_arg_conv;
26242 this_arg_conv.inner = untag_ptr(this_arg);
26243 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26245 this_arg_conv.is_owned = false;
26246 LDKPublicKey counterparty_node_id_ref;
26247 CHECK(counterparty_node_id->arr_len == 33);
26248 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26249 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
26250 channel_ids_constr.datalen = channel_ids->arr_len;
26251 if (channel_ids_constr.datalen > 0)
26252 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
26254 channel_ids_constr.data = NULL;
26255 int8_tArray* channel_ids_vals = (void*) channel_ids->elems;
26256 for (size_t m = 0; m < channel_ids_constr.datalen; m++) {
26257 int8_tArray channel_ids_conv_12 = channel_ids_vals[m];
26258 LDKThirtyTwoBytes channel_ids_conv_12_ref;
26259 CHECK(channel_ids_conv_12->arr_len == 32);
26260 memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12);
26261 channel_ids_constr.data[m] = channel_ids_conv_12_ref;
26264 LDKChannelConfig config_conv;
26265 config_conv.inner = untag_ptr(config);
26266 config_conv.is_owned = ptr_is_owned(config);
26267 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
26268 config_conv.is_owned = false;
26269 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26270 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
26271 return tag_ptr(ret_conv, true);
26274 void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
26275 LDKChannelManager this_arg_conv;
26276 this_arg_conv.inner = untag_ptr(this_arg);
26277 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26279 this_arg_conv.is_owned = false;
26280 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
26283 void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(uint64_t this_arg) {
26284 LDKChannelManager this_arg_conv;
26285 this_arg_conv.inner = untag_ptr(this_arg);
26286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26288 this_arg_conv.is_owned = false;
26289 ChannelManager_timer_tick_occurred(&this_arg_conv);
26292 void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) {
26293 LDKChannelManager this_arg_conv;
26294 this_arg_conv.inner = untag_ptr(this_arg);
26295 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26297 this_arg_conv.is_owned = false;
26298 unsigned char payment_hash_arr[32];
26299 CHECK(payment_hash->arr_len == 32);
26300 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
26301 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
26302 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
26305 void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
26306 LDKChannelManager this_arg_conv;
26307 this_arg_conv.inner = untag_ptr(this_arg);
26308 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26310 this_arg_conv.is_owned = false;
26311 LDKThirtyTwoBytes payment_preimage_ref;
26312 CHECK(payment_preimage->arr_len == 32);
26313 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
26314 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
26317 int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(uint64_t this_arg) {
26318 LDKChannelManager this_arg_conv;
26319 this_arg_conv.inner = untag_ptr(this_arg);
26320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26322 this_arg_conv.is_owned = false;
26323 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
26324 memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
26328 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) {
26329 LDKChannelManager this_arg_conv;
26330 this_arg_conv.inner = untag_ptr(this_arg);
26331 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26333 this_arg_conv.is_owned = false;
26334 unsigned char temporary_channel_id_arr[32];
26335 CHECK(temporary_channel_id->arr_len == 32);
26336 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26337 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26338 LDKPublicKey counterparty_node_id_ref;
26339 CHECK(counterparty_node_id->arr_len == 33);
26340 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26341 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26342 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26343 return tag_ptr(ret_conv, true);
26346 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) {
26347 LDKChannelManager this_arg_conv;
26348 this_arg_conv.inner = untag_ptr(this_arg);
26349 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26351 this_arg_conv.is_owned = false;
26352 unsigned char temporary_channel_id_arr[32];
26353 CHECK(temporary_channel_id->arr_len == 32);
26354 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26355 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26356 LDKPublicKey counterparty_node_id_ref;
26357 CHECK(counterparty_node_id->arr_len == 33);
26358 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26359 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26360 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26361 return tag_ptr(ret_conv, true);
26364 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) {
26365 LDKChannelManager this_arg_conv;
26366 this_arg_conv.inner = untag_ptr(this_arg);
26367 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26369 this_arg_conv.is_owned = false;
26370 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26371 CHECK_ACCESS(min_value_msat_ptr);
26372 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26373 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26374 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26375 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26376 return tag_ptr(ret_conv, true);
26379 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) {
26380 LDKChannelManager this_arg_conv;
26381 this_arg_conv.inner = untag_ptr(this_arg);
26382 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26384 this_arg_conv.is_owned = false;
26385 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26386 CHECK_ACCESS(min_value_msat_ptr);
26387 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26388 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26389 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
26390 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26391 return tag_ptr(ret_conv, true);
26394 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) {
26395 LDKChannelManager this_arg_conv;
26396 this_arg_conv.inner = untag_ptr(this_arg);
26397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26399 this_arg_conv.is_owned = false;
26400 LDKThirtyTwoBytes payment_hash_ref;
26401 CHECK(payment_hash->arr_len == 32);
26402 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26403 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26404 CHECK_ACCESS(min_value_msat_ptr);
26405 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26406 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26407 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26408 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26409 return tag_ptr(ret_conv, true);
26412 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) {
26413 LDKChannelManager this_arg_conv;
26414 this_arg_conv.inner = untag_ptr(this_arg);
26415 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26417 this_arg_conv.is_owned = false;
26418 LDKThirtyTwoBytes payment_hash_ref;
26419 CHECK(payment_hash->arr_len == 32);
26420 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26421 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26422 CHECK_ACCESS(min_value_msat_ptr);
26423 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26424 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26425 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
26426 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26427 return tag_ptr(ret_conv, true);
26430 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) {
26431 LDKChannelManager this_arg_conv;
26432 this_arg_conv.inner = untag_ptr(this_arg);
26433 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26435 this_arg_conv.is_owned = false;
26436 LDKThirtyTwoBytes payment_hash_ref;
26437 CHECK(payment_hash->arr_len == 32);
26438 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26439 LDKThirtyTwoBytes payment_secret_ref;
26440 CHECK(payment_secret->arr_len == 32);
26441 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
26442 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
26443 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
26444 return tag_ptr(ret_conv, true);
26447 int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) {
26448 LDKChannelManager this_arg_conv;
26449 this_arg_conv.inner = untag_ptr(this_arg);
26450 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26452 this_arg_conv.is_owned = false;
26453 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
26457 uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(uint64_t this_arg) {
26458 LDKChannelManager this_arg_conv;
26459 this_arg_conv.inner = untag_ptr(this_arg);
26460 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26461 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26462 this_arg_conv.is_owned = false;
26463 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
26464 uint64_t ret_ref = 0;
26465 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26466 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26470 uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
26471 LDKChannelManager this_arg_conv;
26472 this_arg_conv.inner = untag_ptr(this_arg);
26473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26475 this_arg_conv.is_owned = false;
26476 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
26477 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
26478 return tag_ptr(ret_ret, true);
26481 uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint64_t this_arg) {
26482 LDKChannelManager this_arg_conv;
26483 this_arg_conv.inner = untag_ptr(this_arg);
26484 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26486 this_arg_conv.is_owned = false;
26487 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
26488 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
26489 return tag_ptr(ret_ret, true);
26492 uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint64_t this_arg) {
26493 LDKChannelManager this_arg_conv;
26494 this_arg_conv.inner = untag_ptr(this_arg);
26495 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26497 this_arg_conv.is_owned = false;
26498 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
26499 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
26500 return tag_ptr(ret_ret, true);
26503 uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint64_t this_arg) {
26504 LDKChannelManager this_arg_conv;
26505 this_arg_conv.inner = untag_ptr(this_arg);
26506 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26508 this_arg_conv.is_owned = false;
26509 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
26510 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
26511 return tag_ptr(ret_ret, true);
26514 void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint64_t this_arg) {
26515 LDKChannelManager this_arg_conv;
26516 this_arg_conv.inner = untag_ptr(this_arg);
26517 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26518 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26519 this_arg_conv.is_owned = false;
26520 ChannelManager_await_persistable_update(&this_arg_conv);
26523 uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
26524 LDKChannelManager this_arg_conv;
26525 this_arg_conv.inner = untag_ptr(this_arg);
26526 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26528 this_arg_conv.is_owned = false;
26529 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
26530 uint64_t ret_ref = 0;
26531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26532 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26536 uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
26537 LDKChannelManager this_arg_conv;
26538 this_arg_conv.inner = untag_ptr(this_arg);
26539 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26541 this_arg_conv.is_owned = false;
26542 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
26543 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
26544 return tag_ptr(ret_ret, true);
26547 int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
26548 LDKCounterpartyForwardingInfo obj_conv;
26549 obj_conv.inner = untag_ptr(obj);
26550 obj_conv.is_owned = ptr_is_owned(obj);
26551 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26552 obj_conv.is_owned = false;
26553 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
26554 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26555 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26556 CVec_u8Z_free(ret_var);
26560 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
26561 LDKu8slice ser_ref;
26562 ser_ref.datalen = ser->arr_len;
26563 ser_ref.data = ser->elems;
26564 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
26565 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
26567 return tag_ptr(ret_conv, true);
26570 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) {
26571 LDKChannelCounterparty obj_conv;
26572 obj_conv.inner = untag_ptr(obj);
26573 obj_conv.is_owned = ptr_is_owned(obj);
26574 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26575 obj_conv.is_owned = false;
26576 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
26577 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26578 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26579 CVec_u8Z_free(ret_var);
26583 uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
26584 LDKu8slice ser_ref;
26585 ser_ref.datalen = ser->arr_len;
26586 ser_ref.data = ser->elems;
26587 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
26588 *ret_conv = ChannelCounterparty_read(ser_ref);
26590 return tag_ptr(ret_conv, true);
26593 int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) {
26594 LDKChannelDetails obj_conv;
26595 obj_conv.inner = untag_ptr(obj);
26596 obj_conv.is_owned = ptr_is_owned(obj);
26597 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26598 obj_conv.is_owned = false;
26599 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
26600 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26601 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26602 CVec_u8Z_free(ret_var);
26606 uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
26607 LDKu8slice ser_ref;
26608 ser_ref.datalen = ser->arr_len;
26609 ser_ref.data = ser->elems;
26610 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
26611 *ret_conv = ChannelDetails_read(ser_ref);
26613 return tag_ptr(ret_conv, true);
26616 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) {
26617 LDKPhantomRouteHints obj_conv;
26618 obj_conv.inner = untag_ptr(obj);
26619 obj_conv.is_owned = ptr_is_owned(obj);
26620 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26621 obj_conv.is_owned = false;
26622 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
26623 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26624 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26625 CVec_u8Z_free(ret_var);
26629 uint64_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
26630 LDKu8slice ser_ref;
26631 ser_ref.datalen = ser->arr_len;
26632 ser_ref.data = ser->elems;
26633 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
26634 *ret_conv = PhantomRouteHints_read(ser_ref);
26636 return tag_ptr(ret_conv, true);
26639 int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) {
26640 LDKChannelManager obj_conv;
26641 obj_conv.inner = untag_ptr(obj);
26642 obj_conv.is_owned = ptr_is_owned(obj);
26643 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26644 obj_conv.is_owned = false;
26645 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
26646 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26647 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26648 CVec_u8Z_free(ret_var);
26652 void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) {
26653 LDKChannelManagerReadArgs this_obj_conv;
26654 this_obj_conv.inner = untag_ptr(this_obj);
26655 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26657 ChannelManagerReadArgs_free(this_obj_conv);
26660 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
26661 LDKChannelManagerReadArgs this_ptr_conv;
26662 this_ptr_conv.inner = untag_ptr(this_ptr);
26663 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26665 this_ptr_conv.is_owned = false;
26666 // WARNING: This object doesn't live past this scope, needs clone!
26667 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
26671 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
26672 LDKChannelManagerReadArgs this_ptr_conv;
26673 this_ptr_conv.inner = untag_ptr(this_ptr);
26674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26676 this_ptr_conv.is_owned = false;
26677 void* val_ptr = untag_ptr(val);
26678 CHECK_ACCESS(val_ptr);
26679 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
26680 if (val_conv.free == LDKKeysInterface_JCalls_free) {
26681 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26682 LDKKeysInterface_JCalls_cloned(&val_conv);
26684 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
26687 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
26688 LDKChannelManagerReadArgs this_ptr_conv;
26689 this_ptr_conv.inner = untag_ptr(this_ptr);
26690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26692 this_ptr_conv.is_owned = false;
26693 // WARNING: This object doesn't live past this scope, needs clone!
26694 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
26698 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) {
26699 LDKChannelManagerReadArgs this_ptr_conv;
26700 this_ptr_conv.inner = untag_ptr(this_ptr);
26701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26703 this_ptr_conv.is_owned = false;
26704 void* val_ptr = untag_ptr(val);
26705 CHECK_ACCESS(val_ptr);
26706 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
26707 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
26708 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26709 LDKFeeEstimator_JCalls_cloned(&val_conv);
26711 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
26714 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) {
26715 LDKChannelManagerReadArgs this_ptr_conv;
26716 this_ptr_conv.inner = untag_ptr(this_ptr);
26717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26719 this_ptr_conv.is_owned = false;
26720 // WARNING: This object doesn't live past this scope, needs clone!
26721 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
26725 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) {
26726 LDKChannelManagerReadArgs this_ptr_conv;
26727 this_ptr_conv.inner = untag_ptr(this_ptr);
26728 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26730 this_ptr_conv.is_owned = false;
26731 void* val_ptr = untag_ptr(val);
26732 CHECK_ACCESS(val_ptr);
26733 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
26734 if (val_conv.free == LDKWatch_JCalls_free) {
26735 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26736 LDKWatch_JCalls_cloned(&val_conv);
26738 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
26741 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) {
26742 LDKChannelManagerReadArgs this_ptr_conv;
26743 this_ptr_conv.inner = untag_ptr(this_ptr);
26744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26746 this_ptr_conv.is_owned = false;
26747 // WARNING: This object doesn't live past this scope, needs clone!
26748 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
26752 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) {
26753 LDKChannelManagerReadArgs this_ptr_conv;
26754 this_ptr_conv.inner = untag_ptr(this_ptr);
26755 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26757 this_ptr_conv.is_owned = false;
26758 void* val_ptr = untag_ptr(val);
26759 CHECK_ACCESS(val_ptr);
26760 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
26761 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
26762 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26763 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
26765 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
26768 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
26769 LDKChannelManagerReadArgs this_ptr_conv;
26770 this_ptr_conv.inner = untag_ptr(this_ptr);
26771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26773 this_ptr_conv.is_owned = false;
26774 // WARNING: This object doesn't live past this scope, needs clone!
26775 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
26779 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) {
26780 LDKChannelManagerReadArgs this_ptr_conv;
26781 this_ptr_conv.inner = untag_ptr(this_ptr);
26782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26784 this_ptr_conv.is_owned = false;
26785 void* val_ptr = untag_ptr(val);
26786 CHECK_ACCESS(val_ptr);
26787 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
26788 if (val_conv.free == LDKLogger_JCalls_free) {
26789 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26790 LDKLogger_JCalls_cloned(&val_conv);
26792 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
26795 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) {
26796 LDKChannelManagerReadArgs this_ptr_conv;
26797 this_ptr_conv.inner = untag_ptr(this_ptr);
26798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26800 this_ptr_conv.is_owned = false;
26801 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
26802 uint64_t ret_ref = 0;
26803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26808 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) {
26809 LDKChannelManagerReadArgs this_ptr_conv;
26810 this_ptr_conv.inner = untag_ptr(this_ptr);
26811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26813 this_ptr_conv.is_owned = false;
26814 LDKUserConfig val_conv;
26815 val_conv.inner = untag_ptr(val);
26816 val_conv.is_owned = ptr_is_owned(val);
26817 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26818 val_conv = UserConfig_clone(&val_conv);
26819 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
26822 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) {
26823 void* keys_manager_ptr = untag_ptr(keys_manager);
26824 CHECK_ACCESS(keys_manager_ptr);
26825 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
26826 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
26827 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26828 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
26830 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26831 CHECK_ACCESS(fee_estimator_ptr);
26832 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26833 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26834 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26835 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26837 void* chain_monitor_ptr = untag_ptr(chain_monitor);
26838 CHECK_ACCESS(chain_monitor_ptr);
26839 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
26840 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
26841 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26842 LDKWatch_JCalls_cloned(&chain_monitor_conv);
26844 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
26845 CHECK_ACCESS(tx_broadcaster_ptr);
26846 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
26847 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26848 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26849 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
26851 void* logger_ptr = untag_ptr(logger);
26852 CHECK_ACCESS(logger_ptr);
26853 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26854 if (logger_conv.free == LDKLogger_JCalls_free) {
26855 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26856 LDKLogger_JCalls_cloned(&logger_conv);
26858 LDKUserConfig default_config_conv;
26859 default_config_conv.inner = untag_ptr(default_config);
26860 default_config_conv.is_owned = ptr_is_owned(default_config);
26861 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
26862 default_config_conv = UserConfig_clone(&default_config_conv);
26863 LDKCVec_ChannelMonitorZ channel_monitors_constr;
26864 channel_monitors_constr.datalen = channel_monitors->arr_len;
26865 if (channel_monitors_constr.datalen > 0)
26866 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
26868 channel_monitors_constr.data = NULL;
26869 uint64_t* channel_monitors_vals = channel_monitors->elems;
26870 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
26871 uint64_t channel_monitors_conv_16 = channel_monitors_vals[q];
26872 LDKChannelMonitor channel_monitors_conv_16_conv;
26873 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
26874 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
26875 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
26876 channel_monitors_conv_16_conv.is_owned = false;
26877 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
26879 FREE(channel_monitors);
26880 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);
26881 uint64_t ret_ref = 0;
26882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26887 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint64_t arg) {
26888 LDKu8slice ser_ref;
26889 ser_ref.datalen = ser->arr_len;
26890 ser_ref.data = ser->elems;
26891 LDKChannelManagerReadArgs arg_conv;
26892 arg_conv.inner = untag_ptr(arg);
26893 arg_conv.is_owned = ptr_is_owned(arg);
26894 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26895 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
26897 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
26898 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
26900 return tag_ptr(ret_conv, true);
26903 void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) {
26904 LDKExpandedKey this_obj_conv;
26905 this_obj_conv.inner = untag_ptr(this_obj);
26906 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26908 ExpandedKey_free(this_obj_conv);
26911 uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
26912 unsigned char key_material_arr[32];
26913 CHECK(key_material->arr_len == 32);
26914 memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
26915 unsigned char (*key_material_ref)[32] = &key_material_arr;
26916 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
26917 uint64_t ret_ref = 0;
26918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26923 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) {
26924 LDKExpandedKey keys_conv;
26925 keys_conv.inner = untag_ptr(keys);
26926 keys_conv.is_owned = ptr_is_owned(keys);
26927 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26928 keys_conv.is_owned = false;
26929 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26930 CHECK_ACCESS(min_value_msat_ptr);
26931 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26932 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26933 void* keys_manager_ptr = untag_ptr(keys_manager);
26934 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
26935 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
26936 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26937 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
26938 return tag_ptr(ret_conv, true);
26941 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) {
26942 LDKExpandedKey keys_conv;
26943 keys_conv.inner = untag_ptr(keys);
26944 keys_conv.is_owned = ptr_is_owned(keys);
26945 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26946 keys_conv.is_owned = false;
26947 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26948 CHECK_ACCESS(min_value_msat_ptr);
26949 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26950 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26951 LDKThirtyTwoBytes payment_hash_ref;
26952 CHECK(payment_hash->arr_len == 32);
26953 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26954 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26955 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
26956 return tag_ptr(ret_conv, true);
26959 void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) {
26960 LDKDecodeError this_obj_conv;
26961 this_obj_conv.inner = untag_ptr(this_obj);
26962 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26964 DecodeError_free(this_obj_conv);
26967 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
26968 LDKDecodeError ret_var = DecodeError_clone(arg);
26969 uint64_t ret_ref = 0;
26970 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26971 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26974 int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
26975 LDKDecodeError arg_conv;
26976 arg_conv.inner = untag_ptr(arg);
26977 arg_conv.is_owned = ptr_is_owned(arg);
26978 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26979 arg_conv.is_owned = false;
26980 int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
26984 uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
26985 LDKDecodeError orig_conv;
26986 orig_conv.inner = untag_ptr(orig);
26987 orig_conv.is_owned = ptr_is_owned(orig);
26988 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26989 orig_conv.is_owned = false;
26990 LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
26991 uint64_t ret_ref = 0;
26992 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26993 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26997 void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
26998 LDKInit this_obj_conv;
26999 this_obj_conv.inner = untag_ptr(this_obj);
27000 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27002 Init_free(this_obj_conv);
27005 uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) {
27006 LDKInit this_ptr_conv;
27007 this_ptr_conv.inner = untag_ptr(this_ptr);
27008 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27010 this_ptr_conv.is_owned = false;
27011 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
27012 uint64_t ret_ref = 0;
27013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27018 void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) {
27019 LDKInit this_ptr_conv;
27020 this_ptr_conv.inner = untag_ptr(this_ptr);
27021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27023 this_ptr_conv.is_owned = false;
27024 LDKInitFeatures val_conv;
27025 val_conv.inner = untag_ptr(val);
27026 val_conv.is_owned = ptr_is_owned(val);
27027 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27028 val_conv = InitFeatures_clone(&val_conv);
27029 Init_set_features(&this_ptr_conv, val_conv);
27032 uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) {
27033 LDKInit this_ptr_conv;
27034 this_ptr_conv.inner = untag_ptr(this_ptr);
27035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27037 this_ptr_conv.is_owned = false;
27038 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
27039 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
27040 uint64_t ret_ref = tag_ptr(ret_copy, true);
27044 void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) {
27045 LDKInit this_ptr_conv;
27046 this_ptr_conv.inner = untag_ptr(this_ptr);
27047 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27049 this_ptr_conv.is_owned = false;
27050 void* val_ptr = untag_ptr(val);
27051 CHECK_ACCESS(val_ptr);
27052 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
27053 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
27054 Init_set_remote_network_address(&this_ptr_conv, val_conv);
27057 uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t remote_network_address_arg) {
27058 LDKInitFeatures features_arg_conv;
27059 features_arg_conv.inner = untag_ptr(features_arg);
27060 features_arg_conv.is_owned = ptr_is_owned(features_arg);
27061 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
27062 features_arg_conv = InitFeatures_clone(&features_arg_conv);
27063 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
27064 CHECK_ACCESS(remote_network_address_arg_ptr);
27065 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
27066 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
27067 uint64_t ret_ref = 0;
27068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27073 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
27074 LDKInit ret_var = Init_clone(arg);
27075 uint64_t ret_ref = 0;
27076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27080 int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) {
27082 arg_conv.inner = untag_ptr(arg);
27083 arg_conv.is_owned = ptr_is_owned(arg);
27084 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27085 arg_conv.is_owned = false;
27086 int64_t ret_conv = Init_clone_ptr(&arg_conv);
27090 uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) {
27092 orig_conv.inner = untag_ptr(orig);
27093 orig_conv.is_owned = ptr_is_owned(orig);
27094 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27095 orig_conv.is_owned = false;
27096 LDKInit ret_var = Init_clone(&orig_conv);
27097 uint64_t ret_ref = 0;
27098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27103 void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
27104 LDKErrorMessage this_obj_conv;
27105 this_obj_conv.inner = untag_ptr(this_obj);
27106 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27108 ErrorMessage_free(this_obj_conv);
27111 int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) {
27112 LDKErrorMessage this_ptr_conv;
27113 this_ptr_conv.inner = untag_ptr(this_ptr);
27114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27116 this_ptr_conv.is_owned = false;
27117 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27118 memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32);
27122 void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
27123 LDKErrorMessage this_ptr_conv;
27124 this_ptr_conv.inner = untag_ptr(this_ptr);
27125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27127 this_ptr_conv.is_owned = false;
27128 LDKThirtyTwoBytes val_ref;
27129 CHECK(val->arr_len == 32);
27130 memcpy(val_ref.data, val->elems, 32); FREE(val);
27131 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
27134 jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) {
27135 LDKErrorMessage this_ptr_conv;
27136 this_ptr_conv.inner = untag_ptr(this_ptr);
27137 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27139 this_ptr_conv.is_owned = false;
27140 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
27141 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
27146 void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) {
27147 LDKErrorMessage this_ptr_conv;
27148 this_ptr_conv.inner = untag_ptr(this_ptr);
27149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27151 this_ptr_conv.is_owned = false;
27152 LDKStr val_conv = str_ref_to_owned_c(val);
27153 ErrorMessage_set_data(&this_ptr_conv, val_conv);
27156 uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
27157 LDKThirtyTwoBytes channel_id_arg_ref;
27158 CHECK(channel_id_arg->arr_len == 32);
27159 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
27160 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
27161 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
27162 uint64_t ret_ref = 0;
27163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27168 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
27169 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
27170 uint64_t ret_ref = 0;
27171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27175 int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) {
27176 LDKErrorMessage arg_conv;
27177 arg_conv.inner = untag_ptr(arg);
27178 arg_conv.is_owned = ptr_is_owned(arg);
27179 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27180 arg_conv.is_owned = false;
27181 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
27185 uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) {
27186 LDKErrorMessage orig_conv;
27187 orig_conv.inner = untag_ptr(orig);
27188 orig_conv.is_owned = ptr_is_owned(orig);
27189 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27190 orig_conv.is_owned = false;
27191 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
27192 uint64_t ret_ref = 0;
27193 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27194 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27198 void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
27199 LDKWarningMessage this_obj_conv;
27200 this_obj_conv.inner = untag_ptr(this_obj);
27201 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27203 WarningMessage_free(this_obj_conv);
27206 int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) {
27207 LDKWarningMessage this_ptr_conv;
27208 this_ptr_conv.inner = untag_ptr(this_ptr);
27209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27211 this_ptr_conv.is_owned = false;
27212 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27213 memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32);
27217 void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
27218 LDKWarningMessage this_ptr_conv;
27219 this_ptr_conv.inner = untag_ptr(this_ptr);
27220 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27222 this_ptr_conv.is_owned = false;
27223 LDKThirtyTwoBytes val_ref;
27224 CHECK(val->arr_len == 32);
27225 memcpy(val_ref.data, val->elems, 32); FREE(val);
27226 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
27229 jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) {
27230 LDKWarningMessage this_ptr_conv;
27231 this_ptr_conv.inner = untag_ptr(this_ptr);
27232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27234 this_ptr_conv.is_owned = false;
27235 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
27236 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
27241 void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) {
27242 LDKWarningMessage this_ptr_conv;
27243 this_ptr_conv.inner = untag_ptr(this_ptr);
27244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27246 this_ptr_conv.is_owned = false;
27247 LDKStr val_conv = str_ref_to_owned_c(val);
27248 WarningMessage_set_data(&this_ptr_conv, val_conv);
27251 uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
27252 LDKThirtyTwoBytes channel_id_arg_ref;
27253 CHECK(channel_id_arg->arr_len == 32);
27254 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
27255 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
27256 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
27257 uint64_t ret_ref = 0;
27258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27263 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
27264 LDKWarningMessage ret_var = WarningMessage_clone(arg);
27265 uint64_t ret_ref = 0;
27266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27270 int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) {
27271 LDKWarningMessage arg_conv;
27272 arg_conv.inner = untag_ptr(arg);
27273 arg_conv.is_owned = ptr_is_owned(arg);
27274 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27275 arg_conv.is_owned = false;
27276 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
27280 uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) {
27281 LDKWarningMessage orig_conv;
27282 orig_conv.inner = untag_ptr(orig);
27283 orig_conv.is_owned = ptr_is_owned(orig);
27284 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27285 orig_conv.is_owned = false;
27286 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
27287 uint64_t ret_ref = 0;
27288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27293 void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
27294 LDKPing this_obj_conv;
27295 this_obj_conv.inner = untag_ptr(this_obj);
27296 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27298 Ping_free(this_obj_conv);
27301 int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) {
27302 LDKPing this_ptr_conv;
27303 this_ptr_conv.inner = untag_ptr(this_ptr);
27304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27306 this_ptr_conv.is_owned = false;
27307 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
27311 void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) {
27312 LDKPing this_ptr_conv;
27313 this_ptr_conv.inner = untag_ptr(this_ptr);
27314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27316 this_ptr_conv.is_owned = false;
27317 Ping_set_ponglen(&this_ptr_conv, val);
27320 int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) {
27321 LDKPing this_ptr_conv;
27322 this_ptr_conv.inner = untag_ptr(this_ptr);
27323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27325 this_ptr_conv.is_owned = false;
27326 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
27330 void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) {
27331 LDKPing this_ptr_conv;
27332 this_ptr_conv.inner = untag_ptr(this_ptr);
27333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27335 this_ptr_conv.is_owned = false;
27336 Ping_set_byteslen(&this_ptr_conv, val);
27339 uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
27340 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
27341 uint64_t ret_ref = 0;
27342 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27343 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27347 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
27348 LDKPing ret_var = Ping_clone(arg);
27349 uint64_t ret_ref = 0;
27350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27354 int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) {
27356 arg_conv.inner = untag_ptr(arg);
27357 arg_conv.is_owned = ptr_is_owned(arg);
27358 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27359 arg_conv.is_owned = false;
27360 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
27364 uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) {
27366 orig_conv.inner = untag_ptr(orig);
27367 orig_conv.is_owned = ptr_is_owned(orig);
27368 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27369 orig_conv.is_owned = false;
27370 LDKPing ret_var = Ping_clone(&orig_conv);
27371 uint64_t ret_ref = 0;
27372 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27373 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27377 void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
27378 LDKPong this_obj_conv;
27379 this_obj_conv.inner = untag_ptr(this_obj);
27380 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27382 Pong_free(this_obj_conv);
27385 int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) {
27386 LDKPong this_ptr_conv;
27387 this_ptr_conv.inner = untag_ptr(this_ptr);
27388 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27390 this_ptr_conv.is_owned = false;
27391 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
27395 void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) {
27396 LDKPong this_ptr_conv;
27397 this_ptr_conv.inner = untag_ptr(this_ptr);
27398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27400 this_ptr_conv.is_owned = false;
27401 Pong_set_byteslen(&this_ptr_conv, val);
27404 uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) {
27405 LDKPong ret_var = Pong_new(byteslen_arg);
27406 uint64_t ret_ref = 0;
27407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27412 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
27413 LDKPong ret_var = Pong_clone(arg);
27414 uint64_t ret_ref = 0;
27415 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27416 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27419 int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) {
27421 arg_conv.inner = untag_ptr(arg);
27422 arg_conv.is_owned = ptr_is_owned(arg);
27423 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27424 arg_conv.is_owned = false;
27425 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
27429 uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) {
27431 orig_conv.inner = untag_ptr(orig);
27432 orig_conv.is_owned = ptr_is_owned(orig);
27433 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27434 orig_conv.is_owned = false;
27435 LDKPong ret_var = Pong_clone(&orig_conv);
27436 uint64_t ret_ref = 0;
27437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27442 void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
27443 LDKOpenChannel this_obj_conv;
27444 this_obj_conv.inner = untag_ptr(this_obj);
27445 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27447 OpenChannel_free(this_obj_conv);
27450 int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) {
27451 LDKOpenChannel this_ptr_conv;
27452 this_ptr_conv.inner = untag_ptr(this_ptr);
27453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27455 this_ptr_conv.is_owned = false;
27456 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27457 memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32);
27461 void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
27462 LDKOpenChannel this_ptr_conv;
27463 this_ptr_conv.inner = untag_ptr(this_ptr);
27464 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27466 this_ptr_conv.is_owned = false;
27467 LDKThirtyTwoBytes val_ref;
27468 CHECK(val->arr_len == 32);
27469 memcpy(val_ref.data, val->elems, 32); FREE(val);
27470 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
27473 int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) {
27474 LDKOpenChannel this_ptr_conv;
27475 this_ptr_conv.inner = untag_ptr(this_ptr);
27476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27478 this_ptr_conv.is_owned = false;
27479 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27480 memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27484 void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27485 LDKOpenChannel this_ptr_conv;
27486 this_ptr_conv.inner = untag_ptr(this_ptr);
27487 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27489 this_ptr_conv.is_owned = false;
27490 LDKThirtyTwoBytes val_ref;
27491 CHECK(val->arr_len == 32);
27492 memcpy(val_ref.data, val->elems, 32); FREE(val);
27493 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27496 int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) {
27497 LDKOpenChannel this_ptr_conv;
27498 this_ptr_conv.inner = untag_ptr(this_ptr);
27499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27501 this_ptr_conv.is_owned = false;
27502 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
27506 void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) {
27507 LDKOpenChannel this_ptr_conv;
27508 this_ptr_conv.inner = untag_ptr(this_ptr);
27509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27511 this_ptr_conv.is_owned = false;
27512 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
27515 int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) {
27516 LDKOpenChannel this_ptr_conv;
27517 this_ptr_conv.inner = untag_ptr(this_ptr);
27518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27520 this_ptr_conv.is_owned = false;
27521 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
27525 void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) {
27526 LDKOpenChannel this_ptr_conv;
27527 this_ptr_conv.inner = untag_ptr(this_ptr);
27528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27530 this_ptr_conv.is_owned = false;
27531 OpenChannel_set_push_msat(&this_ptr_conv, val);
27534 int64_t __attribute__((export_name("TS_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27535 LDKOpenChannel this_ptr_conv;
27536 this_ptr_conv.inner = untag_ptr(this_ptr);
27537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27539 this_ptr_conv.is_owned = false;
27540 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
27544 void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27545 LDKOpenChannel this_ptr_conv;
27546 this_ptr_conv.inner = untag_ptr(this_ptr);
27547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27549 this_ptr_conv.is_owned = false;
27550 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27553 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) {
27554 LDKOpenChannel this_ptr_conv;
27555 this_ptr_conv.inner = untag_ptr(this_ptr);
27556 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27558 this_ptr_conv.is_owned = false;
27559 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27563 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) {
27564 LDKOpenChannel this_ptr_conv;
27565 this_ptr_conv.inner = untag_ptr(this_ptr);
27566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27568 this_ptr_conv.is_owned = false;
27569 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27572 int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27573 LDKOpenChannel this_ptr_conv;
27574 this_ptr_conv.inner = untag_ptr(this_ptr);
27575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27577 this_ptr_conv.is_owned = false;
27578 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27582 void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27583 LDKOpenChannel this_ptr_conv;
27584 this_ptr_conv.inner = untag_ptr(this_ptr);
27585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27587 this_ptr_conv.is_owned = false;
27588 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27591 int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27592 LDKOpenChannel this_ptr_conv;
27593 this_ptr_conv.inner = untag_ptr(this_ptr);
27594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27596 this_ptr_conv.is_owned = false;
27597 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
27601 void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27602 LDKOpenChannel this_ptr_conv;
27603 this_ptr_conv.inner = untag_ptr(this_ptr);
27604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27606 this_ptr_conv.is_owned = false;
27607 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27610 int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) {
27611 LDKOpenChannel this_ptr_conv;
27612 this_ptr_conv.inner = untag_ptr(this_ptr);
27613 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27615 this_ptr_conv.is_owned = false;
27616 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
27620 void __attribute__((export_name("TS_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
27621 LDKOpenChannel this_ptr_conv;
27622 this_ptr_conv.inner = untag_ptr(this_ptr);
27623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27625 this_ptr_conv.is_owned = false;
27626 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
27629 int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) {
27630 LDKOpenChannel this_ptr_conv;
27631 this_ptr_conv.inner = untag_ptr(this_ptr);
27632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27634 this_ptr_conv.is_owned = false;
27635 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
27639 void __attribute__((export_name("TS_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
27640 LDKOpenChannel this_ptr_conv;
27641 this_ptr_conv.inner = untag_ptr(this_ptr);
27642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27644 this_ptr_conv.is_owned = false;
27645 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
27648 int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
27649 LDKOpenChannel this_ptr_conv;
27650 this_ptr_conv.inner = untag_ptr(this_ptr);
27651 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27653 this_ptr_conv.is_owned = false;
27654 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
27658 void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
27659 LDKOpenChannel this_ptr_conv;
27660 this_ptr_conv.inner = untag_ptr(this_ptr);
27661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27663 this_ptr_conv.is_owned = false;
27664 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
27667 int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) {
27668 LDKOpenChannel this_ptr_conv;
27669 this_ptr_conv.inner = untag_ptr(this_ptr);
27670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27672 this_ptr_conv.is_owned = false;
27673 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27674 memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
27678 void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
27679 LDKOpenChannel this_ptr_conv;
27680 this_ptr_conv.inner = untag_ptr(this_ptr);
27681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27683 this_ptr_conv.is_owned = false;
27684 LDKPublicKey val_ref;
27685 CHECK(val->arr_len == 33);
27686 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27687 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
27690 int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) {
27691 LDKOpenChannel this_ptr_conv;
27692 this_ptr_conv.inner = untag_ptr(this_ptr);
27693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27695 this_ptr_conv.is_owned = false;
27696 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27697 memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
27701 void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
27702 LDKOpenChannel this_ptr_conv;
27703 this_ptr_conv.inner = untag_ptr(this_ptr);
27704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27706 this_ptr_conv.is_owned = false;
27707 LDKPublicKey val_ref;
27708 CHECK(val->arr_len == 33);
27709 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27710 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
27713 int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) {
27714 LDKOpenChannel this_ptr_conv;
27715 this_ptr_conv.inner = untag_ptr(this_ptr);
27716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27718 this_ptr_conv.is_owned = false;
27719 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27720 memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
27724 void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
27725 LDKOpenChannel this_ptr_conv;
27726 this_ptr_conv.inner = untag_ptr(this_ptr);
27727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27729 this_ptr_conv.is_owned = false;
27730 LDKPublicKey val_ref;
27731 CHECK(val->arr_len == 33);
27732 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27733 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
27736 int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
27737 LDKOpenChannel this_ptr_conv;
27738 this_ptr_conv.inner = untag_ptr(this_ptr);
27739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27741 this_ptr_conv.is_owned = false;
27742 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27743 memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
27747 void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
27748 LDKOpenChannel this_ptr_conv;
27749 this_ptr_conv.inner = untag_ptr(this_ptr);
27750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27752 this_ptr_conv.is_owned = false;
27753 LDKPublicKey val_ref;
27754 CHECK(val->arr_len == 33);
27755 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27756 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
27759 int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) {
27760 LDKOpenChannel this_ptr_conv;
27761 this_ptr_conv.inner = untag_ptr(this_ptr);
27762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27764 this_ptr_conv.is_owned = false;
27765 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27766 memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
27770 void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
27771 LDKOpenChannel this_ptr_conv;
27772 this_ptr_conv.inner = untag_ptr(this_ptr);
27773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27775 this_ptr_conv.is_owned = false;
27776 LDKPublicKey val_ref;
27777 CHECK(val->arr_len == 33);
27778 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27779 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
27782 int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) {
27783 LDKOpenChannel this_ptr_conv;
27784 this_ptr_conv.inner = untag_ptr(this_ptr);
27785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27787 this_ptr_conv.is_owned = false;
27788 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27789 memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
27793 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) {
27794 LDKOpenChannel this_ptr_conv;
27795 this_ptr_conv.inner = untag_ptr(this_ptr);
27796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27798 this_ptr_conv.is_owned = false;
27799 LDKPublicKey val_ref;
27800 CHECK(val->arr_len == 33);
27801 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27802 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
27805 int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) {
27806 LDKOpenChannel this_ptr_conv;
27807 this_ptr_conv.inner = untag_ptr(this_ptr);
27808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27810 this_ptr_conv.is_owned = false;
27811 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
27815 void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) {
27816 LDKOpenChannel this_ptr_conv;
27817 this_ptr_conv.inner = untag_ptr(this_ptr);
27818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27820 this_ptr_conv.is_owned = false;
27821 OpenChannel_set_channel_flags(&this_ptr_conv, val);
27824 uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) {
27825 LDKOpenChannel this_ptr_conv;
27826 this_ptr_conv.inner = untag_ptr(this_ptr);
27827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27829 this_ptr_conv.is_owned = false;
27830 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
27831 uint64_t ret_ref = 0;
27832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27837 void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
27838 LDKOpenChannel this_ptr_conv;
27839 this_ptr_conv.inner = untag_ptr(this_ptr);
27840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27842 this_ptr_conv.is_owned = false;
27843 LDKChannelTypeFeatures val_conv;
27844 val_conv.inner = untag_ptr(val);
27845 val_conv.is_owned = ptr_is_owned(val);
27846 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27847 val_conv = ChannelTypeFeatures_clone(&val_conv);
27848 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
27851 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
27852 LDKOpenChannel ret_var = OpenChannel_clone(arg);
27853 uint64_t ret_ref = 0;
27854 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27855 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27858 int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) {
27859 LDKOpenChannel arg_conv;
27860 arg_conv.inner = untag_ptr(arg);
27861 arg_conv.is_owned = ptr_is_owned(arg);
27862 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27863 arg_conv.is_owned = false;
27864 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
27868 uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) {
27869 LDKOpenChannel orig_conv;
27870 orig_conv.inner = untag_ptr(orig);
27871 orig_conv.is_owned = ptr_is_owned(orig);
27872 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27873 orig_conv.is_owned = false;
27874 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
27875 uint64_t ret_ref = 0;
27876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27881 void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
27882 LDKAcceptChannel this_obj_conv;
27883 this_obj_conv.inner = untag_ptr(this_obj);
27884 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27886 AcceptChannel_free(this_obj_conv);
27889 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) {
27890 LDKAcceptChannel this_ptr_conv;
27891 this_ptr_conv.inner = untag_ptr(this_ptr);
27892 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27894 this_ptr_conv.is_owned = false;
27895 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27896 memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27900 void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27901 LDKAcceptChannel this_ptr_conv;
27902 this_ptr_conv.inner = untag_ptr(this_ptr);
27903 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27905 this_ptr_conv.is_owned = false;
27906 LDKThirtyTwoBytes val_ref;
27907 CHECK(val->arr_len == 32);
27908 memcpy(val_ref.data, val->elems, 32); FREE(val);
27909 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27912 int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27913 LDKAcceptChannel this_ptr_conv;
27914 this_ptr_conv.inner = untag_ptr(this_ptr);
27915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27917 this_ptr_conv.is_owned = false;
27918 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
27922 void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27923 LDKAcceptChannel this_ptr_conv;
27924 this_ptr_conv.inner = untag_ptr(this_ptr);
27925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27927 this_ptr_conv.is_owned = false;
27928 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27931 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) {
27932 LDKAcceptChannel this_ptr_conv;
27933 this_ptr_conv.inner = untag_ptr(this_ptr);
27934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27936 this_ptr_conv.is_owned = false;
27937 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27941 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) {
27942 LDKAcceptChannel this_ptr_conv;
27943 this_ptr_conv.inner = untag_ptr(this_ptr);
27944 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27946 this_ptr_conv.is_owned = false;
27947 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27950 int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27951 LDKAcceptChannel this_ptr_conv;
27952 this_ptr_conv.inner = untag_ptr(this_ptr);
27953 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27955 this_ptr_conv.is_owned = false;
27956 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27960 void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27961 LDKAcceptChannel this_ptr_conv;
27962 this_ptr_conv.inner = untag_ptr(this_ptr);
27963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27965 this_ptr_conv.is_owned = false;
27966 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27969 int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27970 LDKAcceptChannel this_ptr_conv;
27971 this_ptr_conv.inner = untag_ptr(this_ptr);
27972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27974 this_ptr_conv.is_owned = false;
27975 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
27979 void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27980 LDKAcceptChannel this_ptr_conv;
27981 this_ptr_conv.inner = untag_ptr(this_ptr);
27982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27984 this_ptr_conv.is_owned = false;
27985 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27988 int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) {
27989 LDKAcceptChannel this_ptr_conv;
27990 this_ptr_conv.inner = untag_ptr(this_ptr);
27991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27993 this_ptr_conv.is_owned = false;
27994 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
27998 void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) {
27999 LDKAcceptChannel this_ptr_conv;
28000 this_ptr_conv.inner = untag_ptr(this_ptr);
28001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28003 this_ptr_conv.is_owned = false;
28004 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
28007 int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) {
28008 LDKAcceptChannel this_ptr_conv;
28009 this_ptr_conv.inner = untag_ptr(this_ptr);
28010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28012 this_ptr_conv.is_owned = false;
28013 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
28017 void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
28018 LDKAcceptChannel this_ptr_conv;
28019 this_ptr_conv.inner = untag_ptr(this_ptr);
28020 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28022 this_ptr_conv.is_owned = false;
28023 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
28026 int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
28027 LDKAcceptChannel this_ptr_conv;
28028 this_ptr_conv.inner = untag_ptr(this_ptr);
28029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28031 this_ptr_conv.is_owned = false;
28032 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
28036 void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
28037 LDKAcceptChannel this_ptr_conv;
28038 this_ptr_conv.inner = untag_ptr(this_ptr);
28039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28041 this_ptr_conv.is_owned = false;
28042 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
28045 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) {
28046 LDKAcceptChannel this_ptr_conv;
28047 this_ptr_conv.inner = untag_ptr(this_ptr);
28048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28050 this_ptr_conv.is_owned = false;
28051 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28052 memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
28056 void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
28057 LDKAcceptChannel this_ptr_conv;
28058 this_ptr_conv.inner = untag_ptr(this_ptr);
28059 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28061 this_ptr_conv.is_owned = false;
28062 LDKPublicKey val_ref;
28063 CHECK(val->arr_len == 33);
28064 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28065 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
28068 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) {
28069 LDKAcceptChannel this_ptr_conv;
28070 this_ptr_conv.inner = untag_ptr(this_ptr);
28071 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28073 this_ptr_conv.is_owned = false;
28074 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28075 memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
28079 void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
28080 LDKAcceptChannel this_ptr_conv;
28081 this_ptr_conv.inner = untag_ptr(this_ptr);
28082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28084 this_ptr_conv.is_owned = false;
28085 LDKPublicKey val_ref;
28086 CHECK(val->arr_len == 33);
28087 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28088 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
28091 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) {
28092 LDKAcceptChannel this_ptr_conv;
28093 this_ptr_conv.inner = untag_ptr(this_ptr);
28094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28096 this_ptr_conv.is_owned = false;
28097 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28098 memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
28102 void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
28103 LDKAcceptChannel this_ptr_conv;
28104 this_ptr_conv.inner = untag_ptr(this_ptr);
28105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28107 this_ptr_conv.is_owned = false;
28108 LDKPublicKey val_ref;
28109 CHECK(val->arr_len == 33);
28110 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28111 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
28114 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
28115 LDKAcceptChannel this_ptr_conv;
28116 this_ptr_conv.inner = untag_ptr(this_ptr);
28117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28119 this_ptr_conv.is_owned = false;
28120 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28121 memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
28125 void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
28126 LDKAcceptChannel this_ptr_conv;
28127 this_ptr_conv.inner = untag_ptr(this_ptr);
28128 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28130 this_ptr_conv.is_owned = false;
28131 LDKPublicKey val_ref;
28132 CHECK(val->arr_len == 33);
28133 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28134 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
28137 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) {
28138 LDKAcceptChannel this_ptr_conv;
28139 this_ptr_conv.inner = untag_ptr(this_ptr);
28140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28142 this_ptr_conv.is_owned = false;
28143 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28144 memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
28148 void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
28149 LDKAcceptChannel this_ptr_conv;
28150 this_ptr_conv.inner = untag_ptr(this_ptr);
28151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28153 this_ptr_conv.is_owned = false;
28154 LDKPublicKey val_ref;
28155 CHECK(val->arr_len == 33);
28156 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28157 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
28160 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) {
28161 LDKAcceptChannel this_ptr_conv;
28162 this_ptr_conv.inner = untag_ptr(this_ptr);
28163 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28165 this_ptr_conv.is_owned = false;
28166 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28167 memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28171 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) {
28172 LDKAcceptChannel this_ptr_conv;
28173 this_ptr_conv.inner = untag_ptr(this_ptr);
28174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28176 this_ptr_conv.is_owned = false;
28177 LDKPublicKey val_ref;
28178 CHECK(val->arr_len == 33);
28179 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28180 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
28183 uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) {
28184 LDKAcceptChannel this_ptr_conv;
28185 this_ptr_conv.inner = untag_ptr(this_ptr);
28186 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28188 this_ptr_conv.is_owned = false;
28189 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
28190 uint64_t ret_ref = 0;
28191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28196 void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
28197 LDKAcceptChannel this_ptr_conv;
28198 this_ptr_conv.inner = untag_ptr(this_ptr);
28199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28201 this_ptr_conv.is_owned = false;
28202 LDKChannelTypeFeatures val_conv;
28203 val_conv.inner = untag_ptr(val);
28204 val_conv.is_owned = ptr_is_owned(val);
28205 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28206 val_conv = ChannelTypeFeatures_clone(&val_conv);
28207 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
28210 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
28211 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
28212 uint64_t ret_ref = 0;
28213 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28214 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28217 int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint64_t arg) {
28218 LDKAcceptChannel arg_conv;
28219 arg_conv.inner = untag_ptr(arg);
28220 arg_conv.is_owned = ptr_is_owned(arg);
28221 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28222 arg_conv.is_owned = false;
28223 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
28227 uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChannel_clone(uint64_t orig) {
28228 LDKAcceptChannel orig_conv;
28229 orig_conv.inner = untag_ptr(orig);
28230 orig_conv.is_owned = ptr_is_owned(orig);
28231 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28232 orig_conv.is_owned = false;
28233 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
28234 uint64_t ret_ref = 0;
28235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28240 void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
28241 LDKFundingCreated this_obj_conv;
28242 this_obj_conv.inner = untag_ptr(this_obj);
28243 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28245 FundingCreated_free(this_obj_conv);
28248 int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) {
28249 LDKFundingCreated this_ptr_conv;
28250 this_ptr_conv.inner = untag_ptr(this_ptr);
28251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28253 this_ptr_conv.is_owned = false;
28254 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28255 memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32);
28259 void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
28260 LDKFundingCreated this_ptr_conv;
28261 this_ptr_conv.inner = untag_ptr(this_ptr);
28262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28264 this_ptr_conv.is_owned = false;
28265 LDKThirtyTwoBytes val_ref;
28266 CHECK(val->arr_len == 32);
28267 memcpy(val_ref.data, val->elems, 32); FREE(val);
28268 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
28271 int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) {
28272 LDKFundingCreated this_ptr_conv;
28273 this_ptr_conv.inner = untag_ptr(this_ptr);
28274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28276 this_ptr_conv.is_owned = false;
28277 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28278 memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32);
28282 void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_FundingCreated_set_funding_txid(uint64_t this_ptr, int8_tArray val) {
28283 LDKFundingCreated this_ptr_conv;
28284 this_ptr_conv.inner = untag_ptr(this_ptr);
28285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28287 this_ptr_conv.is_owned = false;
28288 LDKThirtyTwoBytes val_ref;
28289 CHECK(val->arr_len == 32);
28290 memcpy(val_ref.data, val->elems, 32); FREE(val);
28291 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
28294 int16_t __attribute__((export_name("TS_FundingCreated_get_funding_output_index"))) TS_FundingCreated_get_funding_output_index(uint64_t this_ptr) {
28295 LDKFundingCreated this_ptr_conv;
28296 this_ptr_conv.inner = untag_ptr(this_ptr);
28297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28299 this_ptr_conv.is_owned = false;
28300 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
28304 void __attribute__((export_name("TS_FundingCreated_set_funding_output_index"))) TS_FundingCreated_set_funding_output_index(uint64_t this_ptr, int16_t val) {
28305 LDKFundingCreated this_ptr_conv;
28306 this_ptr_conv.inner = untag_ptr(this_ptr);
28307 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28309 this_ptr_conv.is_owned = false;
28310 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
28313 int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_FundingCreated_get_signature(uint64_t this_ptr) {
28314 LDKFundingCreated this_ptr_conv;
28315 this_ptr_conv.inner = untag_ptr(this_ptr);
28316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28318 this_ptr_conv.is_owned = false;
28319 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28320 memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
28324 void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_FundingCreated_set_signature(uint64_t this_ptr, int8_tArray val) {
28325 LDKFundingCreated this_ptr_conv;
28326 this_ptr_conv.inner = untag_ptr(this_ptr);
28327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28329 this_ptr_conv.is_owned = false;
28330 LDKSignature val_ref;
28331 CHECK(val->arr_len == 64);
28332 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28333 FundingCreated_set_signature(&this_ptr_conv, val_ref);
28336 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) {
28337 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
28338 CHECK(temporary_channel_id_arg->arr_len == 32);
28339 memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg);
28340 LDKThirtyTwoBytes funding_txid_arg_ref;
28341 CHECK(funding_txid_arg->arr_len == 32);
28342 memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg);
28343 LDKSignature signature_arg_ref;
28344 CHECK(signature_arg->arr_len == 64);
28345 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28346 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
28347 uint64_t ret_ref = 0;
28348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28353 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
28354 LDKFundingCreated ret_var = FundingCreated_clone(arg);
28355 uint64_t ret_ref = 0;
28356 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28357 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28360 int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint64_t arg) {
28361 LDKFundingCreated arg_conv;
28362 arg_conv.inner = untag_ptr(arg);
28363 arg_conv.is_owned = ptr_is_owned(arg);
28364 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28365 arg_conv.is_owned = false;
28366 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
28370 uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCreated_clone(uint64_t orig) {
28371 LDKFundingCreated orig_conv;
28372 orig_conv.inner = untag_ptr(orig);
28373 orig_conv.is_owned = ptr_is_owned(orig);
28374 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28375 orig_conv.is_owned = false;
28376 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
28377 uint64_t ret_ref = 0;
28378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28383 void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
28384 LDKFundingSigned this_obj_conv;
28385 this_obj_conv.inner = untag_ptr(this_obj);
28386 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28388 FundingSigned_free(this_obj_conv);
28391 int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) {
28392 LDKFundingSigned this_ptr_conv;
28393 this_ptr_conv.inner = untag_ptr(this_ptr);
28394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28396 this_ptr_conv.is_owned = false;
28397 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28398 memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32);
28402 void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28403 LDKFundingSigned this_ptr_conv;
28404 this_ptr_conv.inner = untag_ptr(this_ptr);
28405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28407 this_ptr_conv.is_owned = false;
28408 LDKThirtyTwoBytes val_ref;
28409 CHECK(val->arr_len == 32);
28410 memcpy(val_ref.data, val->elems, 32); FREE(val);
28411 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
28414 int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) {
28415 LDKFundingSigned this_ptr_conv;
28416 this_ptr_conv.inner = untag_ptr(this_ptr);
28417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28419 this_ptr_conv.is_owned = false;
28420 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28421 memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28425 void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28426 LDKFundingSigned this_ptr_conv;
28427 this_ptr_conv.inner = untag_ptr(this_ptr);
28428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28430 this_ptr_conv.is_owned = false;
28431 LDKSignature val_ref;
28432 CHECK(val->arr_len == 64);
28433 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28434 FundingSigned_set_signature(&this_ptr_conv, val_ref);
28437 uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) {
28438 LDKThirtyTwoBytes channel_id_arg_ref;
28439 CHECK(channel_id_arg->arr_len == 32);
28440 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28441 LDKSignature signature_arg_ref;
28442 CHECK(signature_arg->arr_len == 64);
28443 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28444 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
28445 uint64_t ret_ref = 0;
28446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28451 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
28452 LDKFundingSigned ret_var = FundingSigned_clone(arg);
28453 uint64_t ret_ref = 0;
28454 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28455 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28458 int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint64_t arg) {
28459 LDKFundingSigned arg_conv;
28460 arg_conv.inner = untag_ptr(arg);
28461 arg_conv.is_owned = ptr_is_owned(arg);
28462 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28463 arg_conv.is_owned = false;
28464 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
28468 uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigned_clone(uint64_t orig) {
28469 LDKFundingSigned orig_conv;
28470 orig_conv.inner = untag_ptr(orig);
28471 orig_conv.is_owned = ptr_is_owned(orig);
28472 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28473 orig_conv.is_owned = false;
28474 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
28475 uint64_t ret_ref = 0;
28476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28481 void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
28482 LDKChannelReady this_obj_conv;
28483 this_obj_conv.inner = untag_ptr(this_obj);
28484 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28486 ChannelReady_free(this_obj_conv);
28489 int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) {
28490 LDKChannelReady 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28496 memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32);
28500 void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28501 LDKChannelReady this_ptr_conv;
28502 this_ptr_conv.inner = untag_ptr(this_ptr);
28503 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28505 this_ptr_conv.is_owned = false;
28506 LDKThirtyTwoBytes val_ref;
28507 CHECK(val->arr_len == 32);
28508 memcpy(val_ref.data, val->elems, 32); FREE(val);
28509 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
28512 int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) {
28513 LDKChannelReady this_ptr_conv;
28514 this_ptr_conv.inner = untag_ptr(this_ptr);
28515 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28517 this_ptr_conv.is_owned = false;
28518 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28519 memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28523 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) {
28524 LDKChannelReady this_ptr_conv;
28525 this_ptr_conv.inner = untag_ptr(this_ptr);
28526 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28528 this_ptr_conv.is_owned = false;
28529 LDKPublicKey val_ref;
28530 CHECK(val->arr_len == 33);
28531 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28532 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
28535 uint64_t __attribute__((export_name("TS_ChannelReady_get_short_channel_id_alias"))) TS_ChannelReady_get_short_channel_id_alias(uint64_t this_ptr) {
28536 LDKChannelReady this_ptr_conv;
28537 this_ptr_conv.inner = untag_ptr(this_ptr);
28538 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28540 this_ptr_conv.is_owned = false;
28541 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28542 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
28543 uint64_t ret_ref = tag_ptr(ret_copy, true);
28547 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) {
28548 LDKChannelReady this_ptr_conv;
28549 this_ptr_conv.inner = untag_ptr(this_ptr);
28550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28552 this_ptr_conv.is_owned = false;
28553 void* val_ptr = untag_ptr(val);
28554 CHECK_ACCESS(val_ptr);
28555 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28556 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28557 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
28560 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) {
28561 LDKThirtyTwoBytes channel_id_arg_ref;
28562 CHECK(channel_id_arg->arr_len == 32);
28563 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28564 LDKPublicKey next_per_commitment_point_arg_ref;
28565 CHECK(next_per_commitment_point_arg->arr_len == 33);
28566 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
28567 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
28568 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
28569 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
28570 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
28571 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
28572 uint64_t ret_ref = 0;
28573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28578 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
28579 LDKChannelReady ret_var = ChannelReady_clone(arg);
28580 uint64_t ret_ref = 0;
28581 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28582 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28585 int64_t __attribute__((export_name("TS_ChannelReady_clone_ptr"))) TS_ChannelReady_clone_ptr(uint64_t arg) {
28586 LDKChannelReady arg_conv;
28587 arg_conv.inner = untag_ptr(arg);
28588 arg_conv.is_owned = ptr_is_owned(arg);
28589 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28590 arg_conv.is_owned = false;
28591 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
28595 uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_clone(uint64_t orig) {
28596 LDKChannelReady orig_conv;
28597 orig_conv.inner = untag_ptr(orig);
28598 orig_conv.is_owned = ptr_is_owned(orig);
28599 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28600 orig_conv.is_owned = false;
28601 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
28602 uint64_t ret_ref = 0;
28603 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28604 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28608 void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
28609 LDKShutdown this_obj_conv;
28610 this_obj_conv.inner = untag_ptr(this_obj);
28611 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28613 Shutdown_free(this_obj_conv);
28616 int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) {
28617 LDKShutdown this_ptr_conv;
28618 this_ptr_conv.inner = untag_ptr(this_ptr);
28619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28621 this_ptr_conv.is_owned = false;
28622 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28623 memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32);
28627 void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28628 LDKShutdown this_ptr_conv;
28629 this_ptr_conv.inner = untag_ptr(this_ptr);
28630 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28632 this_ptr_conv.is_owned = false;
28633 LDKThirtyTwoBytes val_ref;
28634 CHECK(val->arr_len == 32);
28635 memcpy(val_ref.data, val->elems, 32); FREE(val);
28636 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
28639 int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) {
28640 LDKShutdown this_ptr_conv;
28641 this_ptr_conv.inner = untag_ptr(this_ptr);
28642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28644 this_ptr_conv.is_owned = false;
28645 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
28646 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28647 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28651 void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_set_scriptpubkey(uint64_t this_ptr, int8_tArray val) {
28652 LDKShutdown this_ptr_conv;
28653 this_ptr_conv.inner = untag_ptr(this_ptr);
28654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28656 this_ptr_conv.is_owned = false;
28657 LDKCVec_u8Z val_ref;
28658 val_ref.datalen = val->arr_len;
28659 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
28660 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
28661 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
28664 uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
28665 LDKThirtyTwoBytes channel_id_arg_ref;
28666 CHECK(channel_id_arg->arr_len == 32);
28667 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28668 LDKCVec_u8Z scriptpubkey_arg_ref;
28669 scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len;
28670 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
28671 memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg);
28672 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
28673 uint64_t ret_ref = 0;
28674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28679 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
28680 LDKShutdown ret_var = Shutdown_clone(arg);
28681 uint64_t ret_ref = 0;
28682 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28683 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28686 int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint64_t arg) {
28687 LDKShutdown arg_conv;
28688 arg_conv.inner = untag_ptr(arg);
28689 arg_conv.is_owned = ptr_is_owned(arg);
28690 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28691 arg_conv.is_owned = false;
28692 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
28696 uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(uint64_t orig) {
28697 LDKShutdown orig_conv;
28698 orig_conv.inner = untag_ptr(orig);
28699 orig_conv.is_owned = ptr_is_owned(orig);
28700 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28701 orig_conv.is_owned = false;
28702 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
28703 uint64_t ret_ref = 0;
28704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28709 void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
28710 LDKClosingSignedFeeRange this_obj_conv;
28711 this_obj_conv.inner = untag_ptr(this_obj);
28712 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28714 ClosingSignedFeeRange_free(this_obj_conv);
28717 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_min_fee_satoshis"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint64_t this_ptr) {
28718 LDKClosingSignedFeeRange this_ptr_conv;
28719 this_ptr_conv.inner = untag_ptr(this_ptr);
28720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28722 this_ptr_conv.is_owned = false;
28723 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
28727 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_min_fee_satoshis"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint64_t this_ptr, int64_t val) {
28728 LDKClosingSignedFeeRange this_ptr_conv;
28729 this_ptr_conv.inner = untag_ptr(this_ptr);
28730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28732 this_ptr_conv.is_owned = false;
28733 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
28736 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_max_fee_satoshis"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint64_t this_ptr) {
28737 LDKClosingSignedFeeRange this_ptr_conv;
28738 this_ptr_conv.inner = untag_ptr(this_ptr);
28739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28741 this_ptr_conv.is_owned = false;
28742 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
28746 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
28747 LDKClosingSignedFeeRange this_ptr_conv;
28748 this_ptr_conv.inner = untag_ptr(this_ptr);
28749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28751 this_ptr_conv.is_owned = false;
28752 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
28755 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
28756 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
28757 uint64_t ret_ref = 0;
28758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28763 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
28764 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
28765 uint64_t ret_ref = 0;
28766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28770 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint64_t arg) {
28771 LDKClosingSignedFeeRange arg_conv;
28772 arg_conv.inner = untag_ptr(arg);
28773 arg_conv.is_owned = ptr_is_owned(arg);
28774 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28775 arg_conv.is_owned = false;
28776 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
28780 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_ClosingSignedFeeRange_clone(uint64_t orig) {
28781 LDKClosingSignedFeeRange orig_conv;
28782 orig_conv.inner = untag_ptr(orig);
28783 orig_conv.is_owned = ptr_is_owned(orig);
28784 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28785 orig_conv.is_owned = false;
28786 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
28787 uint64_t ret_ref = 0;
28788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28793 void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
28794 LDKClosingSigned this_obj_conv;
28795 this_obj_conv.inner = untag_ptr(this_obj);
28796 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28798 ClosingSigned_free(this_obj_conv);
28801 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) {
28802 LDKClosingSigned this_ptr_conv;
28803 this_ptr_conv.inner = untag_ptr(this_ptr);
28804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28806 this_ptr_conv.is_owned = false;
28807 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28808 memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32);
28812 void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28813 LDKClosingSigned this_ptr_conv;
28814 this_ptr_conv.inner = untag_ptr(this_ptr);
28815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28817 this_ptr_conv.is_owned = false;
28818 LDKThirtyTwoBytes val_ref;
28819 CHECK(val->arr_len == 32);
28820 memcpy(val_ref.data, val->elems, 32); FREE(val);
28821 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
28824 int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) {
28825 LDKClosingSigned this_ptr_conv;
28826 this_ptr_conv.inner = untag_ptr(this_ptr);
28827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28829 this_ptr_conv.is_owned = false;
28830 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
28834 void __attribute__((export_name("TS_ClosingSigned_set_fee_satoshis"))) TS_ClosingSigned_set_fee_satoshis(uint64_t this_ptr, int64_t val) {
28835 LDKClosingSigned this_ptr_conv;
28836 this_ptr_conv.inner = untag_ptr(this_ptr);
28837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28839 this_ptr_conv.is_owned = false;
28840 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
28843 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_ClosingSigned_get_signature(uint64_t this_ptr) {
28844 LDKClosingSigned this_ptr_conv;
28845 this_ptr_conv.inner = untag_ptr(this_ptr);
28846 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28848 this_ptr_conv.is_owned = false;
28849 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28850 memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28854 void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28855 LDKClosingSigned this_ptr_conv;
28856 this_ptr_conv.inner = untag_ptr(this_ptr);
28857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28859 this_ptr_conv.is_owned = false;
28860 LDKSignature val_ref;
28861 CHECK(val->arr_len == 64);
28862 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28863 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
28866 uint64_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_ClosingSigned_get_fee_range(uint64_t this_ptr) {
28867 LDKClosingSigned this_ptr_conv;
28868 this_ptr_conv.inner = untag_ptr(this_ptr);
28869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28871 this_ptr_conv.is_owned = false;
28872 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
28873 uint64_t ret_ref = 0;
28874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28879 void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingSigned_set_fee_range(uint64_t this_ptr, uint64_t val) {
28880 LDKClosingSigned this_ptr_conv;
28881 this_ptr_conv.inner = untag_ptr(this_ptr);
28882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28884 this_ptr_conv.is_owned = false;
28885 LDKClosingSignedFeeRange val_conv;
28886 val_conv.inner = untag_ptr(val);
28887 val_conv.is_owned = ptr_is_owned(val);
28888 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28889 val_conv = ClosingSignedFeeRange_clone(&val_conv);
28890 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
28893 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) {
28894 LDKThirtyTwoBytes channel_id_arg_ref;
28895 CHECK(channel_id_arg->arr_len == 32);
28896 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28897 LDKSignature signature_arg_ref;
28898 CHECK(signature_arg->arr_len == 64);
28899 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28900 LDKClosingSignedFeeRange fee_range_arg_conv;
28901 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
28902 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
28903 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
28904 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
28905 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
28906 uint64_t ret_ref = 0;
28907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28912 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
28913 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
28914 uint64_t ret_ref = 0;
28915 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28916 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28919 int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint64_t arg) {
28920 LDKClosingSigned arg_conv;
28921 arg_conv.inner = untag_ptr(arg);
28922 arg_conv.is_owned = ptr_is_owned(arg);
28923 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28924 arg_conv.is_owned = false;
28925 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
28929 uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigned_clone(uint64_t orig) {
28930 LDKClosingSigned orig_conv;
28931 orig_conv.inner = untag_ptr(orig);
28932 orig_conv.is_owned = ptr_is_owned(orig);
28933 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28934 orig_conv.is_owned = false;
28935 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
28936 uint64_t ret_ref = 0;
28937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28942 void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
28943 LDKUpdateAddHTLC this_obj_conv;
28944 this_obj_conv.inner = untag_ptr(this_obj);
28945 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28947 UpdateAddHTLC_free(this_obj_conv);
28950 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) {
28951 LDKUpdateAddHTLC this_ptr_conv;
28952 this_ptr_conv.inner = untag_ptr(this_ptr);
28953 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28955 this_ptr_conv.is_owned = false;
28956 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28957 memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32);
28961 void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28962 LDKUpdateAddHTLC this_ptr_conv;
28963 this_ptr_conv.inner = untag_ptr(this_ptr);
28964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28966 this_ptr_conv.is_owned = false;
28967 LDKThirtyTwoBytes val_ref;
28968 CHECK(val->arr_len == 32);
28969 memcpy(val_ref.data, val->elems, 32); FREE(val);
28970 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
28973 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) {
28974 LDKUpdateAddHTLC this_ptr_conv;
28975 this_ptr_conv.inner = untag_ptr(this_ptr);
28976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28978 this_ptr_conv.is_owned = false;
28979 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
28983 void __attribute__((export_name("TS_UpdateAddHTLC_set_htlc_id"))) TS_UpdateAddHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
28984 LDKUpdateAddHTLC this_ptr_conv;
28985 this_ptr_conv.inner = untag_ptr(this_ptr);
28986 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28988 this_ptr_conv.is_owned = false;
28989 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
28992 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_amount_msat"))) TS_UpdateAddHTLC_get_amount_msat(uint64_t this_ptr) {
28993 LDKUpdateAddHTLC this_ptr_conv;
28994 this_ptr_conv.inner = untag_ptr(this_ptr);
28995 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28997 this_ptr_conv.is_owned = false;
28998 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
29002 void __attribute__((export_name("TS_UpdateAddHTLC_set_amount_msat"))) TS_UpdateAddHTLC_set_amount_msat(uint64_t this_ptr, int64_t val) {
29003 LDKUpdateAddHTLC this_ptr_conv;
29004 this_ptr_conv.inner = untag_ptr(this_ptr);
29005 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29007 this_ptr_conv.is_owned = false;
29008 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
29011 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) TS_UpdateAddHTLC_get_payment_hash(uint64_t this_ptr) {
29012 LDKUpdateAddHTLC this_ptr_conv;
29013 this_ptr_conv.inner = untag_ptr(this_ptr);
29014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29016 this_ptr_conv.is_owned = false;
29017 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29018 memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32);
29022 void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_UpdateAddHTLC_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
29023 LDKUpdateAddHTLC this_ptr_conv;
29024 this_ptr_conv.inner = untag_ptr(this_ptr);
29025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29027 this_ptr_conv.is_owned = false;
29028 LDKThirtyTwoBytes val_ref;
29029 CHECK(val->arr_len == 32);
29030 memcpy(val_ref.data, val->elems, 32); FREE(val);
29031 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
29034 int32_t __attribute__((export_name("TS_UpdateAddHTLC_get_cltv_expiry"))) TS_UpdateAddHTLC_get_cltv_expiry(uint64_t this_ptr) {
29035 LDKUpdateAddHTLC this_ptr_conv;
29036 this_ptr_conv.inner = untag_ptr(this_ptr);
29037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29039 this_ptr_conv.is_owned = false;
29040 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
29044 void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_UpdateAddHTLC_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
29045 LDKUpdateAddHTLC this_ptr_conv;
29046 this_ptr_conv.inner = untag_ptr(this_ptr);
29047 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29049 this_ptr_conv.is_owned = false;
29050 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
29053 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
29054 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
29055 uint64_t ret_ref = 0;
29056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29057 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29060 int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint64_t arg) {
29061 LDKUpdateAddHTLC arg_conv;
29062 arg_conv.inner = untag_ptr(arg);
29063 arg_conv.is_owned = ptr_is_owned(arg);
29064 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29065 arg_conv.is_owned = false;
29066 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
29070 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTLC_clone(uint64_t orig) {
29071 LDKUpdateAddHTLC orig_conv;
29072 orig_conv.inner = untag_ptr(orig);
29073 orig_conv.is_owned = ptr_is_owned(orig);
29074 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29075 orig_conv.is_owned = false;
29076 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
29077 uint64_t ret_ref = 0;
29078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29083 void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
29084 LDKUpdateFulfillHTLC this_obj_conv;
29085 this_obj_conv.inner = untag_ptr(this_obj);
29086 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29088 UpdateFulfillHTLC_free(this_obj_conv);
29091 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) {
29092 LDKUpdateFulfillHTLC 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29098 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32);
29102 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29103 LDKUpdateFulfillHTLC this_ptr_conv;
29104 this_ptr_conv.inner = untag_ptr(this_ptr);
29105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29107 this_ptr_conv.is_owned = false;
29108 LDKThirtyTwoBytes val_ref;
29109 CHECK(val->arr_len == 32);
29110 memcpy(val_ref.data, val->elems, 32); FREE(val);
29111 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
29114 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) {
29115 LDKUpdateFulfillHTLC this_ptr_conv;
29116 this_ptr_conv.inner = untag_ptr(this_ptr);
29117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29119 this_ptr_conv.is_owned = false;
29120 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
29124 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_htlc_id"))) TS_UpdateFulfillHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29125 LDKUpdateFulfillHTLC this_ptr_conv;
29126 this_ptr_conv.inner = untag_ptr(this_ptr);
29127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29129 this_ptr_conv.is_owned = false;
29130 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
29133 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preimage"))) TS_UpdateFulfillHTLC_get_payment_preimage(uint64_t this_ptr) {
29134 LDKUpdateFulfillHTLC this_ptr_conv;
29135 this_ptr_conv.inner = untag_ptr(this_ptr);
29136 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29138 this_ptr_conv.is_owned = false;
29139 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29140 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32);
29144 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) TS_UpdateFulfillHTLC_set_payment_preimage(uint64_t this_ptr, int8_tArray val) {
29145 LDKUpdateFulfillHTLC this_ptr_conv;
29146 this_ptr_conv.inner = untag_ptr(this_ptr);
29147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29149 this_ptr_conv.is_owned = false;
29150 LDKThirtyTwoBytes val_ref;
29151 CHECK(val->arr_len == 32);
29152 memcpy(val_ref.data, val->elems, 32); FREE(val);
29153 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
29156 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) {
29157 LDKThirtyTwoBytes channel_id_arg_ref;
29158 CHECK(channel_id_arg->arr_len == 32);
29159 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29160 LDKThirtyTwoBytes payment_preimage_arg_ref;
29161 CHECK(payment_preimage_arg->arr_len == 32);
29162 memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg);
29163 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
29164 uint64_t ret_ref = 0;
29165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29170 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
29171 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
29172 uint64_t ret_ref = 0;
29173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29177 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint64_t arg) {
29178 LDKUpdateFulfillHTLC arg_conv;
29179 arg_conv.inner = untag_ptr(arg);
29180 arg_conv.is_owned = ptr_is_owned(arg);
29181 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29182 arg_conv.is_owned = false;
29183 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
29187 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFulfillHTLC_clone(uint64_t orig) {
29188 LDKUpdateFulfillHTLC orig_conv;
29189 orig_conv.inner = untag_ptr(orig);
29190 orig_conv.is_owned = ptr_is_owned(orig);
29191 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29192 orig_conv.is_owned = false;
29193 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
29194 uint64_t ret_ref = 0;
29195 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29196 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29200 void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
29201 LDKUpdateFailHTLC this_obj_conv;
29202 this_obj_conv.inner = untag_ptr(this_obj);
29203 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29205 UpdateFailHTLC_free(this_obj_conv);
29208 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) {
29209 LDKUpdateFailHTLC this_ptr_conv;
29210 this_ptr_conv.inner = untag_ptr(this_ptr);
29211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29213 this_ptr_conv.is_owned = false;
29214 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29215 memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32);
29219 void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29220 LDKUpdateFailHTLC this_ptr_conv;
29221 this_ptr_conv.inner = untag_ptr(this_ptr);
29222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29224 this_ptr_conv.is_owned = false;
29225 LDKThirtyTwoBytes val_ref;
29226 CHECK(val->arr_len == 32);
29227 memcpy(val_ref.data, val->elems, 32); FREE(val);
29228 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
29231 int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) {
29232 LDKUpdateFailHTLC this_ptr_conv;
29233 this_ptr_conv.inner = untag_ptr(this_ptr);
29234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29236 this_ptr_conv.is_owned = false;
29237 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
29241 void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFailHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29242 LDKUpdateFailHTLC this_ptr_conv;
29243 this_ptr_conv.inner = untag_ptr(this_ptr);
29244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29246 this_ptr_conv.is_owned = false;
29247 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
29250 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
29251 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
29252 uint64_t ret_ref = 0;
29253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29257 int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint64_t arg) {
29258 LDKUpdateFailHTLC arg_conv;
29259 arg_conv.inner = untag_ptr(arg);
29260 arg_conv.is_owned = ptr_is_owned(arg);
29261 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29262 arg_conv.is_owned = false;
29263 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
29267 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailHTLC_clone(uint64_t orig) {
29268 LDKUpdateFailHTLC orig_conv;
29269 orig_conv.inner = untag_ptr(orig);
29270 orig_conv.is_owned = ptr_is_owned(orig);
29271 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29272 orig_conv.is_owned = false;
29273 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
29274 uint64_t ret_ref = 0;
29275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29280 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
29281 LDKUpdateFailMalformedHTLC this_obj_conv;
29282 this_obj_conv.inner = untag_ptr(this_obj);
29283 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29285 UpdateFailMalformedHTLC_free(this_obj_conv);
29288 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) {
29289 LDKUpdateFailMalformedHTLC this_ptr_conv;
29290 this_ptr_conv.inner = untag_ptr(this_ptr);
29291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29293 this_ptr_conv.is_owned = false;
29294 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29295 memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32);
29299 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29300 LDKUpdateFailMalformedHTLC this_ptr_conv;
29301 this_ptr_conv.inner = untag_ptr(this_ptr);
29302 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29304 this_ptr_conv.is_owned = false;
29305 LDKThirtyTwoBytes val_ref;
29306 CHECK(val->arr_len == 32);
29307 memcpy(val_ref.data, val->elems, 32); FREE(val);
29308 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
29311 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) {
29312 LDKUpdateFailMalformedHTLC this_ptr_conv;
29313 this_ptr_conv.inner = untag_ptr(this_ptr);
29314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29316 this_ptr_conv.is_owned = false;
29317 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
29321 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_htlc_id"))) TS_UpdateFailMalformedHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29322 LDKUpdateFailMalformedHTLC this_ptr_conv;
29323 this_ptr_conv.inner = untag_ptr(this_ptr);
29324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29326 this_ptr_conv.is_owned = false;
29327 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
29330 int16_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_failure_code"))) TS_UpdateFailMalformedHTLC_get_failure_code(uint64_t this_ptr) {
29331 LDKUpdateFailMalformedHTLC this_ptr_conv;
29332 this_ptr_conv.inner = untag_ptr(this_ptr);
29333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29335 this_ptr_conv.is_owned = false;
29336 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
29340 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code"))) TS_UpdateFailMalformedHTLC_set_failure_code(uint64_t this_ptr, int16_t val) {
29341 LDKUpdateFailMalformedHTLC 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 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
29349 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
29350 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
29351 uint64_t ret_ref = 0;
29352 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29353 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29356 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint64_t arg) {
29357 LDKUpdateFailMalformedHTLC arg_conv;
29358 arg_conv.inner = untag_ptr(arg);
29359 arg_conv.is_owned = ptr_is_owned(arg);
29360 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29361 arg_conv.is_owned = false;
29362 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
29366 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_UpdateFailMalformedHTLC_clone(uint64_t orig) {
29367 LDKUpdateFailMalformedHTLC orig_conv;
29368 orig_conv.inner = untag_ptr(orig);
29369 orig_conv.is_owned = ptr_is_owned(orig);
29370 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29371 orig_conv.is_owned = false;
29372 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
29373 uint64_t ret_ref = 0;
29374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29379 void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
29380 LDKCommitmentSigned this_obj_conv;
29381 this_obj_conv.inner = untag_ptr(this_obj);
29382 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29384 CommitmentSigned_free(this_obj_conv);
29387 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) {
29388 LDKCommitmentSigned this_ptr_conv;
29389 this_ptr_conv.inner = untag_ptr(this_ptr);
29390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29392 this_ptr_conv.is_owned = false;
29393 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29394 memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32);
29398 void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29399 LDKCommitmentSigned this_ptr_conv;
29400 this_ptr_conv.inner = untag_ptr(this_ptr);
29401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29403 this_ptr_conv.is_owned = false;
29404 LDKThirtyTwoBytes val_ref;
29405 CHECK(val->arr_len == 32);
29406 memcpy(val_ref.data, val->elems, 32); FREE(val);
29407 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
29410 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) {
29411 LDKCommitmentSigned this_ptr_conv;
29412 this_ptr_conv.inner = untag_ptr(this_ptr);
29413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29415 this_ptr_conv.is_owned = false;
29416 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29417 memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
29421 void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_CommitmentSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
29422 LDKCommitmentSigned this_ptr_conv;
29423 this_ptr_conv.inner = untag_ptr(this_ptr);
29424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29426 this_ptr_conv.is_owned = false;
29427 LDKSignature val_ref;
29428 CHECK(val->arr_len == 64);
29429 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29430 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
29433 ptrArray __attribute__((export_name("TS_CommitmentSigned_get_htlc_signatures"))) TS_CommitmentSigned_get_htlc_signatures(uint64_t this_ptr) {
29434 LDKCommitmentSigned this_ptr_conv;
29435 this_ptr_conv.inner = untag_ptr(this_ptr);
29436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29438 this_ptr_conv.is_owned = false;
29439 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
29440 ptrArray ret_arr = NULL;
29441 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
29442 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
29443 for (size_t m = 0; m < ret_var.datalen; m++) {
29444 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
29445 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
29446 ret_arr_ptr[m] = ret_conv_12_arr;
29449 FREE(ret_var.data);
29453 void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS_CommitmentSigned_set_htlc_signatures(uint64_t this_ptr, ptrArray val) {
29454 LDKCommitmentSigned this_ptr_conv;
29455 this_ptr_conv.inner = untag_ptr(this_ptr);
29456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29458 this_ptr_conv.is_owned = false;
29459 LDKCVec_SignatureZ val_constr;
29460 val_constr.datalen = val->arr_len;
29461 if (val_constr.datalen > 0)
29462 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29464 val_constr.data = NULL;
29465 int8_tArray* val_vals = (void*) val->elems;
29466 for (size_t m = 0; m < val_constr.datalen; m++) {
29467 int8_tArray val_conv_12 = val_vals[m];
29468 LDKSignature val_conv_12_ref;
29469 CHECK(val_conv_12->arr_len == 64);
29470 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
29471 val_constr.data[m] = val_conv_12_ref;
29474 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
29477 uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) {
29478 LDKThirtyTwoBytes channel_id_arg_ref;
29479 CHECK(channel_id_arg->arr_len == 32);
29480 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29481 LDKSignature signature_arg_ref;
29482 CHECK(signature_arg->arr_len == 64);
29483 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
29484 LDKCVec_SignatureZ htlc_signatures_arg_constr;
29485 htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len;
29486 if (htlc_signatures_arg_constr.datalen > 0)
29487 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29489 htlc_signatures_arg_constr.data = NULL;
29490 int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
29491 for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
29492 int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
29493 LDKSignature htlc_signatures_arg_conv_12_ref;
29494 CHECK(htlc_signatures_arg_conv_12->arr_len == 64);
29495 memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
29496 htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
29498 FREE(htlc_signatures_arg);
29499 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
29500 uint64_t ret_ref = 0;
29501 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29502 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29506 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
29507 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
29508 uint64_t ret_ref = 0;
29509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29513 int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint64_t arg) {
29514 LDKCommitmentSigned arg_conv;
29515 arg_conv.inner = untag_ptr(arg);
29516 arg_conv.is_owned = ptr_is_owned(arg);
29517 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29518 arg_conv.is_owned = false;
29519 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
29523 uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_CommitmentSigned_clone(uint64_t orig) {
29524 LDKCommitmentSigned orig_conv;
29525 orig_conv.inner = untag_ptr(orig);
29526 orig_conv.is_owned = ptr_is_owned(orig);
29527 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29528 orig_conv.is_owned = false;
29529 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
29530 uint64_t ret_ref = 0;
29531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29532 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29536 void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
29537 LDKRevokeAndACK this_obj_conv;
29538 this_obj_conv.inner = untag_ptr(this_obj);
29539 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29541 RevokeAndACK_free(this_obj_conv);
29544 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) {
29545 LDKRevokeAndACK this_ptr_conv;
29546 this_ptr_conv.inner = untag_ptr(this_ptr);
29547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29549 this_ptr_conv.is_owned = false;
29550 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29551 memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32);
29555 void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29556 LDKRevokeAndACK this_ptr_conv;
29557 this_ptr_conv.inner = untag_ptr(this_ptr);
29558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29560 this_ptr_conv.is_owned = false;
29561 LDKThirtyTwoBytes val_ref;
29562 CHECK(val->arr_len == 32);
29563 memcpy(val_ref.data, val->elems, 32); FREE(val);
29564 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
29567 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) {
29568 LDKRevokeAndACK this_ptr_conv;
29569 this_ptr_conv.inner = untag_ptr(this_ptr);
29570 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29572 this_ptr_conv.is_owned = false;
29573 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29574 memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32);
29578 void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) TS_RevokeAndACK_set_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
29579 LDKRevokeAndACK this_ptr_conv;
29580 this_ptr_conv.inner = untag_ptr(this_ptr);
29581 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29583 this_ptr_conv.is_owned = false;
29584 LDKThirtyTwoBytes val_ref;
29585 CHECK(val->arr_len == 32);
29586 memcpy(val_ref.data, val->elems, 32); FREE(val);
29587 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
29590 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment_point"))) TS_RevokeAndACK_get_next_per_commitment_point(uint64_t this_ptr) {
29591 LDKRevokeAndACK this_ptr_conv;
29592 this_ptr_conv.inner = untag_ptr(this_ptr);
29593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29595 this_ptr_conv.is_owned = false;
29596 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29597 memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29601 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) {
29602 LDKRevokeAndACK this_ptr_conv;
29603 this_ptr_conv.inner = untag_ptr(this_ptr);
29604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29606 this_ptr_conv.is_owned = false;
29607 LDKPublicKey val_ref;
29608 CHECK(val->arr_len == 33);
29609 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29610 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
29613 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) {
29614 LDKThirtyTwoBytes channel_id_arg_ref;
29615 CHECK(channel_id_arg->arr_len == 32);
29616 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29617 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
29618 CHECK(per_commitment_secret_arg->arr_len == 32);
29619 memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg);
29620 LDKPublicKey next_per_commitment_point_arg_ref;
29621 CHECK(next_per_commitment_point_arg->arr_len == 33);
29622 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
29623 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
29624 uint64_t ret_ref = 0;
29625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29630 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
29631 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
29632 uint64_t ret_ref = 0;
29633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29637 int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint64_t arg) {
29638 LDKRevokeAndACK arg_conv;
29639 arg_conv.inner = untag_ptr(arg);
29640 arg_conv.is_owned = ptr_is_owned(arg);
29641 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29642 arg_conv.is_owned = false;
29643 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
29647 uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_clone(uint64_t orig) {
29648 LDKRevokeAndACK orig_conv;
29649 orig_conv.inner = untag_ptr(orig);
29650 orig_conv.is_owned = ptr_is_owned(orig);
29651 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29652 orig_conv.is_owned = false;
29653 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
29654 uint64_t ret_ref = 0;
29655 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29656 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29660 void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
29661 LDKUpdateFee this_obj_conv;
29662 this_obj_conv.inner = untag_ptr(this_obj);
29663 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29665 UpdateFee_free(this_obj_conv);
29668 int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) {
29669 LDKUpdateFee this_ptr_conv;
29670 this_ptr_conv.inner = untag_ptr(this_ptr);
29671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29673 this_ptr_conv.is_owned = false;
29674 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29675 memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32);
29679 void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29680 LDKUpdateFee this_ptr_conv;
29681 this_ptr_conv.inner = untag_ptr(this_ptr);
29682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29684 this_ptr_conv.is_owned = false;
29685 LDKThirtyTwoBytes val_ref;
29686 CHECK(val->arr_len == 32);
29687 memcpy(val_ref.data, val->elems, 32); FREE(val);
29688 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
29691 int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) {
29692 LDKUpdateFee this_ptr_conv;
29693 this_ptr_conv.inner = untag_ptr(this_ptr);
29694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29696 this_ptr_conv.is_owned = false;
29697 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
29701 void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateFee_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
29702 LDKUpdateFee this_ptr_conv;
29703 this_ptr_conv.inner = untag_ptr(this_ptr);
29704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29706 this_ptr_conv.is_owned = false;
29707 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
29710 uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
29711 LDKThirtyTwoBytes channel_id_arg_ref;
29712 CHECK(channel_id_arg->arr_len == 32);
29713 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29714 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
29715 uint64_t ret_ref = 0;
29716 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29717 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29721 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
29722 LDKUpdateFee ret_var = UpdateFee_clone(arg);
29723 uint64_t ret_ref = 0;
29724 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29725 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29728 int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint64_t arg) {
29729 LDKUpdateFee arg_conv;
29730 arg_conv.inner = untag_ptr(arg);
29731 arg_conv.is_owned = ptr_is_owned(arg);
29732 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29733 arg_conv.is_owned = false;
29734 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
29738 uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone(uint64_t orig) {
29739 LDKUpdateFee orig_conv;
29740 orig_conv.inner = untag_ptr(orig);
29741 orig_conv.is_owned = ptr_is_owned(orig);
29742 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29743 orig_conv.is_owned = false;
29744 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
29745 uint64_t ret_ref = 0;
29746 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29747 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29751 void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
29752 LDKDataLossProtect this_obj_conv;
29753 this_obj_conv.inner = untag_ptr(this_obj);
29754 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29756 DataLossProtect_free(this_obj_conv);
29759 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) {
29760 LDKDataLossProtect this_ptr_conv;
29761 this_ptr_conv.inner = untag_ptr(this_ptr);
29762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29764 this_ptr_conv.is_owned = false;
29765 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29766 memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32);
29770 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) {
29771 LDKDataLossProtect this_ptr_conv;
29772 this_ptr_conv.inner = untag_ptr(this_ptr);
29773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29775 this_ptr_conv.is_owned = false;
29776 LDKThirtyTwoBytes val_ref;
29777 CHECK(val->arr_len == 32);
29778 memcpy(val_ref.data, val->elems, 32); FREE(val);
29779 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
29782 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) {
29783 LDKDataLossProtect this_ptr_conv;
29784 this_ptr_conv.inner = untag_ptr(this_ptr);
29785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29787 this_ptr_conv.is_owned = false;
29788 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29789 memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29793 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) {
29794 LDKDataLossProtect this_ptr_conv;
29795 this_ptr_conv.inner = untag_ptr(this_ptr);
29796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29798 this_ptr_conv.is_owned = false;
29799 LDKPublicKey val_ref;
29800 CHECK(val->arr_len == 33);
29801 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29802 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
29805 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) {
29806 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
29807 CHECK(your_last_per_commitment_secret_arg->arr_len == 32);
29808 memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg);
29809 LDKPublicKey my_current_per_commitment_point_arg_ref;
29810 CHECK(my_current_per_commitment_point_arg->arr_len == 33);
29811 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);
29812 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
29813 uint64_t ret_ref = 0;
29814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29819 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
29820 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
29821 uint64_t ret_ref = 0;
29822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29823 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29826 int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint64_t arg) {
29827 LDKDataLossProtect arg_conv;
29828 arg_conv.inner = untag_ptr(arg);
29829 arg_conv.is_owned = ptr_is_owned(arg);
29830 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29831 arg_conv.is_owned = false;
29832 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
29836 uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossProtect_clone(uint64_t orig) {
29837 LDKDataLossProtect orig_conv;
29838 orig_conv.inner = untag_ptr(orig);
29839 orig_conv.is_owned = ptr_is_owned(orig);
29840 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29841 orig_conv.is_owned = false;
29842 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
29843 uint64_t ret_ref = 0;
29844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29849 void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
29850 LDKChannelReestablish this_obj_conv;
29851 this_obj_conv.inner = untag_ptr(this_obj);
29852 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29854 ChannelReestablish_free(this_obj_conv);
29857 int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) {
29858 LDKChannelReestablish this_ptr_conv;
29859 this_ptr_conv.inner = untag_ptr(this_ptr);
29860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29862 this_ptr_conv.is_owned = false;
29863 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29864 memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32);
29868 void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29869 LDKChannelReestablish this_ptr_conv;
29870 this_ptr_conv.inner = untag_ptr(this_ptr);
29871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29873 this_ptr_conv.is_owned = false;
29874 LDKThirtyTwoBytes val_ref;
29875 CHECK(val->arr_len == 32);
29876 memcpy(val_ref.data, val->elems, 32); FREE(val);
29877 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
29880 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) {
29881 LDKChannelReestablish this_ptr_conv;
29882 this_ptr_conv.inner = untag_ptr(this_ptr);
29883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29885 this_ptr_conv.is_owned = false;
29886 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
29890 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) {
29891 LDKChannelReestablish this_ptr_conv;
29892 this_ptr_conv.inner = untag_ptr(this_ptr);
29893 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29895 this_ptr_conv.is_owned = false;
29896 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
29899 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_remote_commitment_number"))) TS_ChannelReestablish_get_next_remote_commitment_number(uint64_t this_ptr) {
29900 LDKChannelReestablish this_ptr_conv;
29901 this_ptr_conv.inner = untag_ptr(this_ptr);
29902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29904 this_ptr_conv.is_owned = false;
29905 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
29909 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) {
29910 LDKChannelReestablish this_ptr_conv;
29911 this_ptr_conv.inner = untag_ptr(this_ptr);
29912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29914 this_ptr_conv.is_owned = false;
29915 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
29918 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
29919 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
29920 uint64_t ret_ref = 0;
29921 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29922 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29925 int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint64_t arg) {
29926 LDKChannelReestablish arg_conv;
29927 arg_conv.inner = untag_ptr(arg);
29928 arg_conv.is_owned = ptr_is_owned(arg);
29929 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29930 arg_conv.is_owned = false;
29931 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
29935 uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_ChannelReestablish_clone(uint64_t orig) {
29936 LDKChannelReestablish orig_conv;
29937 orig_conv.inner = untag_ptr(orig);
29938 orig_conv.is_owned = ptr_is_owned(orig);
29939 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29940 orig_conv.is_owned = false;
29941 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
29942 uint64_t ret_ref = 0;
29943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29948 void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
29949 LDKAnnouncementSignatures this_obj_conv;
29950 this_obj_conv.inner = untag_ptr(this_obj);
29951 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29953 AnnouncementSignatures_free(this_obj_conv);
29956 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) {
29957 LDKAnnouncementSignatures this_ptr_conv;
29958 this_ptr_conv.inner = untag_ptr(this_ptr);
29959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29961 this_ptr_conv.is_owned = false;
29962 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29963 memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32);
29967 void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29968 LDKAnnouncementSignatures this_ptr_conv;
29969 this_ptr_conv.inner = untag_ptr(this_ptr);
29970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29972 this_ptr_conv.is_owned = false;
29973 LDKThirtyTwoBytes val_ref;
29974 CHECK(val->arr_len == 32);
29975 memcpy(val_ref.data, val->elems, 32); FREE(val);
29976 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
29979 int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) {
29980 LDKAnnouncementSignatures this_ptr_conv;
29981 this_ptr_conv.inner = untag_ptr(this_ptr);
29982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29984 this_ptr_conv.is_owned = false;
29985 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
29989 void __attribute__((export_name("TS_AnnouncementSignatures_set_short_channel_id"))) TS_AnnouncementSignatures_set_short_channel_id(uint64_t this_ptr, int64_t val) {
29990 LDKAnnouncementSignatures this_ptr_conv;
29991 this_ptr_conv.inner = untag_ptr(this_ptr);
29992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29994 this_ptr_conv.is_owned = false;
29995 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
29998 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_signature"))) TS_AnnouncementSignatures_get_node_signature(uint64_t this_ptr) {
29999 LDKAnnouncementSignatures this_ptr_conv;
30000 this_ptr_conv.inner = untag_ptr(this_ptr);
30001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30003 this_ptr_conv.is_owned = false;
30004 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30005 memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
30009 void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature"))) TS_AnnouncementSignatures_set_node_signature(uint64_t this_ptr, int8_tArray val) {
30010 LDKAnnouncementSignatures this_ptr_conv;
30011 this_ptr_conv.inner = untag_ptr(this_ptr);
30012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30014 this_ptr_conv.is_owned = false;
30015 LDKSignature val_ref;
30016 CHECK(val->arr_len == 64);
30017 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30018 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
30021 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_signature"))) TS_AnnouncementSignatures_get_bitcoin_signature(uint64_t this_ptr) {
30022 LDKAnnouncementSignatures this_ptr_conv;
30023 this_ptr_conv.inner = untag_ptr(this_ptr);
30024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30026 this_ptr_conv.is_owned = false;
30027 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30028 memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
30032 void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signature"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint64_t this_ptr, int8_tArray val) {
30033 LDKAnnouncementSignatures this_ptr_conv;
30034 this_ptr_conv.inner = untag_ptr(this_ptr);
30035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30037 this_ptr_conv.is_owned = false;
30038 LDKSignature val_ref;
30039 CHECK(val->arr_len == 64);
30040 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30041 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
30044 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) {
30045 LDKThirtyTwoBytes channel_id_arg_ref;
30046 CHECK(channel_id_arg->arr_len == 32);
30047 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30048 LDKSignature node_signature_arg_ref;
30049 CHECK(node_signature_arg->arr_len == 64);
30050 memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg);
30051 LDKSignature bitcoin_signature_arg_ref;
30052 CHECK(bitcoin_signature_arg->arr_len == 64);
30053 memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg);
30054 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
30055 uint64_t ret_ref = 0;
30056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30057 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30061 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
30062 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
30063 uint64_t ret_ref = 0;
30064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30068 int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint64_t arg) {
30069 LDKAnnouncementSignatures arg_conv;
30070 arg_conv.inner = untag_ptr(arg);
30071 arg_conv.is_owned = ptr_is_owned(arg);
30072 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30073 arg_conv.is_owned = false;
30074 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
30078 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_AnnouncementSignatures_clone(uint64_t orig) {
30079 LDKAnnouncementSignatures orig_conv;
30080 orig_conv.inner = untag_ptr(orig);
30081 orig_conv.is_owned = ptr_is_owned(orig);
30082 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30083 orig_conv.is_owned = false;
30084 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
30085 uint64_t ret_ref = 0;
30086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30091 void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
30092 if (!ptr_is_owned(this_ptr)) return;
30093 void* this_ptr_ptr = untag_ptr(this_ptr);
30094 CHECK_ACCESS(this_ptr_ptr);
30095 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
30096 FREE(untag_ptr(this_ptr));
30097 NetAddress_free(this_ptr_conv);
30100 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
30101 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30102 *ret_copy = NetAddress_clone(arg);
30103 uint64_t ret_ref = tag_ptr(ret_copy, true);
30106 int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint64_t arg) {
30107 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
30108 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
30112 uint64_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clone(uint64_t orig) {
30113 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
30114 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30115 *ret_copy = NetAddress_clone(orig_conv);
30116 uint64_t ret_ref = tag_ptr(ret_copy, true);
30120 uint64_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
30121 LDKFourBytes addr_ref;
30122 CHECK(addr->arr_len == 4);
30123 memcpy(addr_ref.data, addr->elems, 4); FREE(addr);
30124 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30125 *ret_copy = NetAddress_ipv4(addr_ref, port);
30126 uint64_t ret_ref = tag_ptr(ret_copy, true);
30130 uint64_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
30131 LDKSixteenBytes addr_ref;
30132 CHECK(addr->arr_len == 16);
30133 memcpy(addr_ref.data, addr->elems, 16); FREE(addr);
30134 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30135 *ret_copy = NetAddress_ipv6(addr_ref, port);
30136 uint64_t ret_ref = tag_ptr(ret_copy, true);
30140 uint64_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) {
30141 LDKTwelveBytes a_ref;
30142 CHECK(a->arr_len == 12);
30143 memcpy(a_ref.data, a->elems, 12); FREE(a);
30144 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30145 *ret_copy = NetAddress_onion_v2(a_ref);
30146 uint64_t ret_ref = tag_ptr(ret_copy, true);
30150 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) {
30151 LDKThirtyTwoBytes ed25519_pubkey_ref;
30152 CHECK(ed25519_pubkey->arr_len == 32);
30153 memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey);
30154 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30155 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
30156 uint64_t ret_ref = tag_ptr(ret_copy, true);
30160 uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_hostname(uint64_t hostname, int16_t port) {
30161 LDKHostname hostname_conv;
30162 hostname_conv.inner = untag_ptr(hostname);
30163 hostname_conv.is_owned = ptr_is_owned(hostname);
30164 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
30165 hostname_conv = Hostname_clone(&hostname_conv);
30166 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30167 *ret_copy = NetAddress_hostname(hostname_conv, port);
30168 uint64_t ret_ref = tag_ptr(ret_copy, true);
30172 int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
30173 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
30174 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
30175 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
30176 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
30177 CVec_u8Z_free(ret_var);
30181 uint64_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
30182 LDKu8slice ser_ref;
30183 ser_ref.datalen = ser->arr_len;
30184 ser_ref.data = ser->elems;
30185 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
30186 *ret_conv = NetAddress_read(ser_ref);
30188 return tag_ptr(ret_conv, true);
30191 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
30192 LDKUnsignedNodeAnnouncement this_obj_conv;
30193 this_obj_conv.inner = untag_ptr(this_obj);
30194 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30196 UnsignedNodeAnnouncement_free(this_obj_conv);
30199 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features"))) TS_UnsignedNodeAnnouncement_get_features(uint64_t this_ptr) {
30200 LDKUnsignedNodeAnnouncement this_ptr_conv;
30201 this_ptr_conv.inner = untag_ptr(this_ptr);
30202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30204 this_ptr_conv.is_owned = false;
30205 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
30206 uint64_t ret_ref = 0;
30207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30212 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_features"))) TS_UnsignedNodeAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30213 LDKUnsignedNodeAnnouncement this_ptr_conv;
30214 this_ptr_conv.inner = untag_ptr(this_ptr);
30215 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30217 this_ptr_conv.is_owned = false;
30218 LDKNodeFeatures val_conv;
30219 val_conv.inner = untag_ptr(val);
30220 val_conv.is_owned = ptr_is_owned(val);
30221 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30222 val_conv = NodeFeatures_clone(&val_conv);
30223 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
30226 int32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_timestamp"))) TS_UnsignedNodeAnnouncement_get_timestamp(uint64_t this_ptr) {
30227 LDKUnsignedNodeAnnouncement this_ptr_conv;
30228 this_ptr_conv.inner = untag_ptr(this_ptr);
30229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30231 this_ptr_conv.is_owned = false;
30232 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
30236 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_timestamp"))) TS_UnsignedNodeAnnouncement_set_timestamp(uint64_t this_ptr, int32_t val) {
30237 LDKUnsignedNodeAnnouncement this_ptr_conv;
30238 this_ptr_conv.inner = untag_ptr(this_ptr);
30239 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30241 this_ptr_conv.is_owned = false;
30242 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
30245 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
30246 LDKUnsignedNodeAnnouncement this_ptr_conv;
30247 this_ptr_conv.inner = untag_ptr(this_ptr);
30248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30250 this_ptr_conv.is_owned = false;
30251 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30252 memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
30256 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
30257 LDKUnsignedNodeAnnouncement this_ptr_conv;
30258 this_ptr_conv.inner = untag_ptr(this_ptr);
30259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30261 this_ptr_conv.is_owned = false;
30262 LDKPublicKey val_ref;
30263 CHECK(val->arr_len == 33);
30264 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30265 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
30268 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
30269 LDKUnsignedNodeAnnouncement this_ptr_conv;
30270 this_ptr_conv.inner = untag_ptr(this_ptr);
30271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30273 this_ptr_conv.is_owned = false;
30274 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
30275 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3);
30279 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_UnsignedNodeAnnouncement_set_rgb(uint64_t this_ptr, int8_tArray val) {
30280 LDKUnsignedNodeAnnouncement this_ptr_conv;
30281 this_ptr_conv.inner = untag_ptr(this_ptr);
30282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30284 this_ptr_conv.is_owned = false;
30285 LDKThreeBytes val_ref;
30286 CHECK(val->arr_len == 3);
30287 memcpy(val_ref.data, val->elems, 3); FREE(val);
30288 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
30291 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) {
30292 LDKUnsignedNodeAnnouncement this_ptr_conv;
30293 this_ptr_conv.inner = untag_ptr(this_ptr);
30294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30296 this_ptr_conv.is_owned = false;
30297 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30298 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32);
30302 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) {
30303 LDKUnsignedNodeAnnouncement this_ptr_conv;
30304 this_ptr_conv.inner = untag_ptr(this_ptr);
30305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30307 this_ptr_conv.is_owned = false;
30308 LDKThirtyTwoBytes val_ref;
30309 CHECK(val->arr_len == 32);
30310 memcpy(val_ref.data, val->elems, 32); FREE(val);
30311 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
30314 uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) {
30315 LDKUnsignedNodeAnnouncement this_ptr_conv;
30316 this_ptr_conv.inner = untag_ptr(this_ptr);
30317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30319 this_ptr_conv.is_owned = false;
30320 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
30321 uint64_tArray ret_arr = NULL;
30322 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
30323 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
30324 for (size_t m = 0; m < ret_var.datalen; m++) {
30325 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30326 *ret_conv_12_copy = ret_var.data[m];
30327 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
30328 ret_arr_ptr[m] = ret_conv_12_ref;
30331 FREE(ret_var.data);
30335 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) TS_UnsignedNodeAnnouncement_set_addresses(uint64_t this_ptr, uint64_tArray val) {
30336 LDKUnsignedNodeAnnouncement this_ptr_conv;
30337 this_ptr_conv.inner = untag_ptr(this_ptr);
30338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30340 this_ptr_conv.is_owned = false;
30341 LDKCVec_NetAddressZ val_constr;
30342 val_constr.datalen = val->arr_len;
30343 if (val_constr.datalen > 0)
30344 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
30346 val_constr.data = NULL;
30347 uint64_t* val_vals = val->elems;
30348 for (size_t m = 0; m < val_constr.datalen; m++) {
30349 uint64_t val_conv_12 = val_vals[m];
30350 void* val_conv_12_ptr = untag_ptr(val_conv_12);
30351 CHECK_ACCESS(val_conv_12_ptr);
30352 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
30353 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
30354 val_constr.data[m] = val_conv_12_conv;
30357 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
30360 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
30361 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
30362 uint64_t ret_ref = 0;
30363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30367 int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint64_t arg) {
30368 LDKUnsignedNodeAnnouncement arg_conv;
30369 arg_conv.inner = untag_ptr(arg);
30370 arg_conv.is_owned = ptr_is_owned(arg);
30371 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30372 arg_conv.is_owned = false;
30373 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
30377 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_UnsignedNodeAnnouncement_clone(uint64_t orig) {
30378 LDKUnsignedNodeAnnouncement orig_conv;
30379 orig_conv.inner = untag_ptr(orig);
30380 orig_conv.is_owned = ptr_is_owned(orig);
30381 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30382 orig_conv.is_owned = false;
30383 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
30384 uint64_t ret_ref = 0;
30385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30390 void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
30391 LDKNodeAnnouncement this_obj_conv;
30392 this_obj_conv.inner = untag_ptr(this_obj);
30393 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30395 NodeAnnouncement_free(this_obj_conv);
30398 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) TS_NodeAnnouncement_get_signature(uint64_t this_ptr) {
30399 LDKNodeAnnouncement this_ptr_conv;
30400 this_ptr_conv.inner = untag_ptr(this_ptr);
30401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30403 this_ptr_conv.is_owned = false;
30404 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30405 memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
30409 void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeAnnouncement_set_signature(uint64_t this_ptr, int8_tArray val) {
30410 LDKNodeAnnouncement this_ptr_conv;
30411 this_ptr_conv.inner = untag_ptr(this_ptr);
30412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30414 this_ptr_conv.is_owned = false;
30415 LDKSignature val_ref;
30416 CHECK(val->arr_len == 64);
30417 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30418 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
30421 uint64_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_NodeAnnouncement_get_contents(uint64_t this_ptr) {
30422 LDKNodeAnnouncement this_ptr_conv;
30423 this_ptr_conv.inner = untag_ptr(this_ptr);
30424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30426 this_ptr_conv.is_owned = false;
30427 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
30428 uint64_t ret_ref = 0;
30429 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30430 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30434 void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30435 LDKNodeAnnouncement this_ptr_conv;
30436 this_ptr_conv.inner = untag_ptr(this_ptr);
30437 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30439 this_ptr_conv.is_owned = false;
30440 LDKUnsignedNodeAnnouncement val_conv;
30441 val_conv.inner = untag_ptr(val);
30442 val_conv.is_owned = ptr_is_owned(val);
30443 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30444 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
30445 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
30448 uint64_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint64_t contents_arg) {
30449 LDKSignature signature_arg_ref;
30450 CHECK(signature_arg->arr_len == 64);
30451 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30452 LDKUnsignedNodeAnnouncement contents_arg_conv;
30453 contents_arg_conv.inner = untag_ptr(contents_arg);
30454 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30455 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30456 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
30457 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
30458 uint64_t ret_ref = 0;
30459 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30460 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30464 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
30465 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
30466 uint64_t ret_ref = 0;
30467 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30468 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30471 int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint64_t arg) {
30472 LDKNodeAnnouncement arg_conv;
30473 arg_conv.inner = untag_ptr(arg);
30474 arg_conv.is_owned = ptr_is_owned(arg);
30475 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30476 arg_conv.is_owned = false;
30477 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
30481 uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnouncement_clone(uint64_t orig) {
30482 LDKNodeAnnouncement orig_conv;
30483 orig_conv.inner = untag_ptr(orig);
30484 orig_conv.is_owned = ptr_is_owned(orig);
30485 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30486 orig_conv.is_owned = false;
30487 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
30488 uint64_t ret_ref = 0;
30489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30494 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
30495 LDKUnsignedChannelAnnouncement this_obj_conv;
30496 this_obj_conv.inner = untag_ptr(this_obj);
30497 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30499 UnsignedChannelAnnouncement_free(this_obj_conv);
30502 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_features"))) TS_UnsignedChannelAnnouncement_get_features(uint64_t this_ptr) {
30503 LDKUnsignedChannelAnnouncement this_ptr_conv;
30504 this_ptr_conv.inner = untag_ptr(this_ptr);
30505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30507 this_ptr_conv.is_owned = false;
30508 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
30509 uint64_t ret_ref = 0;
30510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30511 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30515 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_features"))) TS_UnsignedChannelAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30516 LDKUnsignedChannelAnnouncement this_ptr_conv;
30517 this_ptr_conv.inner = untag_ptr(this_ptr);
30518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30520 this_ptr_conv.is_owned = false;
30521 LDKChannelFeatures val_conv;
30522 val_conv.inner = untag_ptr(val);
30523 val_conv.is_owned = ptr_is_owned(val);
30524 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30525 val_conv = ChannelFeatures_clone(&val_conv);
30526 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
30529 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chain_hash"))) TS_UnsignedChannelAnnouncement_get_chain_hash(uint64_t this_ptr) {
30530 LDKUnsignedChannelAnnouncement 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30536 memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32);
30540 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash"))) TS_UnsignedChannelAnnouncement_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30541 LDKUnsignedChannelAnnouncement this_ptr_conv;
30542 this_ptr_conv.inner = untag_ptr(this_ptr);
30543 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30545 this_ptr_conv.is_owned = false;
30546 LDKThirtyTwoBytes val_ref;
30547 CHECK(val->arr_len == 32);
30548 memcpy(val_ref.data, val->elems, 32); FREE(val);
30549 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
30552 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_short_channel_id"))) TS_UnsignedChannelAnnouncement_get_short_channel_id(uint64_t this_ptr) {
30553 LDKUnsignedChannelAnnouncement this_ptr_conv;
30554 this_ptr_conv.inner = untag_ptr(this_ptr);
30555 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30557 this_ptr_conv.is_owned = false;
30558 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
30562 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_short_channel_id"))) TS_UnsignedChannelAnnouncement_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30563 LDKUnsignedChannelAnnouncement this_ptr_conv;
30564 this_ptr_conv.inner = untag_ptr(this_ptr);
30565 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30567 this_ptr_conv.is_owned = false;
30568 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
30571 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
30572 LDKUnsignedChannelAnnouncement this_ptr_conv;
30573 this_ptr_conv.inner = untag_ptr(this_ptr);
30574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30576 this_ptr_conv.is_owned = false;
30577 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30578 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
30582 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
30583 LDKUnsignedChannelAnnouncement this_ptr_conv;
30584 this_ptr_conv.inner = untag_ptr(this_ptr);
30585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30587 this_ptr_conv.is_owned = false;
30588 LDKPublicKey val_ref;
30589 CHECK(val->arr_len == 33);
30590 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30591 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
30594 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
30595 LDKUnsignedChannelAnnouncement this_ptr_conv;
30596 this_ptr_conv.inner = untag_ptr(this_ptr);
30597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30599 this_ptr_conv.is_owned = false;
30600 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30601 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
30605 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
30606 LDKUnsignedChannelAnnouncement this_ptr_conv;
30607 this_ptr_conv.inner = untag_ptr(this_ptr);
30608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30610 this_ptr_conv.is_owned = false;
30611 LDKPublicKey val_ref;
30612 CHECK(val->arr_len == 33);
30613 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30614 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
30617 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
30618 LDKUnsignedChannelAnnouncement 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(33, __LINE__);
30624 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
30628 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
30629 LDKUnsignedChannelAnnouncement 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 LDKPublicKey val_ref;
30635 CHECK(val->arr_len == 33);
30636 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30637 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
30640 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
30641 LDKUnsignedChannelAnnouncement 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(33, __LINE__);
30647 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
30651 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
30652 LDKUnsignedChannelAnnouncement 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 LDKPublicKey val_ref;
30658 CHECK(val->arr_len == 33);
30659 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30660 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
30663 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
30664 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
30665 uint64_t ret_ref = 0;
30666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30670 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint64_t arg) {
30671 LDKUnsignedChannelAnnouncement arg_conv;
30672 arg_conv.inner = untag_ptr(arg);
30673 arg_conv.is_owned = ptr_is_owned(arg);
30674 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30675 arg_conv.is_owned = false;
30676 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
30680 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) TS_UnsignedChannelAnnouncement_clone(uint64_t orig) {
30681 LDKUnsignedChannelAnnouncement orig_conv;
30682 orig_conv.inner = untag_ptr(orig);
30683 orig_conv.is_owned = ptr_is_owned(orig);
30684 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30685 orig_conv.is_owned = false;
30686 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
30687 uint64_t ret_ref = 0;
30688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30693 void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
30694 LDKChannelAnnouncement this_obj_conv;
30695 this_obj_conv.inner = untag_ptr(this_obj);
30696 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30698 ChannelAnnouncement_free(this_obj_conv);
30701 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_1"))) TS_ChannelAnnouncement_get_node_signature_1(uint64_t this_ptr) {
30702 LDKChannelAnnouncement this_ptr_conv;
30703 this_ptr_conv.inner = untag_ptr(this_ptr);
30704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30706 this_ptr_conv.is_owned = false;
30707 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30708 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
30712 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1"))) TS_ChannelAnnouncement_set_node_signature_1(uint64_t this_ptr, int8_tArray val) {
30713 LDKChannelAnnouncement this_ptr_conv;
30714 this_ptr_conv.inner = untag_ptr(this_ptr);
30715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30717 this_ptr_conv.is_owned = false;
30718 LDKSignature val_ref;
30719 CHECK(val->arr_len == 64);
30720 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30721 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
30724 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_2"))) TS_ChannelAnnouncement_get_node_signature_2(uint64_t this_ptr) {
30725 LDKChannelAnnouncement this_ptr_conv;
30726 this_ptr_conv.inner = untag_ptr(this_ptr);
30727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30729 this_ptr_conv.is_owned = false;
30730 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30731 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
30735 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2"))) TS_ChannelAnnouncement_set_node_signature_2(uint64_t this_ptr, int8_tArray val) {
30736 LDKChannelAnnouncement this_ptr_conv;
30737 this_ptr_conv.inner = untag_ptr(this_ptr);
30738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30740 this_ptr_conv.is_owned = false;
30741 LDKSignature val_ref;
30742 CHECK(val->arr_len == 64);
30743 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30744 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
30747 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_1"))) TS_ChannelAnnouncement_get_bitcoin_signature_1(uint64_t this_ptr) {
30748 LDKChannelAnnouncement this_ptr_conv;
30749 this_ptr_conv.inner = untag_ptr(this_ptr);
30750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30752 this_ptr_conv.is_owned = false;
30753 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30754 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
30758 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint64_t this_ptr, int8_tArray val) {
30759 LDKChannelAnnouncement this_ptr_conv;
30760 this_ptr_conv.inner = untag_ptr(this_ptr);
30761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30763 this_ptr_conv.is_owned = false;
30764 LDKSignature val_ref;
30765 CHECK(val->arr_len == 64);
30766 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30767 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
30770 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_2"))) TS_ChannelAnnouncement_get_bitcoin_signature_2(uint64_t this_ptr) {
30771 LDKChannelAnnouncement this_ptr_conv;
30772 this_ptr_conv.inner = untag_ptr(this_ptr);
30773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30775 this_ptr_conv.is_owned = false;
30776 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30777 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
30781 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint64_t this_ptr, int8_tArray val) {
30782 LDKChannelAnnouncement this_ptr_conv;
30783 this_ptr_conv.inner = untag_ptr(this_ptr);
30784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30786 this_ptr_conv.is_owned = false;
30787 LDKSignature val_ref;
30788 CHECK(val->arr_len == 64);
30789 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30790 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
30793 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS_ChannelAnnouncement_get_contents(uint64_t this_ptr) {
30794 LDKChannelAnnouncement this_ptr_conv;
30795 this_ptr_conv.inner = untag_ptr(this_ptr);
30796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30798 this_ptr_conv.is_owned = false;
30799 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
30800 uint64_t ret_ref = 0;
30801 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30802 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30806 void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_ChannelAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30807 LDKChannelAnnouncement this_ptr_conv;
30808 this_ptr_conv.inner = untag_ptr(this_ptr);
30809 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30811 this_ptr_conv.is_owned = false;
30812 LDKUnsignedChannelAnnouncement val_conv;
30813 val_conv.inner = untag_ptr(val);
30814 val_conv.is_owned = ptr_is_owned(val);
30815 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30816 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
30817 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
30820 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) {
30821 LDKSignature node_signature_1_arg_ref;
30822 CHECK(node_signature_1_arg->arr_len == 64);
30823 memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg);
30824 LDKSignature node_signature_2_arg_ref;
30825 CHECK(node_signature_2_arg->arr_len == 64);
30826 memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg);
30827 LDKSignature bitcoin_signature_1_arg_ref;
30828 CHECK(bitcoin_signature_1_arg->arr_len == 64);
30829 memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg);
30830 LDKSignature bitcoin_signature_2_arg_ref;
30831 CHECK(bitcoin_signature_2_arg->arr_len == 64);
30832 memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg);
30833 LDKUnsignedChannelAnnouncement contents_arg_conv;
30834 contents_arg_conv.inner = untag_ptr(contents_arg);
30835 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30836 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30837 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
30838 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);
30839 uint64_t ret_ref = 0;
30840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30845 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
30846 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
30847 uint64_t ret_ref = 0;
30848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30852 int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint64_t arg) {
30853 LDKChannelAnnouncement arg_conv;
30854 arg_conv.inner = untag_ptr(arg);
30855 arg_conv.is_owned = ptr_is_owned(arg);
30856 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30857 arg_conv.is_owned = false;
30858 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
30862 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_ChannelAnnouncement_clone(uint64_t orig) {
30863 LDKChannelAnnouncement orig_conv;
30864 orig_conv.inner = untag_ptr(orig);
30865 orig_conv.is_owned = ptr_is_owned(orig);
30866 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30867 orig_conv.is_owned = false;
30868 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
30869 uint64_t ret_ref = 0;
30870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30875 void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
30876 LDKUnsignedChannelUpdate this_obj_conv;
30877 this_obj_conv.inner = untag_ptr(this_obj);
30878 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30880 UnsignedChannelUpdate_free(this_obj_conv);
30883 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) {
30884 LDKUnsignedChannelUpdate this_ptr_conv;
30885 this_ptr_conv.inner = untag_ptr(this_ptr);
30886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30888 this_ptr_conv.is_owned = false;
30889 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30890 memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32);
30894 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30895 LDKUnsignedChannelUpdate this_ptr_conv;
30896 this_ptr_conv.inner = untag_ptr(this_ptr);
30897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30899 this_ptr_conv.is_owned = false;
30900 LDKThirtyTwoBytes val_ref;
30901 CHECK(val->arr_len == 32);
30902 memcpy(val_ref.data, val->elems, 32); FREE(val);
30903 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
30906 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) {
30907 LDKUnsignedChannelUpdate this_ptr_conv;
30908 this_ptr_conv.inner = untag_ptr(this_ptr);
30909 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30911 this_ptr_conv.is_owned = false;
30912 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
30916 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30917 LDKUnsignedChannelUpdate this_ptr_conv;
30918 this_ptr_conv.inner = untag_ptr(this_ptr);
30919 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30921 this_ptr_conv.is_owned = false;
30922 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
30925 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) {
30926 LDKUnsignedChannelUpdate this_ptr_conv;
30927 this_ptr_conv.inner = untag_ptr(this_ptr);
30928 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30929 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30930 this_ptr_conv.is_owned = false;
30931 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
30935 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) {
30936 LDKUnsignedChannelUpdate this_ptr_conv;
30937 this_ptr_conv.inner = untag_ptr(this_ptr);
30938 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30940 this_ptr_conv.is_owned = false;
30941 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
30944 int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) {
30945 LDKUnsignedChannelUpdate this_ptr_conv;
30946 this_ptr_conv.inner = untag_ptr(this_ptr);
30947 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30949 this_ptr_conv.is_owned = false;
30950 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
30954 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) {
30955 LDKUnsignedChannelUpdate this_ptr_conv;
30956 this_ptr_conv.inner = untag_ptr(this_ptr);
30957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30959 this_ptr_conv.is_owned = false;
30960 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
30963 int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) {
30964 LDKUnsignedChannelUpdate this_ptr_conv;
30965 this_ptr_conv.inner = untag_ptr(this_ptr);
30966 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30968 this_ptr_conv.is_owned = false;
30969 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
30973 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
30974 LDKUnsignedChannelUpdate this_ptr_conv;
30975 this_ptr_conv.inner = untag_ptr(this_ptr);
30976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30978 this_ptr_conv.is_owned = false;
30979 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
30982 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) {
30983 LDKUnsignedChannelUpdate this_ptr_conv;
30984 this_ptr_conv.inner = untag_ptr(this_ptr);
30985 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30987 this_ptr_conv.is_owned = false;
30988 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
30992 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
30993 LDKUnsignedChannelUpdate this_ptr_conv;
30994 this_ptr_conv.inner = untag_ptr(this_ptr);
30995 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30997 this_ptr_conv.is_owned = false;
30998 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
31001 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) {
31002 LDKUnsignedChannelUpdate this_ptr_conv;
31003 this_ptr_conv.inner = untag_ptr(this_ptr);
31004 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31006 this_ptr_conv.is_owned = false;
31007 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
31011 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
31012 LDKUnsignedChannelUpdate this_ptr_conv;
31013 this_ptr_conv.inner = untag_ptr(this_ptr);
31014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31016 this_ptr_conv.is_owned = false;
31017 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
31020 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) {
31021 LDKUnsignedChannelUpdate this_ptr_conv;
31022 this_ptr_conv.inner = untag_ptr(this_ptr);
31023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31025 this_ptr_conv.is_owned = false;
31026 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
31030 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
31031 LDKUnsignedChannelUpdate this_ptr_conv;
31032 this_ptr_conv.inner = untag_ptr(this_ptr);
31033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31035 this_ptr_conv.is_owned = false;
31036 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
31039 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) {
31040 LDKUnsignedChannelUpdate this_ptr_conv;
31041 this_ptr_conv.inner = untag_ptr(this_ptr);
31042 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31043 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31044 this_ptr_conv.is_owned = false;
31045 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
31049 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
31050 LDKUnsignedChannelUpdate this_ptr_conv;
31051 this_ptr_conv.inner = untag_ptr(this_ptr);
31052 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31054 this_ptr_conv.is_owned = false;
31055 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
31058 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) {
31059 LDKUnsignedChannelUpdate this_ptr_conv;
31060 this_ptr_conv.inner = untag_ptr(this_ptr);
31061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31063 this_ptr_conv.is_owned = false;
31064 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
31065 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
31066 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
31067 CVec_u8Z_free(ret_var);
31071 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) {
31072 LDKUnsignedChannelUpdate this_ptr_conv;
31073 this_ptr_conv.inner = untag_ptr(this_ptr);
31074 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31076 this_ptr_conv.is_owned = false;
31077 LDKCVec_u8Z val_ref;
31078 val_ref.datalen = val->arr_len;
31079 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
31080 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
31081 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
31084 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) {
31085 LDKThirtyTwoBytes chain_hash_arg_ref;
31086 CHECK(chain_hash_arg->arr_len == 32);
31087 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31088 LDKCVec_u8Z excess_data_arg_ref;
31089 excess_data_arg_ref.datalen = excess_data_arg->arr_len;
31090 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
31091 memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg);
31092 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);
31093 uint64_t ret_ref = 0;
31094 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31095 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31099 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
31100 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
31101 uint64_t ret_ref = 0;
31102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31106 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) {
31107 LDKUnsignedChannelUpdate arg_conv;
31108 arg_conv.inner = untag_ptr(arg);
31109 arg_conv.is_owned = ptr_is_owned(arg);
31110 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31111 arg_conv.is_owned = false;
31112 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
31116 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) {
31117 LDKUnsignedChannelUpdate orig_conv;
31118 orig_conv.inner = untag_ptr(orig);
31119 orig_conv.is_owned = ptr_is_owned(orig);
31120 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31121 orig_conv.is_owned = false;
31122 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
31123 uint64_t ret_ref = 0;
31124 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31125 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31129 void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
31130 LDKChannelUpdate this_obj_conv;
31131 this_obj_conv.inner = untag_ptr(this_obj);
31132 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31134 ChannelUpdate_free(this_obj_conv);
31137 int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) {
31138 LDKChannelUpdate this_ptr_conv;
31139 this_ptr_conv.inner = untag_ptr(this_ptr);
31140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31142 this_ptr_conv.is_owned = false;
31143 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31144 memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
31148 void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) {
31149 LDKChannelUpdate this_ptr_conv;
31150 this_ptr_conv.inner = untag_ptr(this_ptr);
31151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31153 this_ptr_conv.is_owned = false;
31154 LDKSignature val_ref;
31155 CHECK(val->arr_len == 64);
31156 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31157 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
31160 uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) {
31161 LDKChannelUpdate this_ptr_conv;
31162 this_ptr_conv.inner = untag_ptr(this_ptr);
31163 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31165 this_ptr_conv.is_owned = false;
31166 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
31167 uint64_t ret_ref = 0;
31168 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31169 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31173 void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) {
31174 LDKChannelUpdate this_ptr_conv;
31175 this_ptr_conv.inner = untag_ptr(this_ptr);
31176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31178 this_ptr_conv.is_owned = false;
31179 LDKUnsignedChannelUpdate val_conv;
31180 val_conv.inner = untag_ptr(val);
31181 val_conv.is_owned = ptr_is_owned(val);
31182 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31183 val_conv = UnsignedChannelUpdate_clone(&val_conv);
31184 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
31187 uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) {
31188 LDKSignature signature_arg_ref;
31189 CHECK(signature_arg->arr_len == 64);
31190 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
31191 LDKUnsignedChannelUpdate contents_arg_conv;
31192 contents_arg_conv.inner = untag_ptr(contents_arg);
31193 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
31194 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
31195 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
31196 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
31197 uint64_t ret_ref = 0;
31198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31199 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31203 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
31204 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
31205 uint64_t ret_ref = 0;
31206 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31207 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31210 int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) {
31211 LDKChannelUpdate arg_conv;
31212 arg_conv.inner = untag_ptr(arg);
31213 arg_conv.is_owned = ptr_is_owned(arg);
31214 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31215 arg_conv.is_owned = false;
31216 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
31220 uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) {
31221 LDKChannelUpdate orig_conv;
31222 orig_conv.inner = untag_ptr(orig);
31223 orig_conv.is_owned = ptr_is_owned(orig);
31224 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31225 orig_conv.is_owned = false;
31226 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
31227 uint64_t ret_ref = 0;
31228 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31229 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31233 void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
31234 LDKQueryChannelRange this_obj_conv;
31235 this_obj_conv.inner = untag_ptr(this_obj);
31236 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31238 QueryChannelRange_free(this_obj_conv);
31241 int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) {
31242 LDKQueryChannelRange this_ptr_conv;
31243 this_ptr_conv.inner = untag_ptr(this_ptr);
31244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31246 this_ptr_conv.is_owned = false;
31247 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31248 memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32);
31252 void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31253 LDKQueryChannelRange this_ptr_conv;
31254 this_ptr_conv.inner = untag_ptr(this_ptr);
31255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31257 this_ptr_conv.is_owned = false;
31258 LDKThirtyTwoBytes val_ref;
31259 CHECK(val->arr_len == 32);
31260 memcpy(val_ref.data, val->elems, 32); FREE(val);
31261 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31264 int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) {
31265 LDKQueryChannelRange this_ptr_conv;
31266 this_ptr_conv.inner = untag_ptr(this_ptr);
31267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31269 this_ptr_conv.is_owned = false;
31270 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
31274 void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31275 LDKQueryChannelRange this_ptr_conv;
31276 this_ptr_conv.inner = untag_ptr(this_ptr);
31277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31279 this_ptr_conv.is_owned = false;
31280 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
31283 int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31284 LDKQueryChannelRange this_ptr_conv;
31285 this_ptr_conv.inner = untag_ptr(this_ptr);
31286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31288 this_ptr_conv.is_owned = false;
31289 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
31293 void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31294 LDKQueryChannelRange this_ptr_conv;
31295 this_ptr_conv.inner = untag_ptr(this_ptr);
31296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31298 this_ptr_conv.is_owned = false;
31299 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31302 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) {
31303 LDKThirtyTwoBytes chain_hash_arg_ref;
31304 CHECK(chain_hash_arg->arr_len == 32);
31305 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31306 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
31307 uint64_t ret_ref = 0;
31308 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31309 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31313 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
31314 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
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);
31320 int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) {
31321 LDKQueryChannelRange arg_conv;
31322 arg_conv.inner = untag_ptr(arg);
31323 arg_conv.is_owned = ptr_is_owned(arg);
31324 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31325 arg_conv.is_owned = false;
31326 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
31330 uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) {
31331 LDKQueryChannelRange orig_conv;
31332 orig_conv.inner = untag_ptr(orig);
31333 orig_conv.is_owned = ptr_is_owned(orig);
31334 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31335 orig_conv.is_owned = false;
31336 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
31337 uint64_t ret_ref = 0;
31338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31343 void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
31344 LDKReplyChannelRange this_obj_conv;
31345 this_obj_conv.inner = untag_ptr(this_obj);
31346 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31348 ReplyChannelRange_free(this_obj_conv);
31351 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) {
31352 LDKReplyChannelRange this_ptr_conv;
31353 this_ptr_conv.inner = untag_ptr(this_ptr);
31354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31356 this_ptr_conv.is_owned = false;
31357 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31358 memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32);
31362 void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31363 LDKReplyChannelRange this_ptr_conv;
31364 this_ptr_conv.inner = untag_ptr(this_ptr);
31365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31367 this_ptr_conv.is_owned = false;
31368 LDKThirtyTwoBytes val_ref;
31369 CHECK(val->arr_len == 32);
31370 memcpy(val_ref.data, val->elems, 32); FREE(val);
31371 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31374 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) {
31375 LDKReplyChannelRange this_ptr_conv;
31376 this_ptr_conv.inner = untag_ptr(this_ptr);
31377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31379 this_ptr_conv.is_owned = false;
31380 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
31384 void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31385 LDKReplyChannelRange this_ptr_conv;
31386 this_ptr_conv.inner = untag_ptr(this_ptr);
31387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31389 this_ptr_conv.is_owned = false;
31390 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
31393 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31394 LDKReplyChannelRange this_ptr_conv;
31395 this_ptr_conv.inner = untag_ptr(this_ptr);
31396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31398 this_ptr_conv.is_owned = false;
31399 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
31403 void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31404 LDKReplyChannelRange this_ptr_conv;
31405 this_ptr_conv.inner = untag_ptr(this_ptr);
31406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31408 this_ptr_conv.is_owned = false;
31409 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31412 jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) {
31413 LDKReplyChannelRange this_ptr_conv;
31414 this_ptr_conv.inner = untag_ptr(this_ptr);
31415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31417 this_ptr_conv.is_owned = false;
31418 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
31422 void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) {
31423 LDKReplyChannelRange this_ptr_conv;
31424 this_ptr_conv.inner = untag_ptr(this_ptr);
31425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31427 this_ptr_conv.is_owned = false;
31428 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
31431 int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) {
31432 LDKReplyChannelRange this_ptr_conv;
31433 this_ptr_conv.inner = untag_ptr(this_ptr);
31434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31436 this_ptr_conv.is_owned = false;
31437 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
31438 int64_tArray ret_arr = NULL;
31439 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31440 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31441 for (size_t i = 0; i < ret_var.datalen; i++) {
31442 int64_t ret_conv_8_conv = ret_var.data[i];
31443 ret_arr_ptr[i] = ret_conv_8_conv;
31446 FREE(ret_var.data);
31450 void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31451 LDKReplyChannelRange this_ptr_conv;
31452 this_ptr_conv.inner = untag_ptr(this_ptr);
31453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31455 this_ptr_conv.is_owned = false;
31456 LDKCVec_u64Z val_constr;
31457 val_constr.datalen = val->arr_len;
31458 if (val_constr.datalen > 0)
31459 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31461 val_constr.data = NULL;
31462 int64_t* val_vals = val->elems;
31463 for (size_t i = 0; i < val_constr.datalen; i++) {
31464 int64_t val_conv_8 = val_vals[i];
31465 val_constr.data[i] = val_conv_8;
31468 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
31471 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) {
31472 LDKThirtyTwoBytes chain_hash_arg_ref;
31473 CHECK(chain_hash_arg->arr_len == 32);
31474 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31475 LDKCVec_u64Z short_channel_ids_arg_constr;
31476 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31477 if (short_channel_ids_arg_constr.datalen > 0)
31478 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31480 short_channel_ids_arg_constr.data = NULL;
31481 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31482 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31483 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31484 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31486 FREE(short_channel_ids_arg);
31487 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
31488 uint64_t ret_ref = 0;
31489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31494 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
31495 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
31496 uint64_t ret_ref = 0;
31497 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31498 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31501 int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) {
31502 LDKReplyChannelRange arg_conv;
31503 arg_conv.inner = untag_ptr(arg);
31504 arg_conv.is_owned = ptr_is_owned(arg);
31505 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31506 arg_conv.is_owned = false;
31507 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
31511 uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) {
31512 LDKReplyChannelRange orig_conv;
31513 orig_conv.inner = untag_ptr(orig);
31514 orig_conv.is_owned = ptr_is_owned(orig);
31515 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31516 orig_conv.is_owned = false;
31517 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
31518 uint64_t ret_ref = 0;
31519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31524 void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
31525 LDKQueryShortChannelIds this_obj_conv;
31526 this_obj_conv.inner = untag_ptr(this_obj);
31527 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31529 QueryShortChannelIds_free(this_obj_conv);
31532 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) {
31533 LDKQueryShortChannelIds 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31539 memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32);
31543 void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31544 LDKQueryShortChannelIds this_ptr_conv;
31545 this_ptr_conv.inner = untag_ptr(this_ptr);
31546 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31548 this_ptr_conv.is_owned = false;
31549 LDKThirtyTwoBytes val_ref;
31550 CHECK(val->arr_len == 32);
31551 memcpy(val_ref.data, val->elems, 32); FREE(val);
31552 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
31555 int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) {
31556 LDKQueryShortChannelIds this_ptr_conv;
31557 this_ptr_conv.inner = untag_ptr(this_ptr);
31558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31560 this_ptr_conv.is_owned = false;
31561 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
31562 int64_tArray ret_arr = NULL;
31563 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31564 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31565 for (size_t i = 0; i < ret_var.datalen; i++) {
31566 int64_t ret_conv_8_conv = ret_var.data[i];
31567 ret_arr_ptr[i] = ret_conv_8_conv;
31570 FREE(ret_var.data);
31574 void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31575 LDKQueryShortChannelIds this_ptr_conv;
31576 this_ptr_conv.inner = untag_ptr(this_ptr);
31577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31579 this_ptr_conv.is_owned = false;
31580 LDKCVec_u64Z val_constr;
31581 val_constr.datalen = val->arr_len;
31582 if (val_constr.datalen > 0)
31583 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31585 val_constr.data = NULL;
31586 int64_t* val_vals = val->elems;
31587 for (size_t i = 0; i < val_constr.datalen; i++) {
31588 int64_t val_conv_8 = val_vals[i];
31589 val_constr.data[i] = val_conv_8;
31592 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
31595 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
31596 LDKThirtyTwoBytes chain_hash_arg_ref;
31597 CHECK(chain_hash_arg->arr_len == 32);
31598 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31599 LDKCVec_u64Z short_channel_ids_arg_constr;
31600 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31601 if (short_channel_ids_arg_constr.datalen > 0)
31602 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31604 short_channel_ids_arg_constr.data = NULL;
31605 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31606 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31607 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31608 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31610 FREE(short_channel_ids_arg);
31611 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
31612 uint64_t ret_ref = 0;
31613 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31614 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31618 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
31619 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
31620 uint64_t ret_ref = 0;
31621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31625 int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) {
31626 LDKQueryShortChannelIds arg_conv;
31627 arg_conv.inner = untag_ptr(arg);
31628 arg_conv.is_owned = ptr_is_owned(arg);
31629 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31630 arg_conv.is_owned = false;
31631 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
31635 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) {
31636 LDKQueryShortChannelIds orig_conv;
31637 orig_conv.inner = untag_ptr(orig);
31638 orig_conv.is_owned = ptr_is_owned(orig);
31639 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31640 orig_conv.is_owned = false;
31641 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
31642 uint64_t ret_ref = 0;
31643 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31644 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31648 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
31649 LDKReplyShortChannelIdsEnd this_obj_conv;
31650 this_obj_conv.inner = untag_ptr(this_obj);
31651 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31653 ReplyShortChannelIdsEnd_free(this_obj_conv);
31656 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) {
31657 LDKReplyShortChannelIdsEnd this_ptr_conv;
31658 this_ptr_conv.inner = untag_ptr(this_ptr);
31659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31661 this_ptr_conv.is_owned = false;
31662 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31663 memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32);
31667 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31668 LDKReplyShortChannelIdsEnd this_ptr_conv;
31669 this_ptr_conv.inner = untag_ptr(this_ptr);
31670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31672 this_ptr_conv.is_owned = false;
31673 LDKThirtyTwoBytes val_ref;
31674 CHECK(val->arr_len == 32);
31675 memcpy(val_ref.data, val->elems, 32); FREE(val);
31676 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
31679 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) {
31680 LDKReplyShortChannelIdsEnd this_ptr_conv;
31681 this_ptr_conv.inner = untag_ptr(this_ptr);
31682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31684 this_ptr_conv.is_owned = false;
31685 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
31689 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) {
31690 LDKReplyShortChannelIdsEnd this_ptr_conv;
31691 this_ptr_conv.inner = untag_ptr(this_ptr);
31692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31694 this_ptr_conv.is_owned = false;
31695 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
31698 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) {
31699 LDKThirtyTwoBytes chain_hash_arg_ref;
31700 CHECK(chain_hash_arg->arr_len == 32);
31701 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31702 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
31703 uint64_t ret_ref = 0;
31704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31709 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
31710 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
31711 uint64_t ret_ref = 0;
31712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31716 int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) {
31717 LDKReplyShortChannelIdsEnd arg_conv;
31718 arg_conv.inner = untag_ptr(arg);
31719 arg_conv.is_owned = ptr_is_owned(arg);
31720 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31721 arg_conv.is_owned = false;
31722 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
31726 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) {
31727 LDKReplyShortChannelIdsEnd orig_conv;
31728 orig_conv.inner = untag_ptr(orig);
31729 orig_conv.is_owned = ptr_is_owned(orig);
31730 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31731 orig_conv.is_owned = false;
31732 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
31733 uint64_t ret_ref = 0;
31734 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31735 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31739 void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
31740 LDKGossipTimestampFilter this_obj_conv;
31741 this_obj_conv.inner = untag_ptr(this_obj);
31742 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31744 GossipTimestampFilter_free(this_obj_conv);
31747 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) {
31748 LDKGossipTimestampFilter this_ptr_conv;
31749 this_ptr_conv.inner = untag_ptr(this_ptr);
31750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31752 this_ptr_conv.is_owned = false;
31753 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31754 memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32);
31758 void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31759 LDKGossipTimestampFilter this_ptr_conv;
31760 this_ptr_conv.inner = untag_ptr(this_ptr);
31761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31763 this_ptr_conv.is_owned = false;
31764 LDKThirtyTwoBytes val_ref;
31765 CHECK(val->arr_len == 32);
31766 memcpy(val_ref.data, val->elems, 32); FREE(val);
31767 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
31770 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) {
31771 LDKGossipTimestampFilter 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 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
31780 void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) {
31781 LDKGossipTimestampFilter this_ptr_conv;
31782 this_ptr_conv.inner = untag_ptr(this_ptr);
31783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31785 this_ptr_conv.is_owned = false;
31786 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
31789 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) {
31790 LDKGossipTimestampFilter this_ptr_conv;
31791 this_ptr_conv.inner = untag_ptr(this_ptr);
31792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31794 this_ptr_conv.is_owned = false;
31795 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
31799 void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) {
31800 LDKGossipTimestampFilter this_ptr_conv;
31801 this_ptr_conv.inner = untag_ptr(this_ptr);
31802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31804 this_ptr_conv.is_owned = false;
31805 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
31808 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) {
31809 LDKThirtyTwoBytes chain_hash_arg_ref;
31810 CHECK(chain_hash_arg->arr_len == 32);
31811 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31812 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
31813 uint64_t ret_ref = 0;
31814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31819 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
31820 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
31821 uint64_t ret_ref = 0;
31822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31823 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31826 int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) {
31827 LDKGossipTimestampFilter arg_conv;
31828 arg_conv.inner = untag_ptr(arg);
31829 arg_conv.is_owned = ptr_is_owned(arg);
31830 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31831 arg_conv.is_owned = false;
31832 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
31836 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) {
31837 LDKGossipTimestampFilter orig_conv;
31838 orig_conv.inner = untag_ptr(orig);
31839 orig_conv.is_owned = ptr_is_owned(orig);
31840 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31841 orig_conv.is_owned = false;
31842 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
31843 uint64_t ret_ref = 0;
31844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31849 void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
31850 if (!ptr_is_owned(this_ptr)) return;
31851 void* this_ptr_ptr = untag_ptr(this_ptr);
31852 CHECK_ACCESS(this_ptr_ptr);
31853 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
31854 FREE(untag_ptr(this_ptr));
31855 ErrorAction_free(this_ptr_conv);
31858 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
31859 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31860 *ret_copy = ErrorAction_clone(arg);
31861 uint64_t ret_ref = tag_ptr(ret_copy, true);
31864 int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) {
31865 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
31866 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
31870 uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) {
31871 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
31872 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31873 *ret_copy = ErrorAction_clone(orig_conv);
31874 uint64_t ret_ref = tag_ptr(ret_copy, true);
31878 uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) {
31879 LDKErrorMessage msg_conv;
31880 msg_conv.inner = untag_ptr(msg);
31881 msg_conv.is_owned = ptr_is_owned(msg);
31882 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31883 msg_conv = ErrorMessage_clone(&msg_conv);
31884 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31885 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
31886 uint64_t ret_ref = tag_ptr(ret_copy, true);
31890 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() {
31891 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31892 *ret_copy = ErrorAction_ignore_error();
31893 uint64_t ret_ref = tag_ptr(ret_copy, true);
31897 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
31898 LDKLevel a_conv = LDKLevel_from_js(a);
31899 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31900 *ret_copy = ErrorAction_ignore_and_log(a_conv);
31901 uint64_t ret_ref = tag_ptr(ret_copy, true);
31905 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() {
31906 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31907 *ret_copy = ErrorAction_ignore_duplicate_gossip();
31908 uint64_t ret_ref = tag_ptr(ret_copy, true);
31912 uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) {
31913 LDKErrorMessage msg_conv;
31914 msg_conv.inner = untag_ptr(msg);
31915 msg_conv.is_owned = ptr_is_owned(msg);
31916 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31917 msg_conv = ErrorMessage_clone(&msg_conv);
31918 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31919 *ret_copy = ErrorAction_send_error_message(msg_conv);
31920 uint64_t ret_ref = tag_ptr(ret_copy, true);
31924 uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) {
31925 LDKWarningMessage msg_conv;
31926 msg_conv.inner = untag_ptr(msg);
31927 msg_conv.is_owned = ptr_is_owned(msg);
31928 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31929 msg_conv = WarningMessage_clone(&msg_conv);
31930 LDKLevel log_level_conv = LDKLevel_from_js(log_level);
31931 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31932 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
31933 uint64_t ret_ref = tag_ptr(ret_copy, true);
31937 void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) {
31938 LDKLightningError this_obj_conv;
31939 this_obj_conv.inner = untag_ptr(this_obj);
31940 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31942 LightningError_free(this_obj_conv);
31945 jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) {
31946 LDKLightningError this_ptr_conv;
31947 this_ptr_conv.inner = untag_ptr(this_ptr);
31948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31950 this_ptr_conv.is_owned = false;
31951 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
31952 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
31957 void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) {
31958 LDKLightningError this_ptr_conv;
31959 this_ptr_conv.inner = untag_ptr(this_ptr);
31960 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31962 this_ptr_conv.is_owned = false;
31963 LDKStr val_conv = str_ref_to_owned_c(val);
31964 LightningError_set_err(&this_ptr_conv, val_conv);
31967 uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) {
31968 LDKLightningError this_ptr_conv;
31969 this_ptr_conv.inner = untag_ptr(this_ptr);
31970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31972 this_ptr_conv.is_owned = false;
31973 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31974 *ret_copy = LightningError_get_action(&this_ptr_conv);
31975 uint64_t ret_ref = tag_ptr(ret_copy, true);
31979 void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) {
31980 LDKLightningError this_ptr_conv;
31981 this_ptr_conv.inner = untag_ptr(this_ptr);
31982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31984 this_ptr_conv.is_owned = false;
31985 void* val_ptr = untag_ptr(val);
31986 CHECK_ACCESS(val_ptr);
31987 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
31988 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
31989 LightningError_set_action(&this_ptr_conv, val_conv);
31992 uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) {
31993 LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
31994 void* action_arg_ptr = untag_ptr(action_arg);
31995 CHECK_ACCESS(action_arg_ptr);
31996 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
31997 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
31998 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
31999 uint64_t ret_ref = 0;
32000 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32001 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32005 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
32006 LDKLightningError ret_var = LightningError_clone(arg);
32007 uint64_t ret_ref = 0;
32008 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32009 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32012 int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) {
32013 LDKLightningError arg_conv;
32014 arg_conv.inner = untag_ptr(arg);
32015 arg_conv.is_owned = ptr_is_owned(arg);
32016 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32017 arg_conv.is_owned = false;
32018 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
32022 uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) {
32023 LDKLightningError orig_conv;
32024 orig_conv.inner = untag_ptr(orig);
32025 orig_conv.is_owned = ptr_is_owned(orig);
32026 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32027 orig_conv.is_owned = false;
32028 LDKLightningError ret_var = LightningError_clone(&orig_conv);
32029 uint64_t ret_ref = 0;
32030 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32031 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32035 void __attribute__((export_name("TS_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) {
32036 LDKCommitmentUpdate this_obj_conv;
32037 this_obj_conv.inner = untag_ptr(this_obj);
32038 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32040 CommitmentUpdate_free(this_obj_conv);
32043 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) {
32044 LDKCommitmentUpdate this_ptr_conv;
32045 this_ptr_conv.inner = untag_ptr(this_ptr);
32046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32048 this_ptr_conv.is_owned = false;
32049 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
32050 uint64_tArray ret_arr = NULL;
32051 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32052 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32053 for (size_t p = 0; p < ret_var.datalen; p++) {
32054 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
32055 uint64_t ret_conv_15_ref = 0;
32056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
32057 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
32058 ret_arr_ptr[p] = ret_conv_15_ref;
32061 FREE(ret_var.data);
32065 void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) {
32066 LDKCommitmentUpdate this_ptr_conv;
32067 this_ptr_conv.inner = untag_ptr(this_ptr);
32068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32070 this_ptr_conv.is_owned = false;
32071 LDKCVec_UpdateAddHTLCZ val_constr;
32072 val_constr.datalen = val->arr_len;
32073 if (val_constr.datalen > 0)
32074 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
32076 val_constr.data = NULL;
32077 uint64_t* val_vals = val->elems;
32078 for (size_t p = 0; p < val_constr.datalen; p++) {
32079 uint64_t val_conv_15 = val_vals[p];
32080 LDKUpdateAddHTLC val_conv_15_conv;
32081 val_conv_15_conv.inner = untag_ptr(val_conv_15);
32082 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
32083 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
32084 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
32085 val_constr.data[p] = val_conv_15_conv;
32088 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
32091 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) {
32092 LDKCommitmentUpdate this_ptr_conv;
32093 this_ptr_conv.inner = untag_ptr(this_ptr);
32094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32096 this_ptr_conv.is_owned = false;
32097 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
32098 uint64_tArray ret_arr = NULL;
32099 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32100 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32101 for (size_t t = 0; t < ret_var.datalen; t++) {
32102 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
32103 uint64_t ret_conv_19_ref = 0;
32104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
32105 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
32106 ret_arr_ptr[t] = ret_conv_19_ref;
32109 FREE(ret_var.data);
32113 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) {
32114 LDKCommitmentUpdate 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 LDKCVec_UpdateFulfillHTLCZ val_constr;
32120 val_constr.datalen = val->arr_len;
32121 if (val_constr.datalen > 0)
32122 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
32124 val_constr.data = NULL;
32125 uint64_t* val_vals = val->elems;
32126 for (size_t t = 0; t < val_constr.datalen; t++) {
32127 uint64_t val_conv_19 = val_vals[t];
32128 LDKUpdateFulfillHTLC val_conv_19_conv;
32129 val_conv_19_conv.inner = untag_ptr(val_conv_19);
32130 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
32131 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
32132 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
32133 val_constr.data[t] = val_conv_19_conv;
32136 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
32139 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) {
32140 LDKCommitmentUpdate this_ptr_conv;
32141 this_ptr_conv.inner = untag_ptr(this_ptr);
32142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32144 this_ptr_conv.is_owned = false;
32145 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
32146 uint64_tArray ret_arr = NULL;
32147 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32148 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32149 for (size_t q = 0; q < ret_var.datalen; q++) {
32150 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
32151 uint64_t ret_conv_16_ref = 0;
32152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
32153 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
32154 ret_arr_ptr[q] = ret_conv_16_ref;
32157 FREE(ret_var.data);
32161 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) {
32162 LDKCommitmentUpdate this_ptr_conv;
32163 this_ptr_conv.inner = untag_ptr(this_ptr);
32164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32166 this_ptr_conv.is_owned = false;
32167 LDKCVec_UpdateFailHTLCZ val_constr;
32168 val_constr.datalen = val->arr_len;
32169 if (val_constr.datalen > 0)
32170 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
32172 val_constr.data = NULL;
32173 uint64_t* val_vals = val->elems;
32174 for (size_t q = 0; q < val_constr.datalen; q++) {
32175 uint64_t val_conv_16 = val_vals[q];
32176 LDKUpdateFailHTLC val_conv_16_conv;
32177 val_conv_16_conv.inner = untag_ptr(val_conv_16);
32178 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
32179 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
32180 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
32181 val_constr.data[q] = val_conv_16_conv;
32184 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
32187 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) {
32188 LDKCommitmentUpdate this_ptr_conv;
32189 this_ptr_conv.inner = untag_ptr(this_ptr);
32190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32192 this_ptr_conv.is_owned = false;
32193 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
32194 uint64_tArray ret_arr = NULL;
32195 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32196 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32197 for (size_t z = 0; z < ret_var.datalen; z++) {
32198 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
32199 uint64_t ret_conv_25_ref = 0;
32200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
32201 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
32202 ret_arr_ptr[z] = ret_conv_25_ref;
32205 FREE(ret_var.data);
32209 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) {
32210 LDKCommitmentUpdate this_ptr_conv;
32211 this_ptr_conv.inner = untag_ptr(this_ptr);
32212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32214 this_ptr_conv.is_owned = false;
32215 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
32216 val_constr.datalen = val->arr_len;
32217 if (val_constr.datalen > 0)
32218 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32220 val_constr.data = NULL;
32221 uint64_t* val_vals = val->elems;
32222 for (size_t z = 0; z < val_constr.datalen; z++) {
32223 uint64_t val_conv_25 = val_vals[z];
32224 LDKUpdateFailMalformedHTLC val_conv_25_conv;
32225 val_conv_25_conv.inner = untag_ptr(val_conv_25);
32226 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
32227 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
32228 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
32229 val_constr.data[z] = val_conv_25_conv;
32232 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
32235 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) {
32236 LDKCommitmentUpdate this_ptr_conv;
32237 this_ptr_conv.inner = untag_ptr(this_ptr);
32238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32240 this_ptr_conv.is_owned = false;
32241 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
32242 uint64_t ret_ref = 0;
32243 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32244 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32248 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) {
32249 LDKCommitmentUpdate this_ptr_conv;
32250 this_ptr_conv.inner = untag_ptr(this_ptr);
32251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32253 this_ptr_conv.is_owned = false;
32254 LDKUpdateFee val_conv;
32255 val_conv.inner = untag_ptr(val);
32256 val_conv.is_owned = ptr_is_owned(val);
32257 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32258 val_conv = UpdateFee_clone(&val_conv);
32259 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
32262 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) {
32263 LDKCommitmentUpdate this_ptr_conv;
32264 this_ptr_conv.inner = untag_ptr(this_ptr);
32265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32267 this_ptr_conv.is_owned = false;
32268 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
32269 uint64_t ret_ref = 0;
32270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32275 void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) {
32276 LDKCommitmentUpdate this_ptr_conv;
32277 this_ptr_conv.inner = untag_ptr(this_ptr);
32278 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32280 this_ptr_conv.is_owned = false;
32281 LDKCommitmentSigned val_conv;
32282 val_conv.inner = untag_ptr(val);
32283 val_conv.is_owned = ptr_is_owned(val);
32284 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32285 val_conv = CommitmentSigned_clone(&val_conv);
32286 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
32289 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) {
32290 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
32291 update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len;
32292 if (update_add_htlcs_arg_constr.datalen > 0)
32293 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
32295 update_add_htlcs_arg_constr.data = NULL;
32296 uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
32297 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
32298 uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
32299 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
32300 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
32301 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
32302 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
32303 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
32304 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
32306 FREE(update_add_htlcs_arg);
32307 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
32308 update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
32309 if (update_fulfill_htlcs_arg_constr.datalen > 0)
32310 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
32312 update_fulfill_htlcs_arg_constr.data = NULL;
32313 uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
32314 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
32315 uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
32316 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
32317 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
32318 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
32319 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
32320 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
32321 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
32323 FREE(update_fulfill_htlcs_arg);
32324 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
32325 update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
32326 if (update_fail_htlcs_arg_constr.datalen > 0)
32327 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
32329 update_fail_htlcs_arg_constr.data = NULL;
32330 uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
32331 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
32332 uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
32333 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
32334 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
32335 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
32336 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
32337 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
32338 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
32340 FREE(update_fail_htlcs_arg);
32341 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
32342 update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
32343 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
32344 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32346 update_fail_malformed_htlcs_arg_constr.data = NULL;
32347 uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
32348 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
32349 uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
32350 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
32351 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
32352 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
32353 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
32354 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
32355 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
32357 FREE(update_fail_malformed_htlcs_arg);
32358 LDKUpdateFee update_fee_arg_conv;
32359 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
32360 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
32361 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
32362 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
32363 LDKCommitmentSigned commitment_signed_arg_conv;
32364 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
32365 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
32366 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
32367 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
32368 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);
32369 uint64_t ret_ref = 0;
32370 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32371 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32375 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
32376 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
32377 uint64_t ret_ref = 0;
32378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32382 int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) {
32383 LDKCommitmentUpdate arg_conv;
32384 arg_conv.inner = untag_ptr(arg);
32385 arg_conv.is_owned = ptr_is_owned(arg);
32386 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32387 arg_conv.is_owned = false;
32388 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
32392 uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) {
32393 LDKCommitmentUpdate orig_conv;
32394 orig_conv.inner = untag_ptr(orig);
32395 orig_conv.is_owned = ptr_is_owned(orig);
32396 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32397 orig_conv.is_owned = false;
32398 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
32399 uint64_t ret_ref = 0;
32400 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32401 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32405 void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
32406 if (!ptr_is_owned(this_ptr)) return;
32407 void* this_ptr_ptr = untag_ptr(this_ptr);
32408 CHECK_ACCESS(this_ptr_ptr);
32409 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
32410 FREE(untag_ptr(this_ptr));
32411 ChannelMessageHandler_free(this_ptr_conv);
32414 void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint64_t this_ptr) {
32415 if (!ptr_is_owned(this_ptr)) return;
32416 void* this_ptr_ptr = untag_ptr(this_ptr);
32417 CHECK_ACCESS(this_ptr_ptr);
32418 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
32419 FREE(untag_ptr(this_ptr));
32420 RoutingMessageHandler_free(this_ptr_conv);
32423 int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
32424 LDKAcceptChannel obj_conv;
32425 obj_conv.inner = untag_ptr(obj);
32426 obj_conv.is_owned = ptr_is_owned(obj);
32427 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32428 obj_conv.is_owned = false;
32429 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
32430 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32431 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32432 CVec_u8Z_free(ret_var);
32436 uint64_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
32437 LDKu8slice ser_ref;
32438 ser_ref.datalen = ser->arr_len;
32439 ser_ref.data = ser->elems;
32440 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
32441 *ret_conv = AcceptChannel_read(ser_ref);
32443 return tag_ptr(ret_conv, true);
32446 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) {
32447 LDKAnnouncementSignatures obj_conv;
32448 obj_conv.inner = untag_ptr(obj);
32449 obj_conv.is_owned = ptr_is_owned(obj);
32450 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32451 obj_conv.is_owned = false;
32452 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
32453 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32454 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32455 CVec_u8Z_free(ret_var);
32459 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
32460 LDKu8slice ser_ref;
32461 ser_ref.datalen = ser->arr_len;
32462 ser_ref.data = ser->elems;
32463 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
32464 *ret_conv = AnnouncementSignatures_read(ser_ref);
32466 return tag_ptr(ret_conv, true);
32469 int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) {
32470 LDKChannelReestablish obj_conv;
32471 obj_conv.inner = untag_ptr(obj);
32472 obj_conv.is_owned = ptr_is_owned(obj);
32473 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32474 obj_conv.is_owned = false;
32475 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
32476 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32477 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32478 CVec_u8Z_free(ret_var);
32482 uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
32483 LDKu8slice ser_ref;
32484 ser_ref.datalen = ser->arr_len;
32485 ser_ref.data = ser->elems;
32486 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
32487 *ret_conv = ChannelReestablish_read(ser_ref);
32489 return tag_ptr(ret_conv, true);
32492 int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) {
32493 LDKClosingSigned obj_conv;
32494 obj_conv.inner = untag_ptr(obj);
32495 obj_conv.is_owned = ptr_is_owned(obj);
32496 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32497 obj_conv.is_owned = false;
32498 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
32499 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32500 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32501 CVec_u8Z_free(ret_var);
32505 uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
32506 LDKu8slice ser_ref;
32507 ser_ref.datalen = ser->arr_len;
32508 ser_ref.data = ser->elems;
32509 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
32510 *ret_conv = ClosingSigned_read(ser_ref);
32512 return tag_ptr(ret_conv, true);
32515 int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) {
32516 LDKClosingSignedFeeRange obj_conv;
32517 obj_conv.inner = untag_ptr(obj);
32518 obj_conv.is_owned = ptr_is_owned(obj);
32519 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32520 obj_conv.is_owned = false;
32521 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
32522 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32523 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32524 CVec_u8Z_free(ret_var);
32528 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
32529 LDKu8slice ser_ref;
32530 ser_ref.datalen = ser->arr_len;
32531 ser_ref.data = ser->elems;
32532 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
32533 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
32535 return tag_ptr(ret_conv, true);
32538 int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) {
32539 LDKCommitmentSigned obj_conv;
32540 obj_conv.inner = untag_ptr(obj);
32541 obj_conv.is_owned = ptr_is_owned(obj);
32542 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32543 obj_conv.is_owned = false;
32544 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
32545 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32546 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32547 CVec_u8Z_free(ret_var);
32551 uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
32552 LDKu8slice ser_ref;
32553 ser_ref.datalen = ser->arr_len;
32554 ser_ref.data = ser->elems;
32555 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
32556 *ret_conv = CommitmentSigned_read(ser_ref);
32558 return tag_ptr(ret_conv, true);
32561 int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) {
32562 LDKFundingCreated obj_conv;
32563 obj_conv.inner = untag_ptr(obj);
32564 obj_conv.is_owned = ptr_is_owned(obj);
32565 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32566 obj_conv.is_owned = false;
32567 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
32568 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32569 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32570 CVec_u8Z_free(ret_var);
32574 uint64_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
32575 LDKu8slice ser_ref;
32576 ser_ref.datalen = ser->arr_len;
32577 ser_ref.data = ser->elems;
32578 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
32579 *ret_conv = FundingCreated_read(ser_ref);
32581 return tag_ptr(ret_conv, true);
32584 int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) {
32585 LDKFundingSigned obj_conv;
32586 obj_conv.inner = untag_ptr(obj);
32587 obj_conv.is_owned = ptr_is_owned(obj);
32588 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32589 obj_conv.is_owned = false;
32590 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
32591 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32592 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32593 CVec_u8Z_free(ret_var);
32597 uint64_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
32598 LDKu8slice ser_ref;
32599 ser_ref.datalen = ser->arr_len;
32600 ser_ref.data = ser->elems;
32601 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
32602 *ret_conv = FundingSigned_read(ser_ref);
32604 return tag_ptr(ret_conv, true);
32607 int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) {
32608 LDKChannelReady obj_conv;
32609 obj_conv.inner = untag_ptr(obj);
32610 obj_conv.is_owned = ptr_is_owned(obj);
32611 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32612 obj_conv.is_owned = false;
32613 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
32614 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32615 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32616 CVec_u8Z_free(ret_var);
32620 uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
32621 LDKu8slice ser_ref;
32622 ser_ref.datalen = ser->arr_len;
32623 ser_ref.data = ser->elems;
32624 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
32625 *ret_conv = ChannelReady_read(ser_ref);
32627 return tag_ptr(ret_conv, true);
32630 int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) {
32632 obj_conv.inner = untag_ptr(obj);
32633 obj_conv.is_owned = ptr_is_owned(obj);
32634 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32635 obj_conv.is_owned = false;
32636 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
32637 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32638 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32639 CVec_u8Z_free(ret_var);
32643 uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
32644 LDKu8slice ser_ref;
32645 ser_ref.datalen = ser->arr_len;
32646 ser_ref.data = ser->elems;
32647 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
32648 *ret_conv = Init_read(ser_ref);
32650 return tag_ptr(ret_conv, true);
32653 int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) {
32654 LDKOpenChannel obj_conv;
32655 obj_conv.inner = untag_ptr(obj);
32656 obj_conv.is_owned = ptr_is_owned(obj);
32657 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32658 obj_conv.is_owned = false;
32659 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
32660 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32661 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32662 CVec_u8Z_free(ret_var);
32666 uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
32667 LDKu8slice ser_ref;
32668 ser_ref.datalen = ser->arr_len;
32669 ser_ref.data = ser->elems;
32670 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
32671 *ret_conv = OpenChannel_read(ser_ref);
32673 return tag_ptr(ret_conv, true);
32676 int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) {
32677 LDKRevokeAndACK obj_conv;
32678 obj_conv.inner = untag_ptr(obj);
32679 obj_conv.is_owned = ptr_is_owned(obj);
32680 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32681 obj_conv.is_owned = false;
32682 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
32683 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32684 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32685 CVec_u8Z_free(ret_var);
32689 uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
32690 LDKu8slice ser_ref;
32691 ser_ref.datalen = ser->arr_len;
32692 ser_ref.data = ser->elems;
32693 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
32694 *ret_conv = RevokeAndACK_read(ser_ref);
32696 return tag_ptr(ret_conv, true);
32699 int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) {
32700 LDKShutdown obj_conv;
32701 obj_conv.inner = untag_ptr(obj);
32702 obj_conv.is_owned = ptr_is_owned(obj);
32703 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32704 obj_conv.is_owned = false;
32705 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
32706 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32707 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32708 CVec_u8Z_free(ret_var);
32712 uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
32713 LDKu8slice ser_ref;
32714 ser_ref.datalen = ser->arr_len;
32715 ser_ref.data = ser->elems;
32716 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
32717 *ret_conv = Shutdown_read(ser_ref);
32719 return tag_ptr(ret_conv, true);
32722 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) {
32723 LDKUpdateFailHTLC obj_conv;
32724 obj_conv.inner = untag_ptr(obj);
32725 obj_conv.is_owned = ptr_is_owned(obj);
32726 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32727 obj_conv.is_owned = false;
32728 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
32729 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32730 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32731 CVec_u8Z_free(ret_var);
32735 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
32736 LDKu8slice ser_ref;
32737 ser_ref.datalen = ser->arr_len;
32738 ser_ref.data = ser->elems;
32739 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
32740 *ret_conv = UpdateFailHTLC_read(ser_ref);
32742 return tag_ptr(ret_conv, true);
32745 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) {
32746 LDKUpdateFailMalformedHTLC obj_conv;
32747 obj_conv.inner = untag_ptr(obj);
32748 obj_conv.is_owned = ptr_is_owned(obj);
32749 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32750 obj_conv.is_owned = false;
32751 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
32752 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32753 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32754 CVec_u8Z_free(ret_var);
32758 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
32759 LDKu8slice ser_ref;
32760 ser_ref.datalen = ser->arr_len;
32761 ser_ref.data = ser->elems;
32762 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
32763 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
32765 return tag_ptr(ret_conv, true);
32768 int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) {
32769 LDKUpdateFee obj_conv;
32770 obj_conv.inner = untag_ptr(obj);
32771 obj_conv.is_owned = ptr_is_owned(obj);
32772 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32773 obj_conv.is_owned = false;
32774 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
32775 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32776 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32777 CVec_u8Z_free(ret_var);
32781 uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
32782 LDKu8slice ser_ref;
32783 ser_ref.datalen = ser->arr_len;
32784 ser_ref.data = ser->elems;
32785 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
32786 *ret_conv = UpdateFee_read(ser_ref);
32788 return tag_ptr(ret_conv, true);
32791 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) {
32792 LDKUpdateFulfillHTLC obj_conv;
32793 obj_conv.inner = untag_ptr(obj);
32794 obj_conv.is_owned = ptr_is_owned(obj);
32795 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32796 obj_conv.is_owned = false;
32797 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
32798 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32799 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32800 CVec_u8Z_free(ret_var);
32804 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
32805 LDKu8slice ser_ref;
32806 ser_ref.datalen = ser->arr_len;
32807 ser_ref.data = ser->elems;
32808 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
32809 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
32811 return tag_ptr(ret_conv, true);
32814 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) {
32815 LDKUpdateAddHTLC obj_conv;
32816 obj_conv.inner = untag_ptr(obj);
32817 obj_conv.is_owned = ptr_is_owned(obj);
32818 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32819 obj_conv.is_owned = false;
32820 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
32821 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32822 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32823 CVec_u8Z_free(ret_var);
32827 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
32828 LDKu8slice ser_ref;
32829 ser_ref.datalen = ser->arr_len;
32830 ser_ref.data = ser->elems;
32831 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
32832 *ret_conv = UpdateAddHTLC_read(ser_ref);
32834 return tag_ptr(ret_conv, true);
32837 int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
32839 obj_conv.inner = untag_ptr(obj);
32840 obj_conv.is_owned = ptr_is_owned(obj);
32841 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32842 obj_conv.is_owned = false;
32843 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
32844 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32845 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32846 CVec_u8Z_free(ret_var);
32850 uint64_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
32851 LDKu8slice ser_ref;
32852 ser_ref.datalen = ser->arr_len;
32853 ser_ref.data = ser->elems;
32854 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
32855 *ret_conv = Ping_read(ser_ref);
32857 return tag_ptr(ret_conv, true);
32860 int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) {
32862 obj_conv.inner = untag_ptr(obj);
32863 obj_conv.is_owned = ptr_is_owned(obj);
32864 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32865 obj_conv.is_owned = false;
32866 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
32867 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32868 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32869 CVec_u8Z_free(ret_var);
32873 uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
32874 LDKu8slice ser_ref;
32875 ser_ref.datalen = ser->arr_len;
32876 ser_ref.data = ser->elems;
32877 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
32878 *ret_conv = Pong_read(ser_ref);
32880 return tag_ptr(ret_conv, true);
32883 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) {
32884 LDKUnsignedChannelAnnouncement obj_conv;
32885 obj_conv.inner = untag_ptr(obj);
32886 obj_conv.is_owned = ptr_is_owned(obj);
32887 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32888 obj_conv.is_owned = false;
32889 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
32890 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32891 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32892 CVec_u8Z_free(ret_var);
32896 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
32897 LDKu8slice ser_ref;
32898 ser_ref.datalen = ser->arr_len;
32899 ser_ref.data = ser->elems;
32900 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
32901 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
32903 return tag_ptr(ret_conv, true);
32906 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) {
32907 LDKChannelAnnouncement obj_conv;
32908 obj_conv.inner = untag_ptr(obj);
32909 obj_conv.is_owned = ptr_is_owned(obj);
32910 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32911 obj_conv.is_owned = false;
32912 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
32913 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32914 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32915 CVec_u8Z_free(ret_var);
32919 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
32920 LDKu8slice ser_ref;
32921 ser_ref.datalen = ser->arr_len;
32922 ser_ref.data = ser->elems;
32923 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
32924 *ret_conv = ChannelAnnouncement_read(ser_ref);
32926 return tag_ptr(ret_conv, true);
32929 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) {
32930 LDKUnsignedChannelUpdate obj_conv;
32931 obj_conv.inner = untag_ptr(obj);
32932 obj_conv.is_owned = ptr_is_owned(obj);
32933 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32934 obj_conv.is_owned = false;
32935 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
32936 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32937 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32938 CVec_u8Z_free(ret_var);
32942 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
32943 LDKu8slice ser_ref;
32944 ser_ref.datalen = ser->arr_len;
32945 ser_ref.data = ser->elems;
32946 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
32947 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
32949 return tag_ptr(ret_conv, true);
32952 int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) {
32953 LDKChannelUpdate obj_conv;
32954 obj_conv.inner = untag_ptr(obj);
32955 obj_conv.is_owned = ptr_is_owned(obj);
32956 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32957 obj_conv.is_owned = false;
32958 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
32959 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32960 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32961 CVec_u8Z_free(ret_var);
32965 uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
32966 LDKu8slice ser_ref;
32967 ser_ref.datalen = ser->arr_len;
32968 ser_ref.data = ser->elems;
32969 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
32970 *ret_conv = ChannelUpdate_read(ser_ref);
32972 return tag_ptr(ret_conv, true);
32975 int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) {
32976 LDKErrorMessage obj_conv;
32977 obj_conv.inner = untag_ptr(obj);
32978 obj_conv.is_owned = ptr_is_owned(obj);
32979 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32980 obj_conv.is_owned = false;
32981 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
32982 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32983 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32984 CVec_u8Z_free(ret_var);
32988 uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
32989 LDKu8slice ser_ref;
32990 ser_ref.datalen = ser->arr_len;
32991 ser_ref.data = ser->elems;
32992 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
32993 *ret_conv = ErrorMessage_read(ser_ref);
32995 return tag_ptr(ret_conv, true);
32998 int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) {
32999 LDKWarningMessage obj_conv;
33000 obj_conv.inner = untag_ptr(obj);
33001 obj_conv.is_owned = ptr_is_owned(obj);
33002 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33003 obj_conv.is_owned = false;
33004 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
33005 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33006 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33007 CVec_u8Z_free(ret_var);
33011 uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
33012 LDKu8slice ser_ref;
33013 ser_ref.datalen = ser->arr_len;
33014 ser_ref.data = ser->elems;
33015 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
33016 *ret_conv = WarningMessage_read(ser_ref);
33018 return tag_ptr(ret_conv, true);
33021 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) {
33022 LDKUnsignedNodeAnnouncement obj_conv;
33023 obj_conv.inner = untag_ptr(obj);
33024 obj_conv.is_owned = ptr_is_owned(obj);
33025 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33026 obj_conv.is_owned = false;
33027 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
33028 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33029 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33030 CVec_u8Z_free(ret_var);
33034 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
33035 LDKu8slice ser_ref;
33036 ser_ref.datalen = ser->arr_len;
33037 ser_ref.data = ser->elems;
33038 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
33039 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
33041 return tag_ptr(ret_conv, true);
33044 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) {
33045 LDKNodeAnnouncement obj_conv;
33046 obj_conv.inner = untag_ptr(obj);
33047 obj_conv.is_owned = ptr_is_owned(obj);
33048 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33049 obj_conv.is_owned = false;
33050 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
33051 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33052 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33053 CVec_u8Z_free(ret_var);
33057 uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
33058 LDKu8slice ser_ref;
33059 ser_ref.datalen = ser->arr_len;
33060 ser_ref.data = ser->elems;
33061 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
33062 *ret_conv = NodeAnnouncement_read(ser_ref);
33064 return tag_ptr(ret_conv, true);
33067 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
33068 LDKu8slice ser_ref;
33069 ser_ref.datalen = ser->arr_len;
33070 ser_ref.data = ser->elems;
33071 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
33072 *ret_conv = QueryShortChannelIds_read(ser_ref);
33074 return tag_ptr(ret_conv, true);
33077 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) {
33078 LDKQueryShortChannelIds obj_conv;
33079 obj_conv.inner = untag_ptr(obj);
33080 obj_conv.is_owned = ptr_is_owned(obj);
33081 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33082 obj_conv.is_owned = false;
33083 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
33084 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33085 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33086 CVec_u8Z_free(ret_var);
33090 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) {
33091 LDKReplyShortChannelIdsEnd obj_conv;
33092 obj_conv.inner = untag_ptr(obj);
33093 obj_conv.is_owned = ptr_is_owned(obj);
33094 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33095 obj_conv.is_owned = false;
33096 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
33097 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33098 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33099 CVec_u8Z_free(ret_var);
33103 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
33104 LDKu8slice ser_ref;
33105 ser_ref.datalen = ser->arr_len;
33106 ser_ref.data = ser->elems;
33107 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
33108 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
33110 return tag_ptr(ret_conv, true);
33113 int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) {
33114 LDKQueryChannelRange this_arg_conv;
33115 this_arg_conv.inner = untag_ptr(this_arg);
33116 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33118 this_arg_conv.is_owned = false;
33119 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
33123 int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) {
33124 LDKQueryChannelRange obj_conv;
33125 obj_conv.inner = untag_ptr(obj);
33126 obj_conv.is_owned = ptr_is_owned(obj);
33127 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33128 obj_conv.is_owned = false;
33129 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
33130 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33131 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33132 CVec_u8Z_free(ret_var);
33136 uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
33137 LDKu8slice ser_ref;
33138 ser_ref.datalen = ser->arr_len;
33139 ser_ref.data = ser->elems;
33140 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
33141 *ret_conv = QueryChannelRange_read(ser_ref);
33143 return tag_ptr(ret_conv, true);
33146 uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
33147 LDKu8slice ser_ref;
33148 ser_ref.datalen = ser->arr_len;
33149 ser_ref.data = ser->elems;
33150 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
33151 *ret_conv = ReplyChannelRange_read(ser_ref);
33153 return tag_ptr(ret_conv, true);
33156 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) {
33157 LDKReplyChannelRange obj_conv;
33158 obj_conv.inner = untag_ptr(obj);
33159 obj_conv.is_owned = ptr_is_owned(obj);
33160 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33161 obj_conv.is_owned = false;
33162 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
33163 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33164 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33165 CVec_u8Z_free(ret_var);
33169 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) {
33170 LDKGossipTimestampFilter obj_conv;
33171 obj_conv.inner = untag_ptr(obj);
33172 obj_conv.is_owned = ptr_is_owned(obj);
33173 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33174 obj_conv.is_owned = false;
33175 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
33176 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33177 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33178 CVec_u8Z_free(ret_var);
33182 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
33183 LDKu8slice ser_ref;
33184 ser_ref.datalen = ser->arr_len;
33185 ser_ref.data = ser->elems;
33186 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
33187 *ret_conv = GossipTimestampFilter_read(ser_ref);
33189 return tag_ptr(ret_conv, true);
33192 void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint64_t this_ptr) {
33193 if (!ptr_is_owned(this_ptr)) return;
33194 void* this_ptr_ptr = untag_ptr(this_ptr);
33195 CHECK_ACCESS(this_ptr_ptr);
33196 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
33197 FREE(untag_ptr(this_ptr));
33198 CustomMessageHandler_free(this_ptr_conv);
33201 void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) {
33202 LDKIgnoringMessageHandler this_obj_conv;
33203 this_obj_conv.inner = untag_ptr(this_obj);
33204 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33206 IgnoringMessageHandler_free(this_obj_conv);
33209 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() {
33210 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
33211 uint64_t ret_ref = 0;
33212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33217 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33218 LDKIgnoringMessageHandler this_arg_conv;
33219 this_arg_conv.inner = untag_ptr(this_arg);
33220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33222 this_arg_conv.is_owned = false;
33223 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33224 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33225 return tag_ptr(ret_ret, true);
33228 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint64_t this_arg) {
33229 LDKIgnoringMessageHandler this_arg_conv;
33230 this_arg_conv.inner = untag_ptr(this_arg);
33231 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33233 this_arg_conv.is_owned = false;
33234 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
33235 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
33236 return tag_ptr(ret_ret, true);
33239 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
33240 LDKIgnoringMessageHandler this_arg_conv;
33241 this_arg_conv.inner = untag_ptr(this_arg);
33242 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33244 this_arg_conv.is_owned = false;
33245 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
33246 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
33247 return tag_ptr(ret_ret, true);
33250 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) {
33251 LDKIgnoringMessageHandler this_arg_conv;
33252 this_arg_conv.inner = untag_ptr(this_arg);
33253 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33255 this_arg_conv.is_owned = false;
33256 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
33257 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
33258 return tag_ptr(ret_ret, true);
33261 void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) {
33262 LDKErroringMessageHandler this_obj_conv;
33263 this_obj_conv.inner = untag_ptr(this_obj);
33264 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33266 ErroringMessageHandler_free(this_obj_conv);
33269 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() {
33270 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
33271 uint64_t ret_ref = 0;
33272 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33273 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33277 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33278 LDKErroringMessageHandler this_arg_conv;
33279 this_arg_conv.inner = untag_ptr(this_arg);
33280 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33282 this_arg_conv.is_owned = false;
33283 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33284 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33285 return tag_ptr(ret_ret, true);
33288 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) {
33289 LDKErroringMessageHandler this_arg_conv;
33290 this_arg_conv.inner = untag_ptr(this_arg);
33291 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33293 this_arg_conv.is_owned = false;
33294 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
33295 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
33296 return tag_ptr(ret_ret, true);
33299 void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) {
33300 LDKMessageHandler this_obj_conv;
33301 this_obj_conv.inner = untag_ptr(this_obj);
33302 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33304 MessageHandler_free(this_obj_conv);
33307 uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_handler(uint64_t this_ptr) {
33308 LDKMessageHandler this_ptr_conv;
33309 this_ptr_conv.inner = untag_ptr(this_ptr);
33310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33312 this_ptr_conv.is_owned = false;
33313 // WARNING: This object doesn't live past this scope, needs clone!
33314 uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
33318 void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_handler(uint64_t this_ptr, uint64_t val) {
33319 LDKMessageHandler this_ptr_conv;
33320 this_ptr_conv.inner = untag_ptr(this_ptr);
33321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33323 this_ptr_conv.is_owned = false;
33324 void* val_ptr = untag_ptr(val);
33325 CHECK_ACCESS(val_ptr);
33326 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
33327 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
33328 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33329 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
33331 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
33334 uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_handler(uint64_t this_ptr) {
33335 LDKMessageHandler this_ptr_conv;
33336 this_ptr_conv.inner = untag_ptr(this_ptr);
33337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33339 this_ptr_conv.is_owned = false;
33340 // WARNING: This object doesn't live past this scope, needs clone!
33341 uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
33345 void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_handler(uint64_t this_ptr, uint64_t val) {
33346 LDKMessageHandler this_ptr_conv;
33347 this_ptr_conv.inner = untag_ptr(this_ptr);
33348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33350 this_ptr_conv.is_owned = false;
33351 void* val_ptr = untag_ptr(val);
33352 CHECK_ACCESS(val_ptr);
33353 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
33354 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33355 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33356 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
33358 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
33361 uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg) {
33362 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
33363 CHECK_ACCESS(chan_handler_arg_ptr);
33364 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
33365 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
33366 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33367 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
33369 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
33370 CHECK_ACCESS(route_handler_arg_ptr);
33371 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
33372 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33373 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33374 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
33376 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
33377 uint64_t ret_ref = 0;
33378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33383 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
33384 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33385 *ret_ret = SocketDescriptor_clone(arg);
33386 return tag_ptr(ret_ret, true);
33388 int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) {
33389 void* arg_ptr = untag_ptr(arg);
33390 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
33391 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
33392 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
33396 uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) {
33397 void* orig_ptr = untag_ptr(orig);
33398 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
33399 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
33400 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33401 *ret_ret = SocketDescriptor_clone(orig_conv);
33402 return tag_ptr(ret_ret, true);
33405 void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint64_t this_ptr) {
33406 if (!ptr_is_owned(this_ptr)) return;
33407 void* this_ptr_ptr = untag_ptr(this_ptr);
33408 CHECK_ACCESS(this_ptr_ptr);
33409 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
33410 FREE(untag_ptr(this_ptr));
33411 SocketDescriptor_free(this_ptr_conv);
33414 void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) {
33415 LDKPeerHandleError this_obj_conv;
33416 this_obj_conv.inner = untag_ptr(this_obj);
33417 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33419 PeerHandleError_free(this_obj_conv);
33422 jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
33423 LDKPeerHandleError this_ptr_conv;
33424 this_ptr_conv.inner = untag_ptr(this_ptr);
33425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33427 this_ptr_conv.is_owned = false;
33428 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
33432 void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
33433 LDKPeerHandleError this_ptr_conv;
33434 this_ptr_conv.inner = untag_ptr(this_ptr);
33435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33437 this_ptr_conv.is_owned = false;
33438 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
33441 uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
33442 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
33443 uint64_t ret_ref = 0;
33444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33449 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
33450 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
33451 uint64_t ret_ref = 0;
33452 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33453 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33456 int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) {
33457 LDKPeerHandleError arg_conv;
33458 arg_conv.inner = untag_ptr(arg);
33459 arg_conv.is_owned = ptr_is_owned(arg);
33460 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33461 arg_conv.is_owned = false;
33462 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
33466 uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) {
33467 LDKPeerHandleError orig_conv;
33468 orig_conv.inner = untag_ptr(orig);
33469 orig_conv.is_owned = ptr_is_owned(orig);
33470 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33471 orig_conv.is_owned = false;
33472 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
33473 uint64_t ret_ref = 0;
33474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33479 void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) {
33480 LDKPeerManager this_obj_conv;
33481 this_obj_conv.inner = untag_ptr(this_obj);
33482 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33484 PeerManager_free(this_obj_conv);
33487 uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) {
33488 LDKMessageHandler message_handler_conv;
33489 message_handler_conv.inner = untag_ptr(message_handler);
33490 message_handler_conv.is_owned = ptr_is_owned(message_handler);
33491 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
33492 // WARNING: we need a move here but no clone is available for LDKMessageHandler
33494 LDKSecretKey our_node_secret_ref;
33495 CHECK(our_node_secret->arr_len == 32);
33496 memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
33497 unsigned char ephemeral_random_data_arr[32];
33498 CHECK(ephemeral_random_data->arr_len == 32);
33499 memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
33500 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
33501 void* logger_ptr = untag_ptr(logger);
33502 CHECK_ACCESS(logger_ptr);
33503 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
33504 if (logger_conv.free == LDKLogger_JCalls_free) {
33505 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33506 LDKLogger_JCalls_cloned(&logger_conv);
33508 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
33509 CHECK_ACCESS(custom_message_handler_ptr);
33510 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
33511 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
33512 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33513 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
33515 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
33516 uint64_t ret_ref = 0;
33517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33522 ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
33523 LDKPeerManager this_arg_conv;
33524 this_arg_conv.inner = untag_ptr(this_arg);
33525 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33527 this_arg_conv.is_owned = false;
33528 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
33529 ptrArray ret_arr = NULL;
33530 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
33531 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
33532 for (size_t m = 0; m < ret_var.datalen; m++) {
33533 int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
33534 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
33535 ret_arr_ptr[m] = ret_conv_12_arr;
33538 FREE(ret_var.data);
33542 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) {
33543 LDKPeerManager this_arg_conv;
33544 this_arg_conv.inner = untag_ptr(this_arg);
33545 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33547 this_arg_conv.is_owned = false;
33548 LDKPublicKey their_node_id_ref;
33549 CHECK(their_node_id->arr_len == 33);
33550 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
33551 void* descriptor_ptr = untag_ptr(descriptor);
33552 CHECK_ACCESS(descriptor_ptr);
33553 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33554 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33555 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33556 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33558 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33559 CHECK_ACCESS(remote_network_address_ptr);
33560 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33561 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
33562 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
33563 return tag_ptr(ret_conv, true);
33566 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) {
33567 LDKPeerManager this_arg_conv;
33568 this_arg_conv.inner = untag_ptr(this_arg);
33569 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33571 this_arg_conv.is_owned = false;
33572 void* descriptor_ptr = untag_ptr(descriptor);
33573 CHECK_ACCESS(descriptor_ptr);
33574 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33575 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33576 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33577 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33579 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33580 CHECK_ACCESS(remote_network_address_ptr);
33581 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33582 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33583 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
33584 return tag_ptr(ret_conv, true);
33587 uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) {
33588 LDKPeerManager this_arg_conv;
33589 this_arg_conv.inner = untag_ptr(this_arg);
33590 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33591 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33592 this_arg_conv.is_owned = false;
33593 void* descriptor_ptr = untag_ptr(descriptor);
33594 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33595 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33596 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33597 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
33598 return tag_ptr(ret_conv, true);
33601 uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) {
33602 LDKPeerManager this_arg_conv;
33603 this_arg_conv.inner = untag_ptr(this_arg);
33604 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33606 this_arg_conv.is_owned = false;
33607 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
33608 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
33609 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
33610 LDKu8slice data_ref;
33611 data_ref.datalen = data->arr_len;
33612 data_ref.data = data->elems;
33613 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
33614 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
33616 return tag_ptr(ret_conv, true);
33619 void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) {
33620 LDKPeerManager this_arg_conv;
33621 this_arg_conv.inner = untag_ptr(this_arg);
33622 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33624 this_arg_conv.is_owned = false;
33625 PeerManager_process_events(&this_arg_conv);
33628 void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) {
33629 LDKPeerManager this_arg_conv;
33630 this_arg_conv.inner = untag_ptr(this_arg);
33631 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33633 this_arg_conv.is_owned = false;
33634 void* descriptor_ptr = untag_ptr(descriptor);
33635 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33636 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33637 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
33640 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) {
33641 LDKPeerManager this_arg_conv;
33642 this_arg_conv.inner = untag_ptr(this_arg);
33643 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33645 this_arg_conv.is_owned = false;
33646 LDKPublicKey node_id_ref;
33647 CHECK(node_id->arr_len == 33);
33648 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
33649 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
33652 void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
33653 LDKPeerManager this_arg_conv;
33654 this_arg_conv.inner = untag_ptr(this_arg);
33655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33657 this_arg_conv.is_owned = false;
33658 PeerManager_disconnect_all_peers(&this_arg_conv);
33661 void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(uint64_t this_arg) {
33662 LDKPeerManager this_arg_conv;
33663 this_arg_conv.inner = untag_ptr(this_arg);
33664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33666 this_arg_conv.is_owned = false;
33667 PeerManager_timer_tick_occurred(&this_arg_conv);
33670 int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
33671 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
33675 int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
33676 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
33680 int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
33681 unsigned char commitment_seed_arr[32];
33682 CHECK(commitment_seed->arr_len == 32);
33683 memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
33684 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
33685 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33686 memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
33690 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) {
33691 LDKCVec_u8Z to_holder_script_ref;
33692 to_holder_script_ref.datalen = to_holder_script->arr_len;
33693 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
33694 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
33695 LDKCVec_u8Z to_counterparty_script_ref;
33696 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
33697 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
33698 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
33699 LDKOutPoint funding_outpoint_conv;
33700 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
33701 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
33702 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
33703 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
33704 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);
33705 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33706 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33707 Transaction_free(ret_var);
33711 void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) {
33712 LDKCounterpartyCommitmentSecrets this_obj_conv;
33713 this_obj_conv.inner = untag_ptr(this_obj);
33714 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33716 CounterpartyCommitmentSecrets_free(this_obj_conv);
33719 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
33720 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
33721 uint64_t ret_ref = 0;
33722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33726 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) {
33727 LDKCounterpartyCommitmentSecrets arg_conv;
33728 arg_conv.inner = untag_ptr(arg);
33729 arg_conv.is_owned = ptr_is_owned(arg);
33730 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33731 arg_conv.is_owned = false;
33732 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
33736 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) {
33737 LDKCounterpartyCommitmentSecrets orig_conv;
33738 orig_conv.inner = untag_ptr(orig);
33739 orig_conv.is_owned = ptr_is_owned(orig);
33740 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33741 orig_conv.is_owned = false;
33742 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
33743 uint64_t ret_ref = 0;
33744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33749 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() {
33750 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
33751 uint64_t ret_ref = 0;
33752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33757 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) {
33758 LDKCounterpartyCommitmentSecrets this_arg_conv;
33759 this_arg_conv.inner = untag_ptr(this_arg);
33760 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33762 this_arg_conv.is_owned = false;
33763 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
33767 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) {
33768 LDKCounterpartyCommitmentSecrets this_arg_conv;
33769 this_arg_conv.inner = untag_ptr(this_arg);
33770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33772 this_arg_conv.is_owned = false;
33773 LDKThirtyTwoBytes secret_ref;
33774 CHECK(secret->arr_len == 32);
33775 memcpy(secret_ref.data, secret->elems, 32); FREE(secret);
33776 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
33777 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
33778 return tag_ptr(ret_conv, true);
33781 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) {
33782 LDKCounterpartyCommitmentSecrets this_arg_conv;
33783 this_arg_conv.inner = untag_ptr(this_arg);
33784 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33786 this_arg_conv.is_owned = false;
33787 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33788 memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32);
33792 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) {
33793 LDKCounterpartyCommitmentSecrets obj_conv;
33794 obj_conv.inner = untag_ptr(obj);
33795 obj_conv.is_owned = ptr_is_owned(obj);
33796 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33797 obj_conv.is_owned = false;
33798 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
33799 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33800 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33801 CVec_u8Z_free(ret_var);
33805 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
33806 LDKu8slice ser_ref;
33807 ser_ref.datalen = ser->arr_len;
33808 ser_ref.data = ser->elems;
33809 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
33810 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
33812 return tag_ptr(ret_conv, true);
33815 uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
33816 LDKPublicKey per_commitment_point_ref;
33817 CHECK(per_commitment_point->arr_len == 33);
33818 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33819 unsigned char base_secret_arr[32];
33820 CHECK(base_secret->arr_len == 32);
33821 memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
33822 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
33823 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33824 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
33825 return tag_ptr(ret_conv, true);
33828 uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
33829 LDKPublicKey per_commitment_point_ref;
33830 CHECK(per_commitment_point->arr_len == 33);
33831 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33832 LDKPublicKey base_point_ref;
33833 CHECK(base_point->arr_len == 33);
33834 memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
33835 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33836 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
33837 return tag_ptr(ret_conv, true);
33840 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) {
33841 unsigned char per_commitment_secret_arr[32];
33842 CHECK(per_commitment_secret->arr_len == 32);
33843 memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
33844 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
33845 unsigned char countersignatory_revocation_base_secret_arr[32];
33846 CHECK(countersignatory_revocation_base_secret->arr_len == 32);
33847 memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
33848 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
33849 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33850 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
33851 return tag_ptr(ret_conv, true);
33854 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) {
33855 LDKPublicKey per_commitment_point_ref;
33856 CHECK(per_commitment_point->arr_len == 33);
33857 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33858 LDKPublicKey countersignatory_revocation_base_point_ref;
33859 CHECK(countersignatory_revocation_base_point->arr_len == 33);
33860 memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
33861 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33862 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
33863 return tag_ptr(ret_conv, true);
33866 void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
33867 LDKTxCreationKeys this_obj_conv;
33868 this_obj_conv.inner = untag_ptr(this_obj);
33869 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33871 TxCreationKeys_free(this_obj_conv);
33874 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) {
33875 LDKTxCreationKeys this_ptr_conv;
33876 this_ptr_conv.inner = untag_ptr(this_ptr);
33877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33879 this_ptr_conv.is_owned = false;
33880 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33881 memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
33885 void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
33886 LDKTxCreationKeys this_ptr_conv;
33887 this_ptr_conv.inner = untag_ptr(this_ptr);
33888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33890 this_ptr_conv.is_owned = false;
33891 LDKPublicKey val_ref;
33892 CHECK(val->arr_len == 33);
33893 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33894 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
33897 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) {
33898 LDKTxCreationKeys this_ptr_conv;
33899 this_ptr_conv.inner = untag_ptr(this_ptr);
33900 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33902 this_ptr_conv.is_owned = false;
33903 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33904 memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
33908 void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) {
33909 LDKTxCreationKeys this_ptr_conv;
33910 this_ptr_conv.inner = untag_ptr(this_ptr);
33911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33913 this_ptr_conv.is_owned = false;
33914 LDKPublicKey val_ref;
33915 CHECK(val->arr_len == 33);
33916 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33917 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
33920 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) {
33921 LDKTxCreationKeys this_ptr_conv;
33922 this_ptr_conv.inner = untag_ptr(this_ptr);
33923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33925 this_ptr_conv.is_owned = false;
33926 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33927 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
33931 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) {
33932 LDKTxCreationKeys this_ptr_conv;
33933 this_ptr_conv.inner = untag_ptr(this_ptr);
33934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33936 this_ptr_conv.is_owned = false;
33937 LDKPublicKey val_ref;
33938 CHECK(val->arr_len == 33);
33939 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33940 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
33943 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) {
33944 LDKTxCreationKeys this_ptr_conv;
33945 this_ptr_conv.inner = untag_ptr(this_ptr);
33946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33948 this_ptr_conv.is_owned = false;
33949 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33950 memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
33954 void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) {
33955 LDKTxCreationKeys this_ptr_conv;
33956 this_ptr_conv.inner = untag_ptr(this_ptr);
33957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33959 this_ptr_conv.is_owned = false;
33960 LDKPublicKey val_ref;
33961 CHECK(val->arr_len == 33);
33962 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33963 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
33966 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) {
33967 LDKTxCreationKeys this_ptr_conv;
33968 this_ptr_conv.inner = untag_ptr(this_ptr);
33969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33971 this_ptr_conv.is_owned = false;
33972 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33973 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
33977 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) {
33978 LDKTxCreationKeys this_ptr_conv;
33979 this_ptr_conv.inner = untag_ptr(this_ptr);
33980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33982 this_ptr_conv.is_owned = false;
33983 LDKPublicKey val_ref;
33984 CHECK(val->arr_len == 33);
33985 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33986 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
33989 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) {
33990 LDKPublicKey per_commitment_point_arg_ref;
33991 CHECK(per_commitment_point_arg->arr_len == 33);
33992 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
33993 LDKPublicKey revocation_key_arg_ref;
33994 CHECK(revocation_key_arg->arr_len == 33);
33995 memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg);
33996 LDKPublicKey broadcaster_htlc_key_arg_ref;
33997 CHECK(broadcaster_htlc_key_arg->arr_len == 33);
33998 memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg);
33999 LDKPublicKey countersignatory_htlc_key_arg_ref;
34000 CHECK(countersignatory_htlc_key_arg->arr_len == 33);
34001 memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg);
34002 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
34003 CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33);
34004 memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg);
34005 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);
34006 uint64_t ret_ref = 0;
34007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34012 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
34013 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
34014 uint64_t ret_ref = 0;
34015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34019 int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) {
34020 LDKTxCreationKeys arg_conv;
34021 arg_conv.inner = untag_ptr(arg);
34022 arg_conv.is_owned = ptr_is_owned(arg);
34023 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34024 arg_conv.is_owned = false;
34025 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
34029 uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) {
34030 LDKTxCreationKeys orig_conv;
34031 orig_conv.inner = untag_ptr(orig);
34032 orig_conv.is_owned = ptr_is_owned(orig);
34033 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34034 orig_conv.is_owned = false;
34035 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
34036 uint64_t ret_ref = 0;
34037 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34038 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34042 int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) {
34043 LDKTxCreationKeys obj_conv;
34044 obj_conv.inner = untag_ptr(obj);
34045 obj_conv.is_owned = ptr_is_owned(obj);
34046 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34047 obj_conv.is_owned = false;
34048 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
34049 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34050 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34051 CVec_u8Z_free(ret_var);
34055 uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
34056 LDKu8slice ser_ref;
34057 ser_ref.datalen = ser->arr_len;
34058 ser_ref.data = ser->elems;
34059 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
34060 *ret_conv = TxCreationKeys_read(ser_ref);
34062 return tag_ptr(ret_conv, true);
34065 void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) {
34066 LDKChannelPublicKeys this_obj_conv;
34067 this_obj_conv.inner = untag_ptr(this_obj);
34068 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34070 ChannelPublicKeys_free(this_obj_conv);
34073 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) {
34074 LDKChannelPublicKeys this_ptr_conv;
34075 this_ptr_conv.inner = untag_ptr(this_ptr);
34076 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34078 this_ptr_conv.is_owned = false;
34079 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34080 memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
34084 void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
34085 LDKChannelPublicKeys this_ptr_conv;
34086 this_ptr_conv.inner = untag_ptr(this_ptr);
34087 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34089 this_ptr_conv.is_owned = false;
34090 LDKPublicKey val_ref;
34091 CHECK(val->arr_len == 33);
34092 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34093 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
34096 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) {
34097 LDKChannelPublicKeys this_ptr_conv;
34098 this_ptr_conv.inner = untag_ptr(this_ptr);
34099 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34101 this_ptr_conv.is_owned = false;
34102 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34103 memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
34107 void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
34108 LDKChannelPublicKeys this_ptr_conv;
34109 this_ptr_conv.inner = untag_ptr(this_ptr);
34110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34112 this_ptr_conv.is_owned = false;
34113 LDKPublicKey val_ref;
34114 CHECK(val->arr_len == 33);
34115 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34116 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
34119 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) {
34120 LDKChannelPublicKeys this_ptr_conv;
34121 this_ptr_conv.inner = untag_ptr(this_ptr);
34122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34124 this_ptr_conv.is_owned = false;
34125 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34126 memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
34130 void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) {
34131 LDKChannelPublicKeys this_ptr_conv;
34132 this_ptr_conv.inner = untag_ptr(this_ptr);
34133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34135 this_ptr_conv.is_owned = false;
34136 LDKPublicKey val_ref;
34137 CHECK(val->arr_len == 33);
34138 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34139 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
34142 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) {
34143 LDKChannelPublicKeys this_ptr_conv;
34144 this_ptr_conv.inner = untag_ptr(this_ptr);
34145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34147 this_ptr_conv.is_owned = false;
34148 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34149 memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
34153 void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
34154 LDKChannelPublicKeys this_ptr_conv;
34155 this_ptr_conv.inner = untag_ptr(this_ptr);
34156 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34158 this_ptr_conv.is_owned = false;
34159 LDKPublicKey val_ref;
34160 CHECK(val->arr_len == 33);
34161 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34162 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
34165 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) {
34166 LDKChannelPublicKeys this_ptr_conv;
34167 this_ptr_conv.inner = untag_ptr(this_ptr);
34168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34170 this_ptr_conv.is_owned = false;
34171 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34172 memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
34176 void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
34177 LDKChannelPublicKeys this_ptr_conv;
34178 this_ptr_conv.inner = untag_ptr(this_ptr);
34179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34181 this_ptr_conv.is_owned = false;
34182 LDKPublicKey val_ref;
34183 CHECK(val->arr_len == 33);
34184 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34185 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
34188 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) {
34189 LDKPublicKey funding_pubkey_arg_ref;
34190 CHECK(funding_pubkey_arg->arr_len == 33);
34191 memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg);
34192 LDKPublicKey revocation_basepoint_arg_ref;
34193 CHECK(revocation_basepoint_arg->arr_len == 33);
34194 memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg);
34195 LDKPublicKey payment_point_arg_ref;
34196 CHECK(payment_point_arg->arr_len == 33);
34197 memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg);
34198 LDKPublicKey delayed_payment_basepoint_arg_ref;
34199 CHECK(delayed_payment_basepoint_arg->arr_len == 33);
34200 memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg);
34201 LDKPublicKey htlc_basepoint_arg_ref;
34202 CHECK(htlc_basepoint_arg->arr_len == 33);
34203 memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg);
34204 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);
34205 uint64_t ret_ref = 0;
34206 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34207 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34211 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
34212 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
34213 uint64_t ret_ref = 0;
34214 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34215 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34218 int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) {
34219 LDKChannelPublicKeys arg_conv;
34220 arg_conv.inner = untag_ptr(arg);
34221 arg_conv.is_owned = ptr_is_owned(arg);
34222 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34223 arg_conv.is_owned = false;
34224 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
34228 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) {
34229 LDKChannelPublicKeys orig_conv;
34230 orig_conv.inner = untag_ptr(orig);
34231 orig_conv.is_owned = ptr_is_owned(orig);
34232 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34233 orig_conv.is_owned = false;
34234 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
34235 uint64_t ret_ref = 0;
34236 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34237 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34241 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
34242 LDKChannelPublicKeys obj_conv;
34243 obj_conv.inner = untag_ptr(obj);
34244 obj_conv.is_owned = ptr_is_owned(obj);
34245 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34246 obj_conv.is_owned = false;
34247 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
34248 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34249 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34250 CVec_u8Z_free(ret_var);
34254 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
34255 LDKu8slice ser_ref;
34256 ser_ref.datalen = ser->arr_len;
34257 ser_ref.data = ser->elems;
34258 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
34259 *ret_conv = ChannelPublicKeys_read(ser_ref);
34261 return tag_ptr(ret_conv, true);
34264 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) {
34265 LDKPublicKey per_commitment_point_ref;
34266 CHECK(per_commitment_point->arr_len == 33);
34267 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34268 LDKPublicKey broadcaster_delayed_payment_base_ref;
34269 CHECK(broadcaster_delayed_payment_base->arr_len == 33);
34270 memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base);
34271 LDKPublicKey broadcaster_htlc_base_ref;
34272 CHECK(broadcaster_htlc_base->arr_len == 33);
34273 memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base);
34274 LDKPublicKey countersignatory_revocation_base_ref;
34275 CHECK(countersignatory_revocation_base->arr_len == 33);
34276 memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base);
34277 LDKPublicKey countersignatory_htlc_base_ref;
34278 CHECK(countersignatory_htlc_base->arr_len == 33);
34279 memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
34280 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34281 *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);
34282 return tag_ptr(ret_conv, true);
34285 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) {
34286 LDKPublicKey per_commitment_point_ref;
34287 CHECK(per_commitment_point->arr_len == 33);
34288 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34289 LDKChannelPublicKeys broadcaster_keys_conv;
34290 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
34291 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
34292 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
34293 broadcaster_keys_conv.is_owned = false;
34294 LDKChannelPublicKeys countersignatory_keys_conv;
34295 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
34296 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
34297 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
34298 countersignatory_keys_conv.is_owned = false;
34299 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34300 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
34301 return tag_ptr(ret_conv, true);
34304 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) {
34305 LDKPublicKey revocation_key_ref;
34306 CHECK(revocation_key->arr_len == 33);
34307 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34308 LDKPublicKey broadcaster_delayed_payment_key_ref;
34309 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34310 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34311 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
34312 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34313 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34314 CVec_u8Z_free(ret_var);
34318 void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) {
34319 LDKHTLCOutputInCommitment this_obj_conv;
34320 this_obj_conv.inner = untag_ptr(this_obj);
34321 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34323 HTLCOutputInCommitment_free(this_obj_conv);
34326 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) {
34327 LDKHTLCOutputInCommitment this_ptr_conv;
34328 this_ptr_conv.inner = untag_ptr(this_ptr);
34329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34331 this_ptr_conv.is_owned = false;
34332 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
34336 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) {
34337 LDKHTLCOutputInCommitment this_ptr_conv;
34338 this_ptr_conv.inner = untag_ptr(this_ptr);
34339 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34341 this_ptr_conv.is_owned = false;
34342 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
34345 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) {
34346 LDKHTLCOutputInCommitment this_ptr_conv;
34347 this_ptr_conv.inner = untag_ptr(this_ptr);
34348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34350 this_ptr_conv.is_owned = false;
34351 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
34355 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) {
34356 LDKHTLCOutputInCommitment this_ptr_conv;
34357 this_ptr_conv.inner = untag_ptr(this_ptr);
34358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34360 this_ptr_conv.is_owned = false;
34361 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
34364 int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) {
34365 LDKHTLCOutputInCommitment this_ptr_conv;
34366 this_ptr_conv.inner = untag_ptr(this_ptr);
34367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34369 this_ptr_conv.is_owned = false;
34370 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
34374 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
34375 LDKHTLCOutputInCommitment this_ptr_conv;
34376 this_ptr_conv.inner = untag_ptr(this_ptr);
34377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34379 this_ptr_conv.is_owned = false;
34380 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
34383 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) {
34384 LDKHTLCOutputInCommitment this_ptr_conv;
34385 this_ptr_conv.inner = untag_ptr(this_ptr);
34386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34388 this_ptr_conv.is_owned = false;
34389 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
34390 memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32);
34394 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
34395 LDKHTLCOutputInCommitment this_ptr_conv;
34396 this_ptr_conv.inner = untag_ptr(this_ptr);
34397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34399 this_ptr_conv.is_owned = false;
34400 LDKThirtyTwoBytes val_ref;
34401 CHECK(val->arr_len == 32);
34402 memcpy(val_ref.data, val->elems, 32); FREE(val);
34403 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
34406 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) {
34407 LDKHTLCOutputInCommitment this_ptr_conv;
34408 this_ptr_conv.inner = untag_ptr(this_ptr);
34409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34411 this_ptr_conv.is_owned = false;
34412 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
34413 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
34414 uint64_t ret_ref = tag_ptr(ret_copy, true);
34418 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) {
34419 LDKHTLCOutputInCommitment this_ptr_conv;
34420 this_ptr_conv.inner = untag_ptr(this_ptr);
34421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34423 this_ptr_conv.is_owned = false;
34424 void* val_ptr = untag_ptr(val);
34425 CHECK_ACCESS(val_ptr);
34426 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
34427 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
34428 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
34431 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) {
34432 LDKThirtyTwoBytes payment_hash_arg_ref;
34433 CHECK(payment_hash_arg->arr_len == 32);
34434 memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg);
34435 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
34436 CHECK_ACCESS(transaction_output_index_arg_ptr);
34437 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
34438 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
34439 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
34440 uint64_t ret_ref = 0;
34441 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34442 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34446 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
34447 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
34448 uint64_t ret_ref = 0;
34449 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34450 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34453 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) {
34454 LDKHTLCOutputInCommitment arg_conv;
34455 arg_conv.inner = untag_ptr(arg);
34456 arg_conv.is_owned = ptr_is_owned(arg);
34457 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34458 arg_conv.is_owned = false;
34459 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
34463 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) {
34464 LDKHTLCOutputInCommitment orig_conv;
34465 orig_conv.inner = untag_ptr(orig);
34466 orig_conv.is_owned = ptr_is_owned(orig);
34467 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34468 orig_conv.is_owned = false;
34469 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
34470 uint64_t ret_ref = 0;
34471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34476 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
34477 LDKHTLCOutputInCommitment obj_conv;
34478 obj_conv.inner = untag_ptr(obj);
34479 obj_conv.is_owned = ptr_is_owned(obj);
34480 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34481 obj_conv.is_owned = false;
34482 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
34483 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34484 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34485 CVec_u8Z_free(ret_var);
34489 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
34490 LDKu8slice ser_ref;
34491 ser_ref.datalen = ser->arr_len;
34492 ser_ref.data = ser->elems;
34493 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
34494 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
34496 return tag_ptr(ret_conv, true);
34499 int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) {
34500 LDKHTLCOutputInCommitment htlc_conv;
34501 htlc_conv.inner = untag_ptr(htlc);
34502 htlc_conv.is_owned = ptr_is_owned(htlc);
34503 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34504 htlc_conv.is_owned = false;
34505 LDKTxCreationKeys keys_conv;
34506 keys_conv.inner = untag_ptr(keys);
34507 keys_conv.is_owned = ptr_is_owned(keys);
34508 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34509 keys_conv.is_owned = false;
34510 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
34511 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34512 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34513 CVec_u8Z_free(ret_var);
34517 int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
34518 LDKPublicKey broadcaster_ref;
34519 CHECK(broadcaster->arr_len == 33);
34520 memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster);
34521 LDKPublicKey countersignatory_ref;
34522 CHECK(countersignatory->arr_len == 33);
34523 memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory);
34524 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
34525 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34526 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34527 CVec_u8Z_free(ret_var);
34531 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) {
34532 unsigned char commitment_txid_arr[32];
34533 CHECK(commitment_txid->arr_len == 32);
34534 memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
34535 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
34536 LDKHTLCOutputInCommitment htlc_conv;
34537 htlc_conv.inner = untag_ptr(htlc);
34538 htlc_conv.is_owned = ptr_is_owned(htlc);
34539 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34540 htlc_conv.is_owned = false;
34541 LDKPublicKey broadcaster_delayed_payment_key_ref;
34542 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34543 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34544 LDKPublicKey revocation_key_ref;
34545 CHECK(revocation_key->arr_len == 33);
34546 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34547 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);
34548 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34549 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34550 Transaction_free(ret_var);
34554 int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
34555 LDKPublicKey funding_pubkey_ref;
34556 CHECK(funding_pubkey->arr_len == 33);
34557 memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey);
34558 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
34559 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34560 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34561 CVec_u8Z_free(ret_var);
34565 void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
34566 LDKChannelTransactionParameters this_obj_conv;
34567 this_obj_conv.inner = untag_ptr(this_obj);
34568 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34570 ChannelTransactionParameters_free(this_obj_conv);
34573 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint64_t this_ptr) {
34574 LDKChannelTransactionParameters this_ptr_conv;
34575 this_ptr_conv.inner = untag_ptr(this_ptr);
34576 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34578 this_ptr_conv.is_owned = false;
34579 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
34580 uint64_t ret_ref = 0;
34581 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34582 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34586 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_t val) {
34587 LDKChannelTransactionParameters this_ptr_conv;
34588 this_ptr_conv.inner = untag_ptr(this_ptr);
34589 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34591 this_ptr_conv.is_owned = false;
34592 LDKChannelPublicKeys val_conv;
34593 val_conv.inner = untag_ptr(val);
34594 val_conv.is_owned = ptr_is_owned(val);
34595 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34596 val_conv = ChannelPublicKeys_clone(&val_conv);
34597 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
34600 int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(uint64_t this_ptr) {
34601 LDKChannelTransactionParameters this_ptr_conv;
34602 this_ptr_conv.inner = untag_ptr(this_ptr);
34603 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34605 this_ptr_conv.is_owned = false;
34606 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
34610 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) {
34611 LDKChannelTransactionParameters this_ptr_conv;
34612 this_ptr_conv.inner = untag_ptr(this_ptr);
34613 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34615 this_ptr_conv.is_owned = false;
34616 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
34619 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(uint64_t this_ptr) {
34620 LDKChannelTransactionParameters this_ptr_conv;
34621 this_ptr_conv.inner = untag_ptr(this_ptr);
34622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34624 this_ptr_conv.is_owned = false;
34625 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
34629 void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean val) {
34630 LDKChannelTransactionParameters 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 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
34638 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(uint64_t this_ptr) {
34639 LDKChannelTransactionParameters this_ptr_conv;
34640 this_ptr_conv.inner = untag_ptr(this_ptr);
34641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34643 this_ptr_conv.is_owned = false;
34644 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
34645 uint64_t ret_ref = 0;
34646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34651 void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_t val) {
34652 LDKChannelTransactionParameters this_ptr_conv;
34653 this_ptr_conv.inner = untag_ptr(this_ptr);
34654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34656 this_ptr_conv.is_owned = false;
34657 LDKCounterpartyChannelTransactionParameters val_conv;
34658 val_conv.inner = untag_ptr(val);
34659 val_conv.is_owned = ptr_is_owned(val);
34660 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34661 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
34662 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
34665 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(uint64_t this_ptr) {
34666 LDKChannelTransactionParameters this_ptr_conv;
34667 this_ptr_conv.inner = untag_ptr(this_ptr);
34668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34670 this_ptr_conv.is_owned = false;
34671 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
34672 uint64_t ret_ref = 0;
34673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34678 void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_t val) {
34679 LDKChannelTransactionParameters this_ptr_conv;
34680 this_ptr_conv.inner = untag_ptr(this_ptr);
34681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34683 this_ptr_conv.is_owned = false;
34684 LDKOutPoint val_conv;
34685 val_conv.inner = untag_ptr(val);
34686 val_conv.is_owned = ptr_is_owned(val);
34687 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34688 val_conv = OutPoint_clone(&val_conv);
34689 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
34692 uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_anchors(uint64_t this_ptr) {
34693 LDKChannelTransactionParameters this_ptr_conv;
34694 this_ptr_conv.inner = untag_ptr(this_ptr);
34695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34697 this_ptr_conv.is_owned = false;
34698 uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
34702 void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_anchors(uint64_t this_ptr, uint32_t val) {
34703 LDKChannelTransactionParameters this_ptr_conv;
34704 this_ptr_conv.inner = untag_ptr(this_ptr);
34705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34707 this_ptr_conv.is_owned = false;
34708 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
34709 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
34712 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) {
34713 LDKChannelPublicKeys holder_pubkeys_arg_conv;
34714 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
34715 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
34716 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
34717 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
34718 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
34719 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
34720 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
34721 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
34722 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
34723 LDKOutPoint funding_outpoint_arg_conv;
34724 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
34725 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
34726 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
34727 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
34728 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
34729 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);
34730 uint64_t ret_ref = 0;
34731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34736 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
34737 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
34738 uint64_t ret_ref = 0;
34739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34743 int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) {
34744 LDKChannelTransactionParameters arg_conv;
34745 arg_conv.inner = untag_ptr(arg);
34746 arg_conv.is_owned = ptr_is_owned(arg);
34747 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34748 arg_conv.is_owned = false;
34749 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
34753 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) {
34754 LDKChannelTransactionParameters orig_conv;
34755 orig_conv.inner = untag_ptr(orig);
34756 orig_conv.is_owned = ptr_is_owned(orig);
34757 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34758 orig_conv.is_owned = false;
34759 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
34760 uint64_t ret_ref = 0;
34761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34766 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) {
34767 LDKCounterpartyChannelTransactionParameters this_obj_conv;
34768 this_obj_conv.inner = untag_ptr(this_obj);
34769 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34771 CounterpartyChannelTransactionParameters_free(this_obj_conv);
34774 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) {
34775 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34776 this_ptr_conv.inner = untag_ptr(this_ptr);
34777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34779 this_ptr_conv.is_owned = false;
34780 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
34781 uint64_t ret_ref = 0;
34782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34787 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) {
34788 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34789 this_ptr_conv.inner = untag_ptr(this_ptr);
34790 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34792 this_ptr_conv.is_owned = false;
34793 LDKChannelPublicKeys val_conv;
34794 val_conv.inner = untag_ptr(val);
34795 val_conv.is_owned = ptr_is_owned(val);
34796 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34797 val_conv = ChannelPublicKeys_clone(&val_conv);
34798 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
34801 int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) {
34802 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34803 this_ptr_conv.inner = untag_ptr(this_ptr);
34804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34806 this_ptr_conv.is_owned = false;
34807 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
34811 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) {
34812 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34813 this_ptr_conv.inner = untag_ptr(this_ptr);
34814 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34816 this_ptr_conv.is_owned = false;
34817 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
34820 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
34821 LDKChannelPublicKeys pubkeys_arg_conv;
34822 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
34823 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
34824 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
34825 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
34826 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
34827 uint64_t ret_ref = 0;
34828 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34829 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34833 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
34834 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
34835 uint64_t ret_ref = 0;
34836 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34837 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34840 int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) {
34841 LDKCounterpartyChannelTransactionParameters arg_conv;
34842 arg_conv.inner = untag_ptr(arg);
34843 arg_conv.is_owned = ptr_is_owned(arg);
34844 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34845 arg_conv.is_owned = false;
34846 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
34850 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) {
34851 LDKCounterpartyChannelTransactionParameters orig_conv;
34852 orig_conv.inner = untag_ptr(orig);
34853 orig_conv.is_owned = ptr_is_owned(orig);
34854 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34855 orig_conv.is_owned = false;
34856 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
34857 uint64_t ret_ref = 0;
34858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34863 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) {
34864 LDKChannelTransactionParameters this_arg_conv;
34865 this_arg_conv.inner = untag_ptr(this_arg);
34866 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34867 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34868 this_arg_conv.is_owned = false;
34869 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
34873 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) {
34874 LDKChannelTransactionParameters this_arg_conv;
34875 this_arg_conv.inner = untag_ptr(this_arg);
34876 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34878 this_arg_conv.is_owned = false;
34879 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
34880 uint64_t ret_ref = 0;
34881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34886 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) {
34887 LDKChannelTransactionParameters this_arg_conv;
34888 this_arg_conv.inner = untag_ptr(this_arg);
34889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34891 this_arg_conv.is_owned = false;
34892 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
34893 uint64_t ret_ref = 0;
34894 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34895 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34899 int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) {
34900 LDKCounterpartyChannelTransactionParameters obj_conv;
34901 obj_conv.inner = untag_ptr(obj);
34902 obj_conv.is_owned = ptr_is_owned(obj);
34903 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34904 obj_conv.is_owned = false;
34905 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
34906 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34907 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34908 CVec_u8Z_free(ret_var);
34912 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
34913 LDKu8slice ser_ref;
34914 ser_ref.datalen = ser->arr_len;
34915 ser_ref.data = ser->elems;
34916 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
34917 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
34919 return tag_ptr(ret_conv, true);
34922 int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) {
34923 LDKChannelTransactionParameters obj_conv;
34924 obj_conv.inner = untag_ptr(obj);
34925 obj_conv.is_owned = ptr_is_owned(obj);
34926 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34927 obj_conv.is_owned = false;
34928 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
34929 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34930 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34931 CVec_u8Z_free(ret_var);
34935 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
34936 LDKu8slice ser_ref;
34937 ser_ref.datalen = ser->arr_len;
34938 ser_ref.data = ser->elems;
34939 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
34940 *ret_conv = ChannelTransactionParameters_read(ser_ref);
34942 return tag_ptr(ret_conv, true);
34945 void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) {
34946 LDKDirectedChannelTransactionParameters this_obj_conv;
34947 this_obj_conv.inner = untag_ptr(this_obj);
34948 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34950 DirectedChannelTransactionParameters_free(this_obj_conv);
34953 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) {
34954 LDKDirectedChannelTransactionParameters this_arg_conv;
34955 this_arg_conv.inner = untag_ptr(this_arg);
34956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34958 this_arg_conv.is_owned = false;
34959 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
34960 uint64_t ret_ref = 0;
34961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34966 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) {
34967 LDKDirectedChannelTransactionParameters this_arg_conv;
34968 this_arg_conv.inner = untag_ptr(this_arg);
34969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34971 this_arg_conv.is_owned = false;
34972 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
34973 uint64_t ret_ref = 0;
34974 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34975 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34979 int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) {
34980 LDKDirectedChannelTransactionParameters 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 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
34989 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) {
34990 LDKDirectedChannelTransactionParameters this_arg_conv;
34991 this_arg_conv.inner = untag_ptr(this_arg);
34992 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34994 this_arg_conv.is_owned = false;
34995 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
34999 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) {
35000 LDKDirectedChannelTransactionParameters this_arg_conv;
35001 this_arg_conv.inner = untag_ptr(this_arg);
35002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35004 this_arg_conv.is_owned = false;
35005 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
35006 uint64_t ret_ref = 0;
35007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35012 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) {
35013 LDKDirectedChannelTransactionParameters this_arg_conv;
35014 this_arg_conv.inner = untag_ptr(this_arg);
35015 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35017 this_arg_conv.is_owned = false;
35018 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
35022 void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) {
35023 LDKHolderCommitmentTransaction this_obj_conv;
35024 this_obj_conv.inner = untag_ptr(this_obj);
35025 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35027 HolderCommitmentTransaction_free(this_obj_conv);
35030 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) {
35031 LDKHolderCommitmentTransaction this_ptr_conv;
35032 this_ptr_conv.inner = untag_ptr(this_ptr);
35033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35035 this_ptr_conv.is_owned = false;
35036 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35037 memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
35041 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) {
35042 LDKHolderCommitmentTransaction this_ptr_conv;
35043 this_ptr_conv.inner = untag_ptr(this_ptr);
35044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35046 this_ptr_conv.is_owned = false;
35047 LDKSignature val_ref;
35048 CHECK(val->arr_len == 64);
35049 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
35050 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
35053 ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) {
35054 LDKHolderCommitmentTransaction this_ptr_conv;
35055 this_ptr_conv.inner = untag_ptr(this_ptr);
35056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35058 this_ptr_conv.is_owned = false;
35059 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
35060 ptrArray ret_arr = NULL;
35061 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
35062 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
35063 for (size_t m = 0; m < ret_var.datalen; m++) {
35064 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
35065 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
35066 ret_arr_ptr[m] = ret_conv_12_arr;
35069 FREE(ret_var.data);
35073 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) {
35074 LDKHolderCommitmentTransaction this_ptr_conv;
35075 this_ptr_conv.inner = untag_ptr(this_ptr);
35076 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35078 this_ptr_conv.is_owned = false;
35079 LDKCVec_SignatureZ val_constr;
35080 val_constr.datalen = val->arr_len;
35081 if (val_constr.datalen > 0)
35082 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35084 val_constr.data = NULL;
35085 int8_tArray* val_vals = (void*) val->elems;
35086 for (size_t m = 0; m < val_constr.datalen; m++) {
35087 int8_tArray val_conv_12 = val_vals[m];
35088 LDKSignature val_conv_12_ref;
35089 CHECK(val_conv_12->arr_len == 64);
35090 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
35091 val_constr.data[m] = val_conv_12_ref;
35094 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
35097 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
35098 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
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);
35104 int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) {
35105 LDKHolderCommitmentTransaction arg_conv;
35106 arg_conv.inner = untag_ptr(arg);
35107 arg_conv.is_owned = ptr_is_owned(arg);
35108 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35109 arg_conv.is_owned = false;
35110 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
35114 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) {
35115 LDKHolderCommitmentTransaction orig_conv;
35116 orig_conv.inner = untag_ptr(orig);
35117 orig_conv.is_owned = ptr_is_owned(orig);
35118 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35119 orig_conv.is_owned = false;
35120 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
35121 uint64_t ret_ref = 0;
35122 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35123 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35127 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) {
35128 LDKHolderCommitmentTransaction obj_conv;
35129 obj_conv.inner = untag_ptr(obj);
35130 obj_conv.is_owned = ptr_is_owned(obj);
35131 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35132 obj_conv.is_owned = false;
35133 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
35134 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35135 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35136 CVec_u8Z_free(ret_var);
35140 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
35141 LDKu8slice ser_ref;
35142 ser_ref.datalen = ser->arr_len;
35143 ser_ref.data = ser->elems;
35144 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
35145 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
35147 return tag_ptr(ret_conv, true);
35150 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) {
35151 LDKCommitmentTransaction commitment_tx_conv;
35152 commitment_tx_conv.inner = untag_ptr(commitment_tx);
35153 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
35154 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
35155 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
35156 LDKSignature counterparty_sig_ref;
35157 CHECK(counterparty_sig->arr_len == 64);
35158 memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig);
35159 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
35160 counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len;
35161 if (counterparty_htlc_sigs_constr.datalen > 0)
35162 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35164 counterparty_htlc_sigs_constr.data = NULL;
35165 int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
35166 for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
35167 int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
35168 LDKSignature counterparty_htlc_sigs_conv_12_ref;
35169 CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64);
35170 memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
35171 counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
35173 FREE(counterparty_htlc_sigs);
35174 LDKPublicKey holder_funding_key_ref;
35175 CHECK(holder_funding_key->arr_len == 33);
35176 memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
35177 LDKPublicKey counterparty_funding_key_ref;
35178 CHECK(counterparty_funding_key->arr_len == 33);
35179 memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key);
35180 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
35181 uint64_t ret_ref = 0;
35182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35187 void __attribute__((export_name("TS_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) {
35188 LDKBuiltCommitmentTransaction this_obj_conv;
35189 this_obj_conv.inner = untag_ptr(this_obj);
35190 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35192 BuiltCommitmentTransaction_free(this_obj_conv);
35195 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) {
35196 LDKBuiltCommitmentTransaction this_ptr_conv;
35197 this_ptr_conv.inner = untag_ptr(this_ptr);
35198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35200 this_ptr_conv.is_owned = false;
35201 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
35202 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35203 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35204 Transaction_free(ret_var);
35208 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) {
35209 LDKBuiltCommitmentTransaction this_ptr_conv;
35210 this_ptr_conv.inner = untag_ptr(this_ptr);
35211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35213 this_ptr_conv.is_owned = false;
35214 LDKTransaction val_ref;
35215 val_ref.datalen = val->arr_len;
35216 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
35217 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
35218 val_ref.data_is_owned = true;
35219 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
35222 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) {
35223 LDKBuiltCommitmentTransaction 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(32, __LINE__);
35229 memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32);
35233 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) {
35234 LDKBuiltCommitmentTransaction 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 LDKThirtyTwoBytes val_ref;
35240 CHECK(val->arr_len == 32);
35241 memcpy(val_ref.data, val->elems, 32); FREE(val);
35242 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
35245 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) {
35246 LDKTransaction transaction_arg_ref;
35247 transaction_arg_ref.datalen = transaction_arg->arr_len;
35248 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
35249 memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg);
35250 transaction_arg_ref.data_is_owned = true;
35251 LDKThirtyTwoBytes txid_arg_ref;
35252 CHECK(txid_arg->arr_len == 32);
35253 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
35254 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
35255 uint64_t ret_ref = 0;
35256 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35257 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35261 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
35262 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
35263 uint64_t ret_ref = 0;
35264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35268 int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) {
35269 LDKBuiltCommitmentTransaction arg_conv;
35270 arg_conv.inner = untag_ptr(arg);
35271 arg_conv.is_owned = ptr_is_owned(arg);
35272 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35273 arg_conv.is_owned = false;
35274 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
35278 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) {
35279 LDKBuiltCommitmentTransaction orig_conv;
35280 orig_conv.inner = untag_ptr(orig);
35281 orig_conv.is_owned = ptr_is_owned(orig);
35282 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35283 orig_conv.is_owned = false;
35284 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
35285 uint64_t ret_ref = 0;
35286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35291 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) {
35292 LDKBuiltCommitmentTransaction obj_conv;
35293 obj_conv.inner = untag_ptr(obj);
35294 obj_conv.is_owned = ptr_is_owned(obj);
35295 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35296 obj_conv.is_owned = false;
35297 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
35298 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35299 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35300 CVec_u8Z_free(ret_var);
35304 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
35305 LDKu8slice ser_ref;
35306 ser_ref.datalen = ser->arr_len;
35307 ser_ref.data = ser->elems;
35308 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
35309 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
35311 return tag_ptr(ret_conv, true);
35314 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) {
35315 LDKBuiltCommitmentTransaction this_arg_conv;
35316 this_arg_conv.inner = untag_ptr(this_arg);
35317 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35319 this_arg_conv.is_owned = false;
35320 LDKu8slice funding_redeemscript_ref;
35321 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35322 funding_redeemscript_ref.data = funding_redeemscript->elems;
35323 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35324 memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35325 FREE(funding_redeemscript);
35329 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) {
35330 LDKBuiltCommitmentTransaction this_arg_conv;
35331 this_arg_conv.inner = untag_ptr(this_arg);
35332 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35334 this_arg_conv.is_owned = false;
35335 unsigned char funding_key_arr[32];
35336 CHECK(funding_key->arr_len == 32);
35337 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35338 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35339 LDKu8slice funding_redeemscript_ref;
35340 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35341 funding_redeemscript_ref.data = funding_redeemscript->elems;
35342 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35343 memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35344 FREE(funding_redeemscript);
35348 void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) {
35349 LDKClosingTransaction this_obj_conv;
35350 this_obj_conv.inner = untag_ptr(this_obj);
35351 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35353 ClosingTransaction_free(this_obj_conv);
35356 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
35357 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
35358 uint64_t ret_ref = 0;
35359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35363 int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) {
35364 LDKClosingTransaction arg_conv;
35365 arg_conv.inner = untag_ptr(arg);
35366 arg_conv.is_owned = ptr_is_owned(arg);
35367 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35368 arg_conv.is_owned = false;
35369 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
35373 uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) {
35374 LDKClosingTransaction orig_conv;
35375 orig_conv.inner = untag_ptr(orig);
35376 orig_conv.is_owned = ptr_is_owned(orig);
35377 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35378 orig_conv.is_owned = false;
35379 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
35380 uint64_t ret_ref = 0;
35381 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35382 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35386 int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) {
35387 LDKClosingTransaction o_conv;
35388 o_conv.inner = untag_ptr(o);
35389 o_conv.is_owned = ptr_is_owned(o);
35390 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
35391 o_conv.is_owned = false;
35392 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
35396 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) {
35397 LDKCVec_u8Z to_holder_script_ref;
35398 to_holder_script_ref.datalen = to_holder_script->arr_len;
35399 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
35400 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
35401 LDKCVec_u8Z to_counterparty_script_ref;
35402 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
35403 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
35404 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
35405 LDKOutPoint funding_outpoint_conv;
35406 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35407 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35408 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35409 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35410 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
35411 uint64_t ret_ref = 0;
35412 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35413 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35417 uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) {
35418 LDKClosingTransaction this_arg_conv;
35419 this_arg_conv.inner = untag_ptr(this_arg);
35420 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35422 this_arg_conv.is_owned = false;
35423 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
35424 uint64_t ret_ref = 0;
35425 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35426 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35430 uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) {
35431 LDKClosingTransaction this_arg_conv;
35432 this_arg_conv.inner = untag_ptr(this_arg);
35433 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35435 this_arg_conv.is_owned = false;
35436 LDKOutPoint funding_outpoint_conv;
35437 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35438 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35439 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35440 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35441 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
35442 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
35443 return tag_ptr(ret_conv, true);
35446 int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) {
35447 LDKClosingTransaction this_arg_conv;
35448 this_arg_conv.inner = untag_ptr(this_arg);
35449 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35450 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35451 this_arg_conv.is_owned = false;
35452 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
35456 int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) {
35457 LDKClosingTransaction this_arg_conv;
35458 this_arg_conv.inner = untag_ptr(this_arg);
35459 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35461 this_arg_conv.is_owned = false;
35462 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
35466 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) {
35467 LDKClosingTransaction this_arg_conv;
35468 this_arg_conv.inner = untag_ptr(this_arg);
35469 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35471 this_arg_conv.is_owned = false;
35472 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
35473 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35474 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35478 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) {
35479 LDKClosingTransaction this_arg_conv;
35480 this_arg_conv.inner = untag_ptr(this_arg);
35481 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35483 this_arg_conv.is_owned = false;
35484 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
35485 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35486 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35490 void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) {
35491 LDKTrustedClosingTransaction this_obj_conv;
35492 this_obj_conv.inner = untag_ptr(this_obj);
35493 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35495 TrustedClosingTransaction_free(this_obj_conv);
35498 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) {
35499 LDKTrustedClosingTransaction this_arg_conv;
35500 this_arg_conv.inner = untag_ptr(this_arg);
35501 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35503 this_arg_conv.is_owned = false;
35504 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
35505 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35506 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35507 Transaction_free(ret_var);
35511 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) {
35512 LDKTrustedClosingTransaction this_arg_conv;
35513 this_arg_conv.inner = untag_ptr(this_arg);
35514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35516 this_arg_conv.is_owned = false;
35517 LDKu8slice funding_redeemscript_ref;
35518 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35519 funding_redeemscript_ref.data = funding_redeemscript->elems;
35520 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35521 memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35522 FREE(funding_redeemscript);
35526 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) {
35527 LDKTrustedClosingTransaction this_arg_conv;
35528 this_arg_conv.inner = untag_ptr(this_arg);
35529 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35531 this_arg_conv.is_owned = false;
35532 unsigned char funding_key_arr[32];
35533 CHECK(funding_key->arr_len == 32);
35534 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35535 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35536 LDKu8slice funding_redeemscript_ref;
35537 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35538 funding_redeemscript_ref.data = funding_redeemscript->elems;
35539 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35540 memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35541 FREE(funding_redeemscript);
35545 void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) {
35546 LDKCommitmentTransaction this_obj_conv;
35547 this_obj_conv.inner = untag_ptr(this_obj);
35548 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35550 CommitmentTransaction_free(this_obj_conv);
35553 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
35554 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
35555 uint64_t ret_ref = 0;
35556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35560 int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) {
35561 LDKCommitmentTransaction arg_conv;
35562 arg_conv.inner = untag_ptr(arg);
35563 arg_conv.is_owned = ptr_is_owned(arg);
35564 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35565 arg_conv.is_owned = false;
35566 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
35570 uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) {
35571 LDKCommitmentTransaction orig_conv;
35572 orig_conv.inner = untag_ptr(orig);
35573 orig_conv.is_owned = ptr_is_owned(orig);
35574 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35575 orig_conv.is_owned = false;
35576 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
35577 uint64_t ret_ref = 0;
35578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35583 int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) {
35584 LDKCommitmentTransaction obj_conv;
35585 obj_conv.inner = untag_ptr(obj);
35586 obj_conv.is_owned = ptr_is_owned(obj);
35587 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35588 obj_conv.is_owned = false;
35589 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
35590 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35591 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35592 CVec_u8Z_free(ret_var);
35596 uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
35597 LDKu8slice ser_ref;
35598 ser_ref.datalen = ser->arr_len;
35599 ser_ref.data = ser->elems;
35600 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
35601 *ret_conv = CommitmentTransaction_read(ser_ref);
35603 return tag_ptr(ret_conv, true);
35606 int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) {
35607 LDKCommitmentTransaction this_arg_conv;
35608 this_arg_conv.inner = untag_ptr(this_arg);
35609 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35611 this_arg_conv.is_owned = false;
35612 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
35616 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) {
35617 LDKCommitmentTransaction this_arg_conv;
35618 this_arg_conv.inner = untag_ptr(this_arg);
35619 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35621 this_arg_conv.is_owned = false;
35622 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
35626 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) {
35627 LDKCommitmentTransaction this_arg_conv;
35628 this_arg_conv.inner = untag_ptr(this_arg);
35629 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35631 this_arg_conv.is_owned = false;
35632 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
35636 int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) {
35637 LDKCommitmentTransaction this_arg_conv;
35638 this_arg_conv.inner = untag_ptr(this_arg);
35639 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35641 this_arg_conv.is_owned = false;
35642 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
35646 uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) {
35647 LDKCommitmentTransaction this_arg_conv;
35648 this_arg_conv.inner = untag_ptr(this_arg);
35649 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35651 this_arg_conv.is_owned = false;
35652 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
35653 uint64_t ret_ref = 0;
35654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35659 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) {
35660 LDKCommitmentTransaction this_arg_conv;
35661 this_arg_conv.inner = untag_ptr(this_arg);
35662 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35664 this_arg_conv.is_owned = false;
35665 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35666 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35667 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35668 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35669 channel_parameters_conv.is_owned = false;
35670 LDKChannelPublicKeys broadcaster_keys_conv;
35671 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
35672 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
35673 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
35674 broadcaster_keys_conv.is_owned = false;
35675 LDKChannelPublicKeys countersignatory_keys_conv;
35676 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
35677 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
35678 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
35679 countersignatory_keys_conv.is_owned = false;
35680 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
35681 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
35682 return tag_ptr(ret_conv, true);
35685 void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) {
35686 LDKTrustedCommitmentTransaction this_obj_conv;
35687 this_obj_conv.inner = untag_ptr(this_obj);
35688 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35690 TrustedCommitmentTransaction_free(this_obj_conv);
35693 int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) {
35694 LDKTrustedCommitmentTransaction this_arg_conv;
35695 this_arg_conv.inner = untag_ptr(this_arg);
35696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35698 this_arg_conv.is_owned = false;
35699 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35700 memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
35704 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) {
35705 LDKTrustedCommitmentTransaction this_arg_conv;
35706 this_arg_conv.inner = untag_ptr(this_arg);
35707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35709 this_arg_conv.is_owned = false;
35710 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
35711 uint64_t ret_ref = 0;
35712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35717 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) {
35718 LDKTrustedCommitmentTransaction this_arg_conv;
35719 this_arg_conv.inner = untag_ptr(this_arg);
35720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35722 this_arg_conv.is_owned = false;
35723 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
35724 uint64_t ret_ref = 0;
35725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35730 jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) {
35731 LDKTrustedCommitmentTransaction this_arg_conv;
35732 this_arg_conv.inner = untag_ptr(this_arg);
35733 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35735 this_arg_conv.is_owned = false;
35736 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
35740 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) {
35741 LDKTrustedCommitmentTransaction this_arg_conv;
35742 this_arg_conv.inner = untag_ptr(this_arg);
35743 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35745 this_arg_conv.is_owned = false;
35746 unsigned char htlc_base_key_arr[32];
35747 CHECK(htlc_base_key->arr_len == 32);
35748 memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
35749 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
35750 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35751 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35752 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35753 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35754 channel_parameters_conv.is_owned = false;
35755 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
35756 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
35757 return tag_ptr(ret_conv, true);
35760 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) {
35761 LDKPublicKey broadcaster_payment_basepoint_ref;
35762 CHECK(broadcaster_payment_basepoint->arr_len == 33);
35763 memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint);
35764 LDKPublicKey countersignatory_payment_basepoint_ref;
35765 CHECK(countersignatory_payment_basepoint->arr_len == 33);
35766 memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint);
35767 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
35771 jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) {
35772 LDKInitFeatures a_conv;
35773 a_conv.inner = untag_ptr(a);
35774 a_conv.is_owned = ptr_is_owned(a);
35775 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35776 a_conv.is_owned = false;
35777 LDKInitFeatures b_conv;
35778 b_conv.inner = untag_ptr(b);
35779 b_conv.is_owned = ptr_is_owned(b);
35780 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35781 b_conv.is_owned = false;
35782 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
35786 jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) {
35787 LDKNodeFeatures a_conv;
35788 a_conv.inner = untag_ptr(a);
35789 a_conv.is_owned = ptr_is_owned(a);
35790 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35791 a_conv.is_owned = false;
35792 LDKNodeFeatures b_conv;
35793 b_conv.inner = untag_ptr(b);
35794 b_conv.is_owned = ptr_is_owned(b);
35795 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35796 b_conv.is_owned = false;
35797 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
35801 jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) {
35802 LDKChannelFeatures a_conv;
35803 a_conv.inner = untag_ptr(a);
35804 a_conv.is_owned = ptr_is_owned(a);
35805 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35806 a_conv.is_owned = false;
35807 LDKChannelFeatures b_conv;
35808 b_conv.inner = untag_ptr(b);
35809 b_conv.is_owned = ptr_is_owned(b);
35810 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35811 b_conv.is_owned = false;
35812 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
35816 jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) {
35817 LDKInvoiceFeatures a_conv;
35818 a_conv.inner = untag_ptr(a);
35819 a_conv.is_owned = ptr_is_owned(a);
35820 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35821 a_conv.is_owned = false;
35822 LDKInvoiceFeatures b_conv;
35823 b_conv.inner = untag_ptr(b);
35824 b_conv.is_owned = ptr_is_owned(b);
35825 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35826 b_conv.is_owned = false;
35827 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
35831 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
35832 LDKChannelTypeFeatures a_conv;
35833 a_conv.inner = untag_ptr(a);
35834 a_conv.is_owned = ptr_is_owned(a);
35835 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35836 a_conv.is_owned = false;
35837 LDKChannelTypeFeatures b_conv;
35838 b_conv.inner = untag_ptr(b);
35839 b_conv.is_owned = ptr_is_owned(b);
35840 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35841 b_conv.is_owned = false;
35842 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
35846 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
35847 LDKInitFeatures ret_var = InitFeatures_clone(arg);
35848 uint64_t ret_ref = 0;
35849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35853 int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) {
35854 LDKInitFeatures arg_conv;
35855 arg_conv.inner = untag_ptr(arg);
35856 arg_conv.is_owned = ptr_is_owned(arg);
35857 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35858 arg_conv.is_owned = false;
35859 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
35863 uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) {
35864 LDKInitFeatures orig_conv;
35865 orig_conv.inner = untag_ptr(orig);
35866 orig_conv.is_owned = ptr_is_owned(orig);
35867 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35868 orig_conv.is_owned = false;
35869 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
35870 uint64_t ret_ref = 0;
35871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35876 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
35877 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
35878 uint64_t ret_ref = 0;
35879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35883 int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) {
35884 LDKNodeFeatures arg_conv;
35885 arg_conv.inner = untag_ptr(arg);
35886 arg_conv.is_owned = ptr_is_owned(arg);
35887 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35888 arg_conv.is_owned = false;
35889 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
35893 uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) {
35894 LDKNodeFeatures orig_conv;
35895 orig_conv.inner = untag_ptr(orig);
35896 orig_conv.is_owned = ptr_is_owned(orig);
35897 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35898 orig_conv.is_owned = false;
35899 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
35900 uint64_t ret_ref = 0;
35901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35902 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35906 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
35907 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
35908 uint64_t ret_ref = 0;
35909 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35910 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35913 int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) {
35914 LDKChannelFeatures arg_conv;
35915 arg_conv.inner = untag_ptr(arg);
35916 arg_conv.is_owned = ptr_is_owned(arg);
35917 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35918 arg_conv.is_owned = false;
35919 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
35923 uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) {
35924 LDKChannelFeatures orig_conv;
35925 orig_conv.inner = untag_ptr(orig);
35926 orig_conv.is_owned = ptr_is_owned(orig);
35927 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35928 orig_conv.is_owned = false;
35929 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
35930 uint64_t ret_ref = 0;
35931 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35932 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35936 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
35937 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
35938 uint64_t ret_ref = 0;
35939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35943 int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) {
35944 LDKInvoiceFeatures arg_conv;
35945 arg_conv.inner = untag_ptr(arg);
35946 arg_conv.is_owned = ptr_is_owned(arg);
35947 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35948 arg_conv.is_owned = false;
35949 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
35953 uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) {
35954 LDKInvoiceFeatures orig_conv;
35955 orig_conv.inner = untag_ptr(orig);
35956 orig_conv.is_owned = ptr_is_owned(orig);
35957 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35958 orig_conv.is_owned = false;
35959 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
35960 uint64_t ret_ref = 0;
35961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35966 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
35967 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
35968 uint64_t ret_ref = 0;
35969 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35970 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35973 int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) {
35974 LDKChannelTypeFeatures arg_conv;
35975 arg_conv.inner = untag_ptr(arg);
35976 arg_conv.is_owned = ptr_is_owned(arg);
35977 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35978 arg_conv.is_owned = false;
35979 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
35983 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) {
35984 LDKChannelTypeFeatures orig_conv;
35985 orig_conv.inner = untag_ptr(orig);
35986 orig_conv.is_owned = ptr_is_owned(orig);
35987 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35988 orig_conv.is_owned = false;
35989 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
35990 uint64_t ret_ref = 0;
35991 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35992 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35996 void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) {
35997 LDKInitFeatures this_obj_conv;
35998 this_obj_conv.inner = untag_ptr(this_obj);
35999 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36001 InitFeatures_free(this_obj_conv);
36004 void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) {
36005 LDKNodeFeatures this_obj_conv;
36006 this_obj_conv.inner = untag_ptr(this_obj);
36007 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36009 NodeFeatures_free(this_obj_conv);
36012 void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) {
36013 LDKChannelFeatures this_obj_conv;
36014 this_obj_conv.inner = untag_ptr(this_obj);
36015 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36017 ChannelFeatures_free(this_obj_conv);
36020 void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) {
36021 LDKInvoiceFeatures this_obj_conv;
36022 this_obj_conv.inner = untag_ptr(this_obj);
36023 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36025 InvoiceFeatures_free(this_obj_conv);
36028 void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
36029 LDKChannelTypeFeatures this_obj_conv;
36030 this_obj_conv.inner = untag_ptr(this_obj);
36031 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36033 ChannelTypeFeatures_free(this_obj_conv);
36036 uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() {
36037 LDKInitFeatures ret_var = InitFeatures_empty();
36038 uint64_t ret_ref = 0;
36039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36044 uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() {
36045 LDKInitFeatures ret_var = InitFeatures_known();
36046 uint64_t ret_ref = 0;
36047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36052 jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
36053 LDKInitFeatures this_arg_conv;
36054 this_arg_conv.inner = untag_ptr(this_arg);
36055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36057 this_arg_conv.is_owned = false;
36058 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
36062 uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() {
36063 LDKNodeFeatures ret_var = NodeFeatures_empty();
36064 uint64_t ret_ref = 0;
36065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36070 uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() {
36071 LDKNodeFeatures ret_var = NodeFeatures_known();
36072 uint64_t ret_ref = 0;
36073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36078 jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
36079 LDKNodeFeatures this_arg_conv;
36080 this_arg_conv.inner = untag_ptr(this_arg);
36081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36083 this_arg_conv.is_owned = false;
36084 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
36088 uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
36089 LDKChannelFeatures ret_var = ChannelFeatures_empty();
36090 uint64_t ret_ref = 0;
36091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36096 uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() {
36097 LDKChannelFeatures ret_var = ChannelFeatures_known();
36098 uint64_t ret_ref = 0;
36099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36104 jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
36105 LDKChannelFeatures this_arg_conv;
36106 this_arg_conv.inner = untag_ptr(this_arg);
36107 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36109 this_arg_conv.is_owned = false;
36110 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
36114 uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
36115 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
36116 uint64_t ret_ref = 0;
36117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36122 uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() {
36123 LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
36124 uint64_t ret_ref = 0;
36125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36130 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
36131 LDKInvoiceFeatures this_arg_conv;
36132 this_arg_conv.inner = untag_ptr(this_arg);
36133 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36135 this_arg_conv.is_owned = false;
36136 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
36140 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
36141 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
36142 uint64_t ret_ref = 0;
36143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36148 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() {
36149 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
36150 uint64_t ret_ref = 0;
36151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36156 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) {
36157 LDKChannelTypeFeatures this_arg_conv;
36158 this_arg_conv.inner = untag_ptr(this_arg);
36159 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36161 this_arg_conv.is_owned = false;
36162 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
36166 int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) {
36167 LDKInitFeatures obj_conv;
36168 obj_conv.inner = untag_ptr(obj);
36169 obj_conv.is_owned = ptr_is_owned(obj);
36170 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36171 obj_conv.is_owned = false;
36172 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
36173 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36174 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36175 CVec_u8Z_free(ret_var);
36179 uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
36180 LDKu8slice ser_ref;
36181 ser_ref.datalen = ser->arr_len;
36182 ser_ref.data = ser->elems;
36183 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
36184 *ret_conv = InitFeatures_read(ser_ref);
36186 return tag_ptr(ret_conv, true);
36189 int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) {
36190 LDKChannelFeatures obj_conv;
36191 obj_conv.inner = untag_ptr(obj);
36192 obj_conv.is_owned = ptr_is_owned(obj);
36193 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36194 obj_conv.is_owned = false;
36195 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
36196 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36197 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36198 CVec_u8Z_free(ret_var);
36202 uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
36203 LDKu8slice ser_ref;
36204 ser_ref.datalen = ser->arr_len;
36205 ser_ref.data = ser->elems;
36206 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
36207 *ret_conv = ChannelFeatures_read(ser_ref);
36209 return tag_ptr(ret_conv, true);
36212 int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) {
36213 LDKNodeFeatures obj_conv;
36214 obj_conv.inner = untag_ptr(obj);
36215 obj_conv.is_owned = ptr_is_owned(obj);
36216 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36217 obj_conv.is_owned = false;
36218 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
36219 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36220 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36221 CVec_u8Z_free(ret_var);
36225 uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
36226 LDKu8slice ser_ref;
36227 ser_ref.datalen = ser->arr_len;
36228 ser_ref.data = ser->elems;
36229 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
36230 *ret_conv = NodeFeatures_read(ser_ref);
36232 return tag_ptr(ret_conv, true);
36235 int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) {
36236 LDKInvoiceFeatures obj_conv;
36237 obj_conv.inner = untag_ptr(obj);
36238 obj_conv.is_owned = ptr_is_owned(obj);
36239 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36240 obj_conv.is_owned = false;
36241 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
36242 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36243 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36244 CVec_u8Z_free(ret_var);
36248 uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
36249 LDKu8slice ser_ref;
36250 ser_ref.datalen = ser->arr_len;
36251 ser_ref.data = ser->elems;
36252 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
36253 *ret_conv = InvoiceFeatures_read(ser_ref);
36255 return tag_ptr(ret_conv, true);
36258 int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
36259 LDKChannelTypeFeatures obj_conv;
36260 obj_conv.inner = untag_ptr(obj);
36261 obj_conv.is_owned = ptr_is_owned(obj);
36262 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36263 obj_conv.is_owned = false;
36264 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
36265 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36266 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36267 CVec_u8Z_free(ret_var);
36271 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
36272 LDKu8slice ser_ref;
36273 ser_ref.datalen = ser->arr_len;
36274 ser_ref.data = ser->elems;
36275 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
36276 *ret_conv = ChannelTypeFeatures_read(ser_ref);
36278 return tag_ptr(ret_conv, true);
36281 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36282 LDKInitFeatures this_arg_conv;
36283 this_arg_conv.inner = untag_ptr(this_arg);
36284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36286 this_arg_conv.is_owned = false;
36287 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
36290 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36291 LDKInitFeatures this_arg_conv;
36292 this_arg_conv.inner = untag_ptr(this_arg);
36293 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36295 this_arg_conv.is_owned = false;
36296 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
36299 jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(uint64_t this_arg) {
36300 LDKInitFeatures this_arg_conv;
36301 this_arg_conv.inner = untag_ptr(this_arg);
36302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36304 this_arg_conv.is_owned = false;
36305 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
36309 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36310 LDKNodeFeatures this_arg_conv;
36311 this_arg_conv.inner = untag_ptr(this_arg);
36312 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36314 this_arg_conv.is_owned = false;
36315 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
36318 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36319 LDKNodeFeatures this_arg_conv;
36320 this_arg_conv.inner = untag_ptr(this_arg);
36321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36323 this_arg_conv.is_owned = false;
36324 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
36327 jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(uint64_t this_arg) {
36328 LDKNodeFeatures 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 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
36337 jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(uint64_t this_arg) {
36338 LDKInitFeatures 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 = InitFeatures_requires_data_loss_protect(&this_arg_conv);
36347 jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(uint64_t this_arg) {
36348 LDKNodeFeatures 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 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
36357 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_optional(uint64_t this_arg) {
36358 LDKInitFeatures this_arg_conv;
36359 this_arg_conv.inner = untag_ptr(this_arg);
36360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36362 this_arg_conv.is_owned = false;
36363 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
36366 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_required(uint64_t this_arg) {
36367 LDKInitFeatures this_arg_conv;
36368 this_arg_conv.inner = untag_ptr(this_arg);
36369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36371 this_arg_conv.is_owned = false;
36372 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
36375 jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(uint64_t this_arg) {
36376 LDKInitFeatures this_arg_conv;
36377 this_arg_conv.inner = untag_ptr(this_arg);
36378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36380 this_arg_conv.is_owned = false;
36381 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
36385 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36386 LDKInitFeatures this_arg_conv;
36387 this_arg_conv.inner = untag_ptr(this_arg);
36388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36390 this_arg_conv.is_owned = false;
36391 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36394 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36395 LDKInitFeatures this_arg_conv;
36396 this_arg_conv.inner = untag_ptr(this_arg);
36397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36399 this_arg_conv.is_owned = false;
36400 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36403 jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36404 LDKInitFeatures this_arg_conv;
36405 this_arg_conv.inner = untag_ptr(this_arg);
36406 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36408 this_arg_conv.is_owned = false;
36409 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36413 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36414 LDKNodeFeatures this_arg_conv;
36415 this_arg_conv.inner = untag_ptr(this_arg);
36416 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36418 this_arg_conv.is_owned = false;
36419 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36422 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36423 LDKNodeFeatures this_arg_conv;
36424 this_arg_conv.inner = untag_ptr(this_arg);
36425 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36427 this_arg_conv.is_owned = false;
36428 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36431 jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36432 LDKNodeFeatures this_arg_conv;
36433 this_arg_conv.inner = untag_ptr(this_arg);
36434 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36436 this_arg_conv.is_owned = false;
36437 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36441 jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36442 LDKInitFeatures this_arg_conv;
36443 this_arg_conv.inner = untag_ptr(this_arg);
36444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36446 this_arg_conv.is_owned = false;
36447 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36451 jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36452 LDKNodeFeatures this_arg_conv;
36453 this_arg_conv.inner = untag_ptr(this_arg);
36454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36456 this_arg_conv.is_owned = false;
36457 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36461 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36462 LDKInitFeatures this_arg_conv;
36463 this_arg_conv.inner = untag_ptr(this_arg);
36464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36466 this_arg_conv.is_owned = false;
36467 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
36470 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) {
36471 LDKInitFeatures this_arg_conv;
36472 this_arg_conv.inner = untag_ptr(this_arg);
36473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36475 this_arg_conv.is_owned = false;
36476 InitFeatures_set_gossip_queries_required(&this_arg_conv);
36479 jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) {
36480 LDKInitFeatures this_arg_conv;
36481 this_arg_conv.inner = untag_ptr(this_arg);
36482 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36484 this_arg_conv.is_owned = false;
36485 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
36489 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36490 LDKNodeFeatures this_arg_conv;
36491 this_arg_conv.inner = untag_ptr(this_arg);
36492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36494 this_arg_conv.is_owned = false;
36495 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
36498 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) {
36499 LDKNodeFeatures this_arg_conv;
36500 this_arg_conv.inner = untag_ptr(this_arg);
36501 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36503 this_arg_conv.is_owned = false;
36504 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
36507 jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) {
36508 LDKNodeFeatures this_arg_conv;
36509 this_arg_conv.inner = untag_ptr(this_arg);
36510 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36512 this_arg_conv.is_owned = false;
36513 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
36517 jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) {
36518 LDKInitFeatures this_arg_conv;
36519 this_arg_conv.inner = untag_ptr(this_arg);
36520 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36522 this_arg_conv.is_owned = false;
36523 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
36527 jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) {
36528 LDKNodeFeatures this_arg_conv;
36529 this_arg_conv.inner = untag_ptr(this_arg);
36530 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36532 this_arg_conv.is_owned = false;
36533 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
36537 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36538 LDKInitFeatures this_arg_conv;
36539 this_arg_conv.inner = untag_ptr(this_arg);
36540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36542 this_arg_conv.is_owned = false;
36543 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
36546 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36547 LDKInitFeatures this_arg_conv;
36548 this_arg_conv.inner = untag_ptr(this_arg);
36549 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36551 this_arg_conv.is_owned = false;
36552 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
36555 jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) {
36556 LDKInitFeatures this_arg_conv;
36557 this_arg_conv.inner = untag_ptr(this_arg);
36558 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36560 this_arg_conv.is_owned = false;
36561 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
36565 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36566 LDKNodeFeatures this_arg_conv;
36567 this_arg_conv.inner = untag_ptr(this_arg);
36568 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36570 this_arg_conv.is_owned = false;
36571 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
36574 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36575 LDKNodeFeatures this_arg_conv;
36576 this_arg_conv.inner = untag_ptr(this_arg);
36577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36579 this_arg_conv.is_owned = false;
36580 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
36583 jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) {
36584 LDKNodeFeatures this_arg_conv;
36585 this_arg_conv.inner = untag_ptr(this_arg);
36586 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36588 this_arg_conv.is_owned = false;
36589 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
36593 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36594 LDKInvoiceFeatures this_arg_conv;
36595 this_arg_conv.inner = untag_ptr(this_arg);
36596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36598 this_arg_conv.is_owned = false;
36599 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
36602 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36603 LDKInvoiceFeatures this_arg_conv;
36604 this_arg_conv.inner = untag_ptr(this_arg);
36605 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36607 this_arg_conv.is_owned = false;
36608 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
36611 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) {
36612 LDKInvoiceFeatures this_arg_conv;
36613 this_arg_conv.inner = untag_ptr(this_arg);
36614 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36616 this_arg_conv.is_owned = false;
36617 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
36621 jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) {
36622 LDKInitFeatures this_arg_conv;
36623 this_arg_conv.inner = untag_ptr(this_arg);
36624 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36626 this_arg_conv.is_owned = false;
36627 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
36631 jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) {
36632 LDKNodeFeatures this_arg_conv;
36633 this_arg_conv.inner = untag_ptr(this_arg);
36634 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36636 this_arg_conv.is_owned = false;
36637 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
36641 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) {
36642 LDKInvoiceFeatures this_arg_conv;
36643 this_arg_conv.inner = untag_ptr(this_arg);
36644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36646 this_arg_conv.is_owned = false;
36647 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
36651 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36652 LDKInitFeatures this_arg_conv;
36653 this_arg_conv.inner = untag_ptr(this_arg);
36654 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36656 this_arg_conv.is_owned = false;
36657 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
36660 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) {
36661 LDKInitFeatures this_arg_conv;
36662 this_arg_conv.inner = untag_ptr(this_arg);
36663 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36665 this_arg_conv.is_owned = false;
36666 InitFeatures_set_static_remote_key_required(&this_arg_conv);
36669 jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) {
36670 LDKInitFeatures this_arg_conv;
36671 this_arg_conv.inner = untag_ptr(this_arg);
36672 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36674 this_arg_conv.is_owned = false;
36675 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
36679 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36680 LDKNodeFeatures this_arg_conv;
36681 this_arg_conv.inner = untag_ptr(this_arg);
36682 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36684 this_arg_conv.is_owned = false;
36685 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
36688 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36689 LDKNodeFeatures this_arg_conv;
36690 this_arg_conv.inner = untag_ptr(this_arg);
36691 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36693 this_arg_conv.is_owned = false;
36694 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
36697 jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) {
36698 LDKNodeFeatures this_arg_conv;
36699 this_arg_conv.inner = untag_ptr(this_arg);
36700 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36702 this_arg_conv.is_owned = false;
36703 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
36707 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36708 LDKChannelTypeFeatures this_arg_conv;
36709 this_arg_conv.inner = untag_ptr(this_arg);
36710 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36712 this_arg_conv.is_owned = false;
36713 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
36716 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36717 LDKChannelTypeFeatures this_arg_conv;
36718 this_arg_conv.inner = untag_ptr(this_arg);
36719 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36721 this_arg_conv.is_owned = false;
36722 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
36725 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) {
36726 LDKChannelTypeFeatures this_arg_conv;
36727 this_arg_conv.inner = untag_ptr(this_arg);
36728 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36730 this_arg_conv.is_owned = false;
36731 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
36735 jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) {
36736 LDKInitFeatures this_arg_conv;
36737 this_arg_conv.inner = untag_ptr(this_arg);
36738 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36740 this_arg_conv.is_owned = false;
36741 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
36745 jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(uint64_t this_arg) {
36746 LDKNodeFeatures this_arg_conv;
36747 this_arg_conv.inner = untag_ptr(this_arg);
36748 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36750 this_arg_conv.is_owned = false;
36751 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
36755 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(uint64_t this_arg) {
36756 LDKChannelTypeFeatures this_arg_conv;
36757 this_arg_conv.inner = untag_ptr(this_arg);
36758 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36760 this_arg_conv.is_owned = false;
36761 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
36765 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_optional(uint64_t this_arg) {
36766 LDKInitFeatures 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 InitFeatures_set_payment_secret_optional(&this_arg_conv);
36774 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) {
36775 LDKInitFeatures this_arg_conv;
36776 this_arg_conv.inner = untag_ptr(this_arg);
36777 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36779 this_arg_conv.is_owned = false;
36780 InitFeatures_set_payment_secret_required(&this_arg_conv);
36783 jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) {
36784 LDKInitFeatures this_arg_conv;
36785 this_arg_conv.inner = untag_ptr(this_arg);
36786 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36788 this_arg_conv.is_owned = false;
36789 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
36793 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_optional(uint64_t this_arg) {
36794 LDKNodeFeatures this_arg_conv;
36795 this_arg_conv.inner = untag_ptr(this_arg);
36796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36798 this_arg_conv.is_owned = false;
36799 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
36802 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) {
36803 LDKNodeFeatures this_arg_conv;
36804 this_arg_conv.inner = untag_ptr(this_arg);
36805 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36807 this_arg_conv.is_owned = false;
36808 NodeFeatures_set_payment_secret_required(&this_arg_conv);
36811 jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) {
36812 LDKNodeFeatures this_arg_conv;
36813 this_arg_conv.inner = untag_ptr(this_arg);
36814 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36816 this_arg_conv.is_owned = false;
36817 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
36821 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(uint64_t this_arg) {
36822 LDKInvoiceFeatures this_arg_conv;
36823 this_arg_conv.inner = untag_ptr(this_arg);
36824 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36826 this_arg_conv.is_owned = false;
36827 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
36830 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(uint64_t this_arg) {
36831 LDKInvoiceFeatures this_arg_conv;
36832 this_arg_conv.inner = untag_ptr(this_arg);
36833 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36835 this_arg_conv.is_owned = false;
36836 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
36839 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(uint64_t this_arg) {
36840 LDKInvoiceFeatures this_arg_conv;
36841 this_arg_conv.inner = untag_ptr(this_arg);
36842 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36844 this_arg_conv.is_owned = false;
36845 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
36849 jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(uint64_t this_arg) {
36850 LDKInitFeatures this_arg_conv;
36851 this_arg_conv.inner = untag_ptr(this_arg);
36852 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36854 this_arg_conv.is_owned = false;
36855 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
36859 jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(uint64_t this_arg) {
36860 LDKNodeFeatures 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 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
36869 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(uint64_t this_arg) {
36870 LDKInvoiceFeatures this_arg_conv;
36871 this_arg_conv.inner = untag_ptr(this_arg);
36872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36874 this_arg_conv.is_owned = false;
36875 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
36879 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36880 LDKInitFeatures this_arg_conv;
36881 this_arg_conv.inner = untag_ptr(this_arg);
36882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36884 this_arg_conv.is_owned = false;
36885 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
36888 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_required(uint64_t this_arg) {
36889 LDKInitFeatures this_arg_conv;
36890 this_arg_conv.inner = untag_ptr(this_arg);
36891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36893 this_arg_conv.is_owned = false;
36894 InitFeatures_set_basic_mpp_required(&this_arg_conv);
36897 jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(uint64_t this_arg) {
36898 LDKInitFeatures this_arg_conv;
36899 this_arg_conv.inner = untag_ptr(this_arg);
36900 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36902 this_arg_conv.is_owned = false;
36903 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
36907 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36908 LDKNodeFeatures this_arg_conv;
36909 this_arg_conv.inner = untag_ptr(this_arg);
36910 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36912 this_arg_conv.is_owned = false;
36913 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
36916 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_required(uint64_t this_arg) {
36917 LDKNodeFeatures this_arg_conv;
36918 this_arg_conv.inner = untag_ptr(this_arg);
36919 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36921 this_arg_conv.is_owned = false;
36922 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
36925 jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(uint64_t this_arg) {
36926 LDKNodeFeatures this_arg_conv;
36927 this_arg_conv.inner = untag_ptr(this_arg);
36928 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36929 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36930 this_arg_conv.is_owned = false;
36931 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
36935 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36936 LDKInvoiceFeatures this_arg_conv;
36937 this_arg_conv.inner = untag_ptr(this_arg);
36938 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36940 this_arg_conv.is_owned = false;
36941 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
36944 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
36945 LDKInvoiceFeatures this_arg_conv;
36946 this_arg_conv.inner = untag_ptr(this_arg);
36947 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36949 this_arg_conv.is_owned = false;
36950 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
36953 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
36954 LDKInvoiceFeatures this_arg_conv;
36955 this_arg_conv.inner = untag_ptr(this_arg);
36956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36958 this_arg_conv.is_owned = false;
36959 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
36963 jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
36964 LDKInitFeatures this_arg_conv;
36965 this_arg_conv.inner = untag_ptr(this_arg);
36966 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36968 this_arg_conv.is_owned = false;
36969 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
36973 jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(uint64_t this_arg) {
36974 LDKNodeFeatures this_arg_conv;
36975 this_arg_conv.inner = untag_ptr(this_arg);
36976 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36978 this_arg_conv.is_owned = false;
36979 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
36983 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
36984 LDKInvoiceFeatures this_arg_conv;
36985 this_arg_conv.inner = untag_ptr(this_arg);
36986 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36988 this_arg_conv.is_owned = false;
36989 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
36993 void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
36994 LDKInitFeatures this_arg_conv;
36995 this_arg_conv.inner = untag_ptr(this_arg);
36996 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36998 this_arg_conv.is_owned = false;
36999 InitFeatures_set_wumbo_optional(&this_arg_conv);
37002 void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_required(uint64_t this_arg) {
37003 LDKInitFeatures this_arg_conv;
37004 this_arg_conv.inner = untag_ptr(this_arg);
37005 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37007 this_arg_conv.is_owned = false;
37008 InitFeatures_set_wumbo_required(&this_arg_conv);
37011 jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(uint64_t this_arg) {
37012 LDKInitFeatures this_arg_conv;
37013 this_arg_conv.inner = untag_ptr(this_arg);
37014 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37016 this_arg_conv.is_owned = false;
37017 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
37021 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_optional(uint64_t this_arg) {
37022 LDKNodeFeatures this_arg_conv;
37023 this_arg_conv.inner = untag_ptr(this_arg);
37024 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37026 this_arg_conv.is_owned = false;
37027 NodeFeatures_set_wumbo_optional(&this_arg_conv);
37030 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_required(uint64_t this_arg) {
37031 LDKNodeFeatures this_arg_conv;
37032 this_arg_conv.inner = untag_ptr(this_arg);
37033 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37035 this_arg_conv.is_owned = false;
37036 NodeFeatures_set_wumbo_required(&this_arg_conv);
37039 jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(uint64_t this_arg) {
37040 LDKNodeFeatures this_arg_conv;
37041 this_arg_conv.inner = untag_ptr(this_arg);
37042 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37043 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37044 this_arg_conv.is_owned = false;
37045 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
37049 jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(uint64_t this_arg) {
37050 LDKInitFeatures this_arg_conv;
37051 this_arg_conv.inner = untag_ptr(this_arg);
37052 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37054 this_arg_conv.is_owned = false;
37055 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
37059 jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(uint64_t this_arg) {
37060 LDKNodeFeatures this_arg_conv;
37061 this_arg_conv.inner = untag_ptr(this_arg);
37062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37064 this_arg_conv.is_owned = false;
37065 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
37069 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
37070 LDKInitFeatures this_arg_conv;
37071 this_arg_conv.inner = untag_ptr(this_arg);
37072 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37074 this_arg_conv.is_owned = false;
37075 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
37078 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
37079 LDKInitFeatures 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 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
37087 jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
37088 LDKInitFeatures this_arg_conv;
37089 this_arg_conv.inner = untag_ptr(this_arg);
37090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37092 this_arg_conv.is_owned = false;
37093 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
37097 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
37098 LDKNodeFeatures this_arg_conv;
37099 this_arg_conv.inner = untag_ptr(this_arg);
37100 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37102 this_arg_conv.is_owned = false;
37103 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
37106 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
37107 LDKNodeFeatures this_arg_conv;
37108 this_arg_conv.inner = untag_ptr(this_arg);
37109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37111 this_arg_conv.is_owned = false;
37112 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
37115 jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
37116 LDKNodeFeatures this_arg_conv;
37117 this_arg_conv.inner = untag_ptr(this_arg);
37118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37120 this_arg_conv.is_owned = false;
37121 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
37125 jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
37126 LDKInitFeatures this_arg_conv;
37127 this_arg_conv.inner = untag_ptr(this_arg);
37128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37130 this_arg_conv.is_owned = false;
37131 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
37135 jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
37136 LDKNodeFeatures this_arg_conv;
37137 this_arg_conv.inner = untag_ptr(this_arg);
37138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37140 this_arg_conv.is_owned = false;
37141 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
37145 void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
37146 LDKInitFeatures this_arg_conv;
37147 this_arg_conv.inner = untag_ptr(this_arg);
37148 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37150 this_arg_conv.is_owned = false;
37151 InitFeatures_set_channel_type_optional(&this_arg_conv);
37154 void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_required(uint64_t this_arg) {
37155 LDKInitFeatures this_arg_conv;
37156 this_arg_conv.inner = untag_ptr(this_arg);
37157 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37159 this_arg_conv.is_owned = false;
37160 InitFeatures_set_channel_type_required(&this_arg_conv);
37163 jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(uint64_t this_arg) {
37164 LDKInitFeatures this_arg_conv;
37165 this_arg_conv.inner = untag_ptr(this_arg);
37166 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37168 this_arg_conv.is_owned = false;
37169 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
37173 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_optional(uint64_t this_arg) {
37174 LDKNodeFeatures this_arg_conv;
37175 this_arg_conv.inner = untag_ptr(this_arg);
37176 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37178 this_arg_conv.is_owned = false;
37179 NodeFeatures_set_channel_type_optional(&this_arg_conv);
37182 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_required(uint64_t this_arg) {
37183 LDKNodeFeatures this_arg_conv;
37184 this_arg_conv.inner = untag_ptr(this_arg);
37185 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37187 this_arg_conv.is_owned = false;
37188 NodeFeatures_set_channel_type_required(&this_arg_conv);
37191 jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) {
37192 LDKNodeFeatures this_arg_conv;
37193 this_arg_conv.inner = untag_ptr(this_arg);
37194 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37196 this_arg_conv.is_owned = false;
37197 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
37201 jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) {
37202 LDKInitFeatures this_arg_conv;
37203 this_arg_conv.inner = untag_ptr(this_arg);
37204 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37206 this_arg_conv.is_owned = false;
37207 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
37211 jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) {
37212 LDKNodeFeatures this_arg_conv;
37213 this_arg_conv.inner = untag_ptr(this_arg);
37214 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37216 this_arg_conv.is_owned = false;
37217 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
37221 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37222 LDKInitFeatures this_arg_conv;
37223 this_arg_conv.inner = untag_ptr(this_arg);
37224 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37226 this_arg_conv.is_owned = false;
37227 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
37230 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_required(uint64_t this_arg) {
37231 LDKInitFeatures this_arg_conv;
37232 this_arg_conv.inner = untag_ptr(this_arg);
37233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37235 this_arg_conv.is_owned = false;
37236 InitFeatures_set_scid_privacy_required(&this_arg_conv);
37239 jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(uint64_t this_arg) {
37240 LDKInitFeatures this_arg_conv;
37241 this_arg_conv.inner = untag_ptr(this_arg);
37242 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37244 this_arg_conv.is_owned = false;
37245 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
37249 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37250 LDKNodeFeatures this_arg_conv;
37251 this_arg_conv.inner = untag_ptr(this_arg);
37252 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37254 this_arg_conv.is_owned = false;
37255 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
37258 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37259 LDKNodeFeatures this_arg_conv;
37260 this_arg_conv.inner = untag_ptr(this_arg);
37261 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37263 this_arg_conv.is_owned = false;
37264 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
37267 jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(uint64_t this_arg) {
37268 LDKNodeFeatures this_arg_conv;
37269 this_arg_conv.inner = untag_ptr(this_arg);
37270 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37272 this_arg_conv.is_owned = false;
37273 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
37277 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37278 LDKChannelTypeFeatures this_arg_conv;
37279 this_arg_conv.inner = untag_ptr(this_arg);
37280 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37282 this_arg_conv.is_owned = false;
37283 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
37286 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37287 LDKChannelTypeFeatures this_arg_conv;
37288 this_arg_conv.inner = untag_ptr(this_arg);
37289 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37291 this_arg_conv.is_owned = false;
37292 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
37295 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(uint64_t this_arg) {
37296 LDKChannelTypeFeatures this_arg_conv;
37297 this_arg_conv.inner = untag_ptr(this_arg);
37298 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37300 this_arg_conv.is_owned = false;
37301 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
37305 jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(uint64_t this_arg) {
37306 LDKInitFeatures this_arg_conv;
37307 this_arg_conv.inner = untag_ptr(this_arg);
37308 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37310 this_arg_conv.is_owned = false;
37311 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
37315 jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(uint64_t this_arg) {
37316 LDKNodeFeatures this_arg_conv;
37317 this_arg_conv.inner = untag_ptr(this_arg);
37318 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37320 this_arg_conv.is_owned = false;
37321 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
37325 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(uint64_t this_arg) {
37326 LDKChannelTypeFeatures this_arg_conv;
37327 this_arg_conv.inner = untag_ptr(this_arg);
37328 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37330 this_arg_conv.is_owned = false;
37331 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
37335 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_optional(uint64_t this_arg) {
37336 LDKInitFeatures this_arg_conv;
37337 this_arg_conv.inner = untag_ptr(this_arg);
37338 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37340 this_arg_conv.is_owned = false;
37341 InitFeatures_set_zero_conf_optional(&this_arg_conv);
37344 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_required(uint64_t this_arg) {
37345 LDKInitFeatures this_arg_conv;
37346 this_arg_conv.inner = untag_ptr(this_arg);
37347 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37349 this_arg_conv.is_owned = false;
37350 InitFeatures_set_zero_conf_required(&this_arg_conv);
37353 jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) {
37354 LDKInitFeatures this_arg_conv;
37355 this_arg_conv.inner = untag_ptr(this_arg);
37356 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37358 this_arg_conv.is_owned = false;
37359 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
37363 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37364 LDKNodeFeatures this_arg_conv;
37365 this_arg_conv.inner = untag_ptr(this_arg);
37366 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37368 this_arg_conv.is_owned = false;
37369 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
37372 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_required(uint64_t this_arg) {
37373 LDKNodeFeatures this_arg_conv;
37374 this_arg_conv.inner = untag_ptr(this_arg);
37375 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37377 this_arg_conv.is_owned = false;
37378 NodeFeatures_set_zero_conf_required(&this_arg_conv);
37381 jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) {
37382 LDKNodeFeatures this_arg_conv;
37383 this_arg_conv.inner = untag_ptr(this_arg);
37384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37386 this_arg_conv.is_owned = false;
37387 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
37391 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37392 LDKChannelTypeFeatures this_arg_conv;
37393 this_arg_conv.inner = untag_ptr(this_arg);
37394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37396 this_arg_conv.is_owned = false;
37397 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
37400 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_required(uint64_t this_arg) {
37401 LDKChannelTypeFeatures this_arg_conv;
37402 this_arg_conv.inner = untag_ptr(this_arg);
37403 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37405 this_arg_conv.is_owned = false;
37406 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
37409 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) {
37410 LDKChannelTypeFeatures this_arg_conv;
37411 this_arg_conv.inner = untag_ptr(this_arg);
37412 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37414 this_arg_conv.is_owned = false;
37415 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
37419 jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) {
37420 LDKInitFeatures this_arg_conv;
37421 this_arg_conv.inner = untag_ptr(this_arg);
37422 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37424 this_arg_conv.is_owned = false;
37425 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
37429 jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) {
37430 LDKNodeFeatures this_arg_conv;
37431 this_arg_conv.inner = untag_ptr(this_arg);
37432 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37434 this_arg_conv.is_owned = false;
37435 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
37439 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) {
37440 LDKChannelTypeFeatures this_arg_conv;
37441 this_arg_conv.inner = untag_ptr(this_arg);
37442 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37444 this_arg_conv.is_owned = false;
37445 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
37449 void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_optional(uint64_t this_arg) {
37450 LDKNodeFeatures this_arg_conv;
37451 this_arg_conv.inner = untag_ptr(this_arg);
37452 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37454 this_arg_conv.is_owned = false;
37455 NodeFeatures_set_keysend_optional(&this_arg_conv);
37458 void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_required(uint64_t this_arg) {
37459 LDKNodeFeatures this_arg_conv;
37460 this_arg_conv.inner = untag_ptr(this_arg);
37461 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37463 this_arg_conv.is_owned = false;
37464 NodeFeatures_set_keysend_required(&this_arg_conv);
37467 jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(uint64_t this_arg) {
37468 LDKNodeFeatures this_arg_conv;
37469 this_arg_conv.inner = untag_ptr(this_arg);
37470 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37472 this_arg_conv.is_owned = false;
37473 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
37477 jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(uint64_t this_arg) {
37478 LDKNodeFeatures this_arg_conv;
37479 this_arg_conv.inner = untag_ptr(this_arg);
37480 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37482 this_arg_conv.is_owned = false;
37483 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
37487 void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) {
37488 LDKShutdownScript this_obj_conv;
37489 this_obj_conv.inner = untag_ptr(this_obj);
37490 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37492 ShutdownScript_free(this_obj_conv);
37495 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
37496 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
37497 uint64_t ret_ref = 0;
37498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37502 int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) {
37503 LDKShutdownScript arg_conv;
37504 arg_conv.inner = untag_ptr(arg);
37505 arg_conv.is_owned = ptr_is_owned(arg);
37506 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37507 arg_conv.is_owned = false;
37508 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
37512 uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) {
37513 LDKShutdownScript orig_conv;
37514 orig_conv.inner = untag_ptr(orig);
37515 orig_conv.is_owned = ptr_is_owned(orig);
37516 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37517 orig_conv.is_owned = false;
37518 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
37519 uint64_t ret_ref = 0;
37520 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37521 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37525 void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
37526 LDKInvalidShutdownScript this_obj_conv;
37527 this_obj_conv.inner = untag_ptr(this_obj);
37528 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37530 InvalidShutdownScript_free(this_obj_conv);
37533 int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) {
37534 LDKInvalidShutdownScript this_ptr_conv;
37535 this_ptr_conv.inner = untag_ptr(this_ptr);
37536 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37538 this_ptr_conv.is_owned = false;
37539 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
37540 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37541 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37545 void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) {
37546 LDKInvalidShutdownScript this_ptr_conv;
37547 this_ptr_conv.inner = untag_ptr(this_ptr);
37548 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37550 this_ptr_conv.is_owned = false;
37551 LDKCVec_u8Z val_ref;
37552 val_ref.datalen = val->arr_len;
37553 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
37554 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
37555 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
37558 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
37559 LDKCVec_u8Z script_arg_ref;
37560 script_arg_ref.datalen = script_arg->arr_len;
37561 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
37562 memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg);
37563 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
37564 uint64_t ret_ref = 0;
37565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37570 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
37571 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
37572 uint64_t ret_ref = 0;
37573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37577 int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) {
37578 LDKInvalidShutdownScript arg_conv;
37579 arg_conv.inner = untag_ptr(arg);
37580 arg_conv.is_owned = ptr_is_owned(arg);
37581 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37582 arg_conv.is_owned = false;
37583 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
37587 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) {
37588 LDKInvalidShutdownScript orig_conv;
37589 orig_conv.inner = untag_ptr(orig);
37590 orig_conv.is_owned = ptr_is_owned(orig);
37591 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37592 orig_conv.is_owned = false;
37593 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
37594 uint64_t ret_ref = 0;
37595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37600 int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) {
37601 LDKShutdownScript obj_conv;
37602 obj_conv.inner = untag_ptr(obj);
37603 obj_conv.is_owned = ptr_is_owned(obj);
37604 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37605 obj_conv.is_owned = false;
37606 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
37607 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37608 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37609 CVec_u8Z_free(ret_var);
37613 uint64_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
37614 LDKu8slice ser_ref;
37615 ser_ref.datalen = ser->arr_len;
37616 ser_ref.data = ser->elems;
37617 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
37618 *ret_conv = ShutdownScript_read(ser_ref);
37620 return tag_ptr(ret_conv, true);
37623 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
37624 unsigned char pubkey_hash_arr[20];
37625 CHECK(pubkey_hash->arr_len == 20);
37626 memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
37627 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
37628 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
37629 uint64_t ret_ref = 0;
37630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37635 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
37636 unsigned char script_hash_arr[32];
37637 CHECK(script_hash->arr_len == 32);
37638 memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
37639 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
37640 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
37641 uint64_t ret_ref = 0;
37642 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37643 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37647 uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
37649 LDKu8slice program_ref;
37650 program_ref.datalen = program->arr_len;
37651 program_ref.data = program->elems;
37652 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
37653 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
37655 return tag_ptr(ret_conv, true);
37658 int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) {
37659 LDKShutdownScript this_arg_conv;
37660 this_arg_conv.inner = untag_ptr(this_arg);
37661 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37663 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
37664 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
37665 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37666 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37667 CVec_u8Z_free(ret_var);
37671 int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) {
37672 LDKShutdownScript this_arg_conv;
37673 this_arg_conv.inner = untag_ptr(this_arg);
37674 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37676 this_arg_conv.is_owned = false;
37677 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
37678 memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
37682 jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) {
37683 LDKShutdownScript 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 LDKInitFeatures features_conv;
37689 features_conv.inner = untag_ptr(features);
37690 features_conv.is_owned = ptr_is_owned(features);
37691 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
37692 features_conv.is_owned = false;
37693 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
37697 void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
37698 if (!ptr_is_owned(this_ptr)) return;
37699 void* this_ptr_ptr = untag_ptr(this_ptr);
37700 CHECK_ACCESS(this_ptr_ptr);
37701 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
37702 FREE(untag_ptr(this_ptr));
37703 CustomMessageReader_free(this_ptr_conv);
37706 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
37707 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37708 *ret_ret = Type_clone(arg);
37709 return tag_ptr(ret_ret, true);
37711 int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) {
37712 void* arg_ptr = untag_ptr(arg);
37713 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
37714 LDKType* arg_conv = (LDKType*)arg_ptr;
37715 int64_t ret_conv = Type_clone_ptr(arg_conv);
37719 uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) {
37720 void* orig_ptr = untag_ptr(orig);
37721 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
37722 LDKType* orig_conv = (LDKType*)orig_ptr;
37723 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37724 *ret_ret = Type_clone(orig_conv);
37725 return tag_ptr(ret_ret, true);
37728 void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_ptr) {
37729 if (!ptr_is_owned(this_ptr)) return;
37730 void* this_ptr_ptr = untag_ptr(this_ptr);
37731 CHECK_ACCESS(this_ptr_ptr);
37732 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
37733 FREE(untag_ptr(this_ptr));
37734 Type_free(this_ptr_conv);
37737 void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
37738 LDKNodeId this_obj_conv;
37739 this_obj_conv.inner = untag_ptr(this_obj);
37740 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37742 NodeId_free(this_obj_conv);
37745 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
37746 LDKNodeId ret_var = NodeId_clone(arg);
37747 uint64_t ret_ref = 0;
37748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37752 int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) {
37753 LDKNodeId arg_conv;
37754 arg_conv.inner = untag_ptr(arg);
37755 arg_conv.is_owned = ptr_is_owned(arg);
37756 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37757 arg_conv.is_owned = false;
37758 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
37762 uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) {
37763 LDKNodeId orig_conv;
37764 orig_conv.inner = untag_ptr(orig);
37765 orig_conv.is_owned = ptr_is_owned(orig);
37766 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37767 orig_conv.is_owned = false;
37768 LDKNodeId ret_var = NodeId_clone(&orig_conv);
37769 uint64_t ret_ref = 0;
37770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37775 uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) {
37776 LDKPublicKey pubkey_ref;
37777 CHECK(pubkey->arr_len == 33);
37778 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
37779 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
37780 uint64_t ret_ref = 0;
37781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37786 int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) {
37787 LDKNodeId 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 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
37793 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37794 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37798 int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) {
37800 o_conv.inner = untag_ptr(o);
37801 o_conv.is_owned = ptr_is_owned(o);
37802 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
37803 o_conv.is_owned = false;
37804 int64_t ret_conv = NodeId_hash(&o_conv);
37808 int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) {
37809 LDKNodeId obj_conv;
37810 obj_conv.inner = untag_ptr(obj);
37811 obj_conv.is_owned = ptr_is_owned(obj);
37812 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37813 obj_conv.is_owned = false;
37814 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
37815 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37816 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37817 CVec_u8Z_free(ret_var);
37821 uint64_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
37822 LDKu8slice ser_ref;
37823 ser_ref.datalen = ser->arr_len;
37824 ser_ref.data = ser->elems;
37825 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
37826 *ret_conv = NodeId_read(ser_ref);
37828 return tag_ptr(ret_conv, true);
37831 void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) {
37832 LDKNetworkGraph this_obj_conv;
37833 this_obj_conv.inner = untag_ptr(this_obj);
37834 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37836 NetworkGraph_free(this_obj_conv);
37839 void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) {
37840 LDKReadOnlyNetworkGraph this_obj_conv;
37841 this_obj_conv.inner = untag_ptr(this_obj);
37842 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37844 ReadOnlyNetworkGraph_free(this_obj_conv);
37847 void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint64_t this_ptr) {
37848 if (!ptr_is_owned(this_ptr)) return;
37849 void* this_ptr_ptr = untag_ptr(this_ptr);
37850 CHECK_ACCESS(this_ptr_ptr);
37851 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
37852 FREE(untag_ptr(this_ptr));
37853 NetworkUpdate_free(this_ptr_conv);
37856 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
37857 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37858 *ret_copy = NetworkUpdate_clone(arg);
37859 uint64_t ret_ref = tag_ptr(ret_copy, true);
37862 int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) {
37863 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
37864 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
37868 uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) {
37869 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
37870 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37871 *ret_copy = NetworkUpdate_clone(orig_conv);
37872 uint64_t ret_ref = tag_ptr(ret_copy, true);
37876 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) {
37877 LDKChannelUpdate msg_conv;
37878 msg_conv.inner = untag_ptr(msg);
37879 msg_conv.is_owned = ptr_is_owned(msg);
37880 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
37881 msg_conv = ChannelUpdate_clone(&msg_conv);
37882 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37883 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
37884 uint64_t ret_ref = tag_ptr(ret_copy, true);
37888 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) {
37889 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37890 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
37891 uint64_t ret_ref = tag_ptr(ret_copy, true);
37895 uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
37896 LDKPublicKey node_id_ref;
37897 CHECK(node_id->arr_len == 33);
37898 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
37899 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37900 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
37901 uint64_t ret_ref = tag_ptr(ret_copy, true);
37905 int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
37906 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
37907 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
37908 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37909 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37910 CVec_u8Z_free(ret_var);
37914 uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
37915 LDKu8slice ser_ref;
37916 ser_ref.datalen = ser->arr_len;
37917 ser_ref.data = ser->elems;
37918 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
37919 *ret_conv = NetworkUpdate_read(ser_ref);
37921 return tag_ptr(ret_conv, true);
37924 void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) {
37925 LDKP2PGossipSync this_obj_conv;
37926 this_obj_conv.inner = untag_ptr(this_obj);
37927 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37929 P2PGossipSync_free(this_obj_conv);
37932 uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
37933 LDKNetworkGraph network_graph_conv;
37934 network_graph_conv.inner = untag_ptr(network_graph);
37935 network_graph_conv.is_owned = ptr_is_owned(network_graph);
37936 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
37937 network_graph_conv.is_owned = false;
37938 void* chain_access_ptr = untag_ptr(chain_access);
37939 CHECK_ACCESS(chain_access_ptr);
37940 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37941 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37942 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37943 // Manually implement clone for Java trait instances
37944 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37945 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37946 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37949 void* logger_ptr = untag_ptr(logger);
37950 CHECK_ACCESS(logger_ptr);
37951 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
37952 if (logger_conv.free == LDKLogger_JCalls_free) {
37953 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37954 LDKLogger_JCalls_cloned(&logger_conv);
37956 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
37957 uint64_t ret_ref = 0;
37958 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37959 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37963 void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
37964 LDKP2PGossipSync this_arg_conv;
37965 this_arg_conv.inner = untag_ptr(this_arg);
37966 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37968 this_arg_conv.is_owned = false;
37969 void* chain_access_ptr = untag_ptr(chain_access);
37970 CHECK_ACCESS(chain_access_ptr);
37971 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37972 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37973 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37974 // Manually implement clone for Java trait instances
37975 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37976 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37977 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37980 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
37983 uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
37984 LDKNetworkGraph this_arg_conv;
37985 this_arg_conv.inner = untag_ptr(this_arg);
37986 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37988 this_arg_conv.is_owned = false;
37989 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
37990 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
37991 return tag_ptr(ret_ret, true);
37994 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
37995 LDKP2PGossipSync this_arg_conv;
37996 this_arg_conv.inner = untag_ptr(this_arg);
37997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37999 this_arg_conv.is_owned = false;
38000 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
38001 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
38002 return tag_ptr(ret_ret, true);
38005 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) {
38006 LDKP2PGossipSync 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 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
38012 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
38013 return tag_ptr(ret_ret, true);
38016 void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) {
38017 LDKChannelUpdateInfo this_obj_conv;
38018 this_obj_conv.inner = untag_ptr(this_obj);
38019 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38021 ChannelUpdateInfo_free(this_obj_conv);
38024 int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) {
38025 LDKChannelUpdateInfo this_ptr_conv;
38026 this_ptr_conv.inner = untag_ptr(this_ptr);
38027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38029 this_ptr_conv.is_owned = false;
38030 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
38034 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) {
38035 LDKChannelUpdateInfo this_ptr_conv;
38036 this_ptr_conv.inner = untag_ptr(this_ptr);
38037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38039 this_ptr_conv.is_owned = false;
38040 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
38043 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) {
38044 LDKChannelUpdateInfo this_ptr_conv;
38045 this_ptr_conv.inner = untag_ptr(this_ptr);
38046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38048 this_ptr_conv.is_owned = false;
38049 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
38053 void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) {
38054 LDKChannelUpdateInfo this_ptr_conv;
38055 this_ptr_conv.inner = untag_ptr(this_ptr);
38056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38058 this_ptr_conv.is_owned = false;
38059 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
38062 int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
38063 LDKChannelUpdateInfo this_ptr_conv;
38064 this_ptr_conv.inner = untag_ptr(this_ptr);
38065 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38067 this_ptr_conv.is_owned = false;
38068 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
38072 void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
38073 LDKChannelUpdateInfo this_ptr_conv;
38074 this_ptr_conv.inner = untag_ptr(this_ptr);
38075 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38077 this_ptr_conv.is_owned = false;
38078 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
38081 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) {
38082 LDKChannelUpdateInfo this_ptr_conv;
38083 this_ptr_conv.inner = untag_ptr(this_ptr);
38084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38086 this_ptr_conv.is_owned = false;
38087 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
38091 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
38092 LDKChannelUpdateInfo this_ptr_conv;
38093 this_ptr_conv.inner = untag_ptr(this_ptr);
38094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38096 this_ptr_conv.is_owned = false;
38097 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
38100 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) {
38101 LDKChannelUpdateInfo this_ptr_conv;
38102 this_ptr_conv.inner = untag_ptr(this_ptr);
38103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38105 this_ptr_conv.is_owned = false;
38106 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
38110 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
38111 LDKChannelUpdateInfo this_ptr_conv;
38112 this_ptr_conv.inner = untag_ptr(this_ptr);
38113 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38115 this_ptr_conv.is_owned = false;
38116 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
38119 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) {
38120 LDKChannelUpdateInfo this_ptr_conv;
38121 this_ptr_conv.inner = untag_ptr(this_ptr);
38122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38124 this_ptr_conv.is_owned = false;
38125 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
38126 uint64_t ret_ref = 0;
38127 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38128 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38132 void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) {
38133 LDKChannelUpdateInfo this_ptr_conv;
38134 this_ptr_conv.inner = untag_ptr(this_ptr);
38135 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38137 this_ptr_conv.is_owned = false;
38138 LDKRoutingFees val_conv;
38139 val_conv.inner = untag_ptr(val);
38140 val_conv.is_owned = ptr_is_owned(val);
38141 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38142 val_conv = RoutingFees_clone(&val_conv);
38143 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
38146 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) {
38147 LDKChannelUpdateInfo this_ptr_conv;
38148 this_ptr_conv.inner = untag_ptr(this_ptr);
38149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38151 this_ptr_conv.is_owned = false;
38152 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
38153 uint64_t ret_ref = 0;
38154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38159 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) {
38160 LDKChannelUpdateInfo this_ptr_conv;
38161 this_ptr_conv.inner = untag_ptr(this_ptr);
38162 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38164 this_ptr_conv.is_owned = false;
38165 LDKChannelUpdate val_conv;
38166 val_conv.inner = untag_ptr(val);
38167 val_conv.is_owned = ptr_is_owned(val);
38168 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38169 val_conv = ChannelUpdate_clone(&val_conv);
38170 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
38173 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) {
38174 LDKRoutingFees fees_arg_conv;
38175 fees_arg_conv.inner = untag_ptr(fees_arg);
38176 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
38177 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
38178 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
38179 LDKChannelUpdate last_update_message_arg_conv;
38180 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
38181 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
38182 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
38183 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
38184 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);
38185 uint64_t ret_ref = 0;
38186 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38187 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38191 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
38192 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
38193 uint64_t ret_ref = 0;
38194 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38195 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38198 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) {
38199 LDKChannelUpdateInfo arg_conv;
38200 arg_conv.inner = untag_ptr(arg);
38201 arg_conv.is_owned = ptr_is_owned(arg);
38202 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38203 arg_conv.is_owned = false;
38204 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
38208 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) {
38209 LDKChannelUpdateInfo orig_conv;
38210 orig_conv.inner = untag_ptr(orig);
38211 orig_conv.is_owned = ptr_is_owned(orig);
38212 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38213 orig_conv.is_owned = false;
38214 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
38215 uint64_t ret_ref = 0;
38216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38221 int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
38222 LDKChannelUpdateInfo obj_conv;
38223 obj_conv.inner = untag_ptr(obj);
38224 obj_conv.is_owned = ptr_is_owned(obj);
38225 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38226 obj_conv.is_owned = false;
38227 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
38228 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38229 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38230 CVec_u8Z_free(ret_var);
38234 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
38235 LDKu8slice ser_ref;
38236 ser_ref.datalen = ser->arr_len;
38237 ser_ref.data = ser->elems;
38238 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
38239 *ret_conv = ChannelUpdateInfo_read(ser_ref);
38241 return tag_ptr(ret_conv, true);
38244 void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) {
38245 LDKChannelInfo this_obj_conv;
38246 this_obj_conv.inner = untag_ptr(this_obj);
38247 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38249 ChannelInfo_free(this_obj_conv);
38252 uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) {
38253 LDKChannelInfo this_ptr_conv;
38254 this_ptr_conv.inner = untag_ptr(this_ptr);
38255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38257 this_ptr_conv.is_owned = false;
38258 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
38259 uint64_t ret_ref = 0;
38260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38265 void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) {
38266 LDKChannelInfo this_ptr_conv;
38267 this_ptr_conv.inner = untag_ptr(this_ptr);
38268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38270 this_ptr_conv.is_owned = false;
38271 LDKChannelFeatures val_conv;
38272 val_conv.inner = untag_ptr(val);
38273 val_conv.is_owned = ptr_is_owned(val);
38274 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38275 val_conv = ChannelFeatures_clone(&val_conv);
38276 ChannelInfo_set_features(&this_ptr_conv, val_conv);
38279 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) {
38280 LDKChannelInfo this_ptr_conv;
38281 this_ptr_conv.inner = untag_ptr(this_ptr);
38282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38284 this_ptr_conv.is_owned = false;
38285 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
38286 uint64_t ret_ref = 0;
38287 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38288 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38292 void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) {
38293 LDKChannelInfo this_ptr_conv;
38294 this_ptr_conv.inner = untag_ptr(this_ptr);
38295 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38297 this_ptr_conv.is_owned = false;
38298 LDKNodeId val_conv;
38299 val_conv.inner = untag_ptr(val);
38300 val_conv.is_owned = ptr_is_owned(val);
38301 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38302 val_conv = NodeId_clone(&val_conv);
38303 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
38306 uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) {
38307 LDKChannelInfo this_ptr_conv;
38308 this_ptr_conv.inner = untag_ptr(this_ptr);
38309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38311 this_ptr_conv.is_owned = false;
38312 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
38313 uint64_t ret_ref = 0;
38314 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38315 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38319 void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) {
38320 LDKChannelInfo this_ptr_conv;
38321 this_ptr_conv.inner = untag_ptr(this_ptr);
38322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38324 this_ptr_conv.is_owned = false;
38325 LDKChannelUpdateInfo val_conv;
38326 val_conv.inner = untag_ptr(val);
38327 val_conv.is_owned = ptr_is_owned(val);
38328 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38329 val_conv = ChannelUpdateInfo_clone(&val_conv);
38330 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
38333 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) {
38334 LDKChannelInfo this_ptr_conv;
38335 this_ptr_conv.inner = untag_ptr(this_ptr);
38336 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38338 this_ptr_conv.is_owned = false;
38339 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
38340 uint64_t ret_ref = 0;
38341 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38342 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38346 void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) {
38347 LDKChannelInfo this_ptr_conv;
38348 this_ptr_conv.inner = untag_ptr(this_ptr);
38349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38351 this_ptr_conv.is_owned = false;
38352 LDKNodeId val_conv;
38353 val_conv.inner = untag_ptr(val);
38354 val_conv.is_owned = ptr_is_owned(val);
38355 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38356 val_conv = NodeId_clone(&val_conv);
38357 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
38360 uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) {
38361 LDKChannelInfo this_ptr_conv;
38362 this_ptr_conv.inner = untag_ptr(this_ptr);
38363 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38365 this_ptr_conv.is_owned = false;
38366 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
38367 uint64_t ret_ref = 0;
38368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38373 void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) {
38374 LDKChannelInfo this_ptr_conv;
38375 this_ptr_conv.inner = untag_ptr(this_ptr);
38376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38378 this_ptr_conv.is_owned = false;
38379 LDKChannelUpdateInfo val_conv;
38380 val_conv.inner = untag_ptr(val);
38381 val_conv.is_owned = ptr_is_owned(val);
38382 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38383 val_conv = ChannelUpdateInfo_clone(&val_conv);
38384 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
38387 uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) {
38388 LDKChannelInfo this_ptr_conv;
38389 this_ptr_conv.inner = untag_ptr(this_ptr);
38390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38392 this_ptr_conv.is_owned = false;
38393 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
38394 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
38395 uint64_t ret_ref = tag_ptr(ret_copy, true);
38399 void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) {
38400 LDKChannelInfo this_ptr_conv;
38401 this_ptr_conv.inner = untag_ptr(this_ptr);
38402 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38404 this_ptr_conv.is_owned = false;
38405 void* val_ptr = untag_ptr(val);
38406 CHECK_ACCESS(val_ptr);
38407 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
38408 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
38409 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
38412 uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) {
38413 LDKChannelInfo this_ptr_conv;
38414 this_ptr_conv.inner = untag_ptr(this_ptr);
38415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38417 this_ptr_conv.is_owned = false;
38418 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
38419 uint64_t ret_ref = 0;
38420 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38421 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38425 void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38426 LDKChannelInfo this_ptr_conv;
38427 this_ptr_conv.inner = untag_ptr(this_ptr);
38428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38430 this_ptr_conv.is_owned = false;
38431 LDKChannelAnnouncement val_conv;
38432 val_conv.inner = untag_ptr(val);
38433 val_conv.is_owned = ptr_is_owned(val);
38434 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38435 val_conv = ChannelAnnouncement_clone(&val_conv);
38436 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
38439 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
38440 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
38441 uint64_t ret_ref = 0;
38442 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38443 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38446 int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) {
38447 LDKChannelInfo arg_conv;
38448 arg_conv.inner = untag_ptr(arg);
38449 arg_conv.is_owned = ptr_is_owned(arg);
38450 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38451 arg_conv.is_owned = false;
38452 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
38456 uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) {
38457 LDKChannelInfo orig_conv;
38458 orig_conv.inner = untag_ptr(orig);
38459 orig_conv.is_owned = ptr_is_owned(orig);
38460 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38461 orig_conv.is_owned = false;
38462 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
38463 uint64_t ret_ref = 0;
38464 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38465 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38469 uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
38470 LDKChannelInfo this_arg_conv;
38471 this_arg_conv.inner = untag_ptr(this_arg);
38472 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38474 this_arg_conv.is_owned = false;
38475 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
38476 uint64_t ret_ref = 0;
38477 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38478 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38482 int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) {
38483 LDKChannelInfo obj_conv;
38484 obj_conv.inner = untag_ptr(obj);
38485 obj_conv.is_owned = ptr_is_owned(obj);
38486 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38487 obj_conv.is_owned = false;
38488 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
38489 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38490 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38491 CVec_u8Z_free(ret_var);
38495 uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
38496 LDKu8slice ser_ref;
38497 ser_ref.datalen = ser->arr_len;
38498 ser_ref.data = ser->elems;
38499 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
38500 *ret_conv = ChannelInfo_read(ser_ref);
38502 return tag_ptr(ret_conv, true);
38505 void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) {
38506 LDKDirectedChannelInfo this_obj_conv;
38507 this_obj_conv.inner = untag_ptr(this_obj);
38508 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38510 DirectedChannelInfo_free(this_obj_conv);
38513 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
38514 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
38515 uint64_t ret_ref = 0;
38516 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38517 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38520 int64_t __attribute__((export_name("TS_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) {
38521 LDKDirectedChannelInfo arg_conv;
38522 arg_conv.inner = untag_ptr(arg);
38523 arg_conv.is_owned = ptr_is_owned(arg);
38524 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38525 arg_conv.is_owned = false;
38526 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
38530 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) {
38531 LDKDirectedChannelInfo orig_conv;
38532 orig_conv.inner = untag_ptr(orig);
38533 orig_conv.is_owned = ptr_is_owned(orig);
38534 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38535 orig_conv.is_owned = false;
38536 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
38537 uint64_t ret_ref = 0;
38538 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38539 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38543 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(uint64_t this_arg) {
38544 LDKDirectedChannelInfo this_arg_conv;
38545 this_arg_conv.inner = untag_ptr(this_arg);
38546 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38548 this_arg_conv.is_owned = false;
38549 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
38550 uint64_t ret_ref = 0;
38551 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38552 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38556 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
38557 LDKDirectedChannelInfo this_arg_conv;
38558 this_arg_conv.inner = untag_ptr(this_arg);
38559 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38561 this_arg_conv.is_owned = false;
38562 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
38563 uint64_t ret_ref = 0;
38564 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38565 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38569 int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
38570 LDKDirectedChannelInfo this_arg_conv;
38571 this_arg_conv.inner = untag_ptr(this_arg);
38572 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38574 this_arg_conv.is_owned = false;
38575 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
38579 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(uint64_t this_arg) {
38580 LDKDirectedChannelInfo this_arg_conv;
38581 this_arg_conv.inner = untag_ptr(this_arg);
38582 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38584 this_arg_conv.is_owned = false;
38585 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38586 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
38587 uint64_t ret_ref = tag_ptr(ret_copy, true);
38591 void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) {
38592 if (!ptr_is_owned(this_ptr)) return;
38593 void* this_ptr_ptr = untag_ptr(this_ptr);
38594 CHECK_ACCESS(this_ptr_ptr);
38595 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
38596 FREE(untag_ptr(this_ptr));
38597 EffectiveCapacity_free(this_ptr_conv);
38600 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
38601 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38602 *ret_copy = EffectiveCapacity_clone(arg);
38603 uint64_t ret_ref = tag_ptr(ret_copy, true);
38606 int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) {
38607 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
38608 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
38612 uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) {
38613 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
38614 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38615 *ret_copy = EffectiveCapacity_clone(orig_conv);
38616 uint64_t ret_ref = tag_ptr(ret_copy, true);
38620 uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) {
38621 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38622 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
38623 uint64_t ret_ref = tag_ptr(ret_copy, true);
38627 uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) {
38628 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38629 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
38630 uint64_t ret_ref = tag_ptr(ret_copy, true);
38634 uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
38635 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
38636 CHECK_ACCESS(htlc_maximum_msat_ptr);
38637 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
38638 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
38639 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38640 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
38641 uint64_t ret_ref = tag_ptr(ret_copy, true);
38645 uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() {
38646 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38647 *ret_copy = EffectiveCapacity_infinite();
38648 uint64_t ret_ref = tag_ptr(ret_copy, true);
38652 uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() {
38653 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38654 *ret_copy = EffectiveCapacity_unknown();
38655 uint64_t ret_ref = tag_ptr(ret_copy, true);
38659 int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) {
38660 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
38661 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
38665 void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) {
38666 LDKRoutingFees this_obj_conv;
38667 this_obj_conv.inner = untag_ptr(this_obj);
38668 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38670 RoutingFees_free(this_obj_conv);
38673 int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) {
38674 LDKRoutingFees this_ptr_conv;
38675 this_ptr_conv.inner = untag_ptr(this_ptr);
38676 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38678 this_ptr_conv.is_owned = false;
38679 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
38683 void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) {
38684 LDKRoutingFees this_ptr_conv;
38685 this_ptr_conv.inner = untag_ptr(this_ptr);
38686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38688 this_ptr_conv.is_owned = false;
38689 RoutingFees_set_base_msat(&this_ptr_conv, val);
38692 int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) {
38693 LDKRoutingFees this_ptr_conv;
38694 this_ptr_conv.inner = untag_ptr(this_ptr);
38695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38697 this_ptr_conv.is_owned = false;
38698 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
38702 void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) {
38703 LDKRoutingFees this_ptr_conv;
38704 this_ptr_conv.inner = untag_ptr(this_ptr);
38705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38707 this_ptr_conv.is_owned = false;
38708 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
38711 uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
38712 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
38713 uint64_t ret_ref = 0;
38714 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38715 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38719 jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) {
38720 LDKRoutingFees a_conv;
38721 a_conv.inner = untag_ptr(a);
38722 a_conv.is_owned = ptr_is_owned(a);
38723 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38724 a_conv.is_owned = false;
38725 LDKRoutingFees b_conv;
38726 b_conv.inner = untag_ptr(b);
38727 b_conv.is_owned = ptr_is_owned(b);
38728 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38729 b_conv.is_owned = false;
38730 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
38734 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
38735 LDKRoutingFees ret_var = RoutingFees_clone(arg);
38736 uint64_t ret_ref = 0;
38737 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38738 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38741 int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) {
38742 LDKRoutingFees arg_conv;
38743 arg_conv.inner = untag_ptr(arg);
38744 arg_conv.is_owned = ptr_is_owned(arg);
38745 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38746 arg_conv.is_owned = false;
38747 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
38751 uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) {
38752 LDKRoutingFees orig_conv;
38753 orig_conv.inner = untag_ptr(orig);
38754 orig_conv.is_owned = ptr_is_owned(orig);
38755 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38756 orig_conv.is_owned = false;
38757 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
38758 uint64_t ret_ref = 0;
38759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38764 int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) {
38765 LDKRoutingFees o_conv;
38766 o_conv.inner = untag_ptr(o);
38767 o_conv.is_owned = ptr_is_owned(o);
38768 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
38769 o_conv.is_owned = false;
38770 int64_t ret_conv = RoutingFees_hash(&o_conv);
38774 int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) {
38775 LDKRoutingFees obj_conv;
38776 obj_conv.inner = untag_ptr(obj);
38777 obj_conv.is_owned = ptr_is_owned(obj);
38778 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38779 obj_conv.is_owned = false;
38780 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
38781 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38782 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38783 CVec_u8Z_free(ret_var);
38787 uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
38788 LDKu8slice ser_ref;
38789 ser_ref.datalen = ser->arr_len;
38790 ser_ref.data = ser->elems;
38791 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
38792 *ret_conv = RoutingFees_read(ser_ref);
38794 return tag_ptr(ret_conv, true);
38797 void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) {
38798 LDKNodeAnnouncementInfo this_obj_conv;
38799 this_obj_conv.inner = untag_ptr(this_obj);
38800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38802 NodeAnnouncementInfo_free(this_obj_conv);
38805 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) {
38806 LDKNodeAnnouncementInfo this_ptr_conv;
38807 this_ptr_conv.inner = untag_ptr(this_ptr);
38808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38810 this_ptr_conv.is_owned = false;
38811 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
38812 uint64_t ret_ref = 0;
38813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38818 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) {
38819 LDKNodeAnnouncementInfo this_ptr_conv;
38820 this_ptr_conv.inner = untag_ptr(this_ptr);
38821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38823 this_ptr_conv.is_owned = false;
38824 LDKNodeFeatures val_conv;
38825 val_conv.inner = untag_ptr(val);
38826 val_conv.is_owned = ptr_is_owned(val);
38827 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38828 val_conv = NodeFeatures_clone(&val_conv);
38829 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
38832 int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) {
38833 LDKNodeAnnouncementInfo this_ptr_conv;
38834 this_ptr_conv.inner = untag_ptr(this_ptr);
38835 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38837 this_ptr_conv.is_owned = false;
38838 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
38842 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) {
38843 LDKNodeAnnouncementInfo this_ptr_conv;
38844 this_ptr_conv.inner = untag_ptr(this_ptr);
38845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38847 this_ptr_conv.is_owned = false;
38848 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
38851 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) {
38852 LDKNodeAnnouncementInfo this_ptr_conv;
38853 this_ptr_conv.inner = untag_ptr(this_ptr);
38854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38856 this_ptr_conv.is_owned = false;
38857 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
38858 memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
38862 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) {
38863 LDKNodeAnnouncementInfo this_ptr_conv;
38864 this_ptr_conv.inner = untag_ptr(this_ptr);
38865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38867 this_ptr_conv.is_owned = false;
38868 LDKThreeBytes val_ref;
38869 CHECK(val->arr_len == 3);
38870 memcpy(val_ref.data, val->elems, 3); FREE(val);
38871 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
38874 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) {
38875 LDKNodeAnnouncementInfo this_ptr_conv;
38876 this_ptr_conv.inner = untag_ptr(this_ptr);
38877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38879 this_ptr_conv.is_owned = false;
38880 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
38881 uint64_t ret_ref = 0;
38882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38887 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) {
38888 LDKNodeAnnouncementInfo this_ptr_conv;
38889 this_ptr_conv.inner = untag_ptr(this_ptr);
38890 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38892 this_ptr_conv.is_owned = false;
38893 LDKNodeAlias val_conv;
38894 val_conv.inner = untag_ptr(val);
38895 val_conv.is_owned = ptr_is_owned(val);
38896 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38897 val_conv = NodeAlias_clone(&val_conv);
38898 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
38901 uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) {
38902 LDKNodeAnnouncementInfo this_ptr_conv;
38903 this_ptr_conv.inner = untag_ptr(this_ptr);
38904 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38906 this_ptr_conv.is_owned = false;
38907 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
38908 uint64_tArray ret_arr = NULL;
38909 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
38910 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
38911 for (size_t m = 0; m < ret_var.datalen; m++) {
38912 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38913 *ret_conv_12_copy = ret_var.data[m];
38914 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
38915 ret_arr_ptr[m] = ret_conv_12_ref;
38918 FREE(ret_var.data);
38922 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) {
38923 LDKNodeAnnouncementInfo this_ptr_conv;
38924 this_ptr_conv.inner = untag_ptr(this_ptr);
38925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38927 this_ptr_conv.is_owned = false;
38928 LDKCVec_NetAddressZ val_constr;
38929 val_constr.datalen = val->arr_len;
38930 if (val_constr.datalen > 0)
38931 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38933 val_constr.data = NULL;
38934 uint64_t* val_vals = val->elems;
38935 for (size_t m = 0; m < val_constr.datalen; m++) {
38936 uint64_t val_conv_12 = val_vals[m];
38937 void* val_conv_12_ptr = untag_ptr(val_conv_12);
38938 CHECK_ACCESS(val_conv_12_ptr);
38939 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
38940 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
38941 val_constr.data[m] = val_conv_12_conv;
38944 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
38947 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) {
38948 LDKNodeAnnouncementInfo this_ptr_conv;
38949 this_ptr_conv.inner = untag_ptr(this_ptr);
38950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38952 this_ptr_conv.is_owned = false;
38953 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
38954 uint64_t ret_ref = 0;
38955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38960 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38961 LDKNodeAnnouncementInfo this_ptr_conv;
38962 this_ptr_conv.inner = untag_ptr(this_ptr);
38963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38965 this_ptr_conv.is_owned = false;
38966 LDKNodeAnnouncement val_conv;
38967 val_conv.inner = untag_ptr(val);
38968 val_conv.is_owned = ptr_is_owned(val);
38969 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38970 val_conv = NodeAnnouncement_clone(&val_conv);
38971 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
38974 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) {
38975 LDKNodeFeatures features_arg_conv;
38976 features_arg_conv.inner = untag_ptr(features_arg);
38977 features_arg_conv.is_owned = ptr_is_owned(features_arg);
38978 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
38979 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
38980 LDKThreeBytes rgb_arg_ref;
38981 CHECK(rgb_arg->arr_len == 3);
38982 memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg);
38983 LDKNodeAlias alias_arg_conv;
38984 alias_arg_conv.inner = untag_ptr(alias_arg);
38985 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
38986 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
38987 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
38988 LDKCVec_NetAddressZ addresses_arg_constr;
38989 addresses_arg_constr.datalen = addresses_arg->arr_len;
38990 if (addresses_arg_constr.datalen > 0)
38991 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38993 addresses_arg_constr.data = NULL;
38994 uint64_t* addresses_arg_vals = addresses_arg->elems;
38995 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
38996 uint64_t addresses_arg_conv_12 = addresses_arg_vals[m];
38997 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
38998 CHECK_ACCESS(addresses_arg_conv_12_ptr);
38999 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
39000 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
39002 FREE(addresses_arg);
39003 LDKNodeAnnouncement announcement_message_arg_conv;
39004 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
39005 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
39006 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
39007 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
39008 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
39009 uint64_t ret_ref = 0;
39010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39015 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
39016 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
39017 uint64_t ret_ref = 0;
39018 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39019 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39022 int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) {
39023 LDKNodeAnnouncementInfo arg_conv;
39024 arg_conv.inner = untag_ptr(arg);
39025 arg_conv.is_owned = ptr_is_owned(arg);
39026 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39027 arg_conv.is_owned = false;
39028 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
39032 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) {
39033 LDKNodeAnnouncementInfo orig_conv;
39034 orig_conv.inner = untag_ptr(orig);
39035 orig_conv.is_owned = ptr_is_owned(orig);
39036 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39037 orig_conv.is_owned = false;
39038 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
39039 uint64_t ret_ref = 0;
39040 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39041 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39045 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
39046 LDKNodeAnnouncementInfo obj_conv;
39047 obj_conv.inner = untag_ptr(obj);
39048 obj_conv.is_owned = ptr_is_owned(obj);
39049 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39050 obj_conv.is_owned = false;
39051 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
39052 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39053 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39054 CVec_u8Z_free(ret_var);
39058 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
39059 LDKu8slice ser_ref;
39060 ser_ref.datalen = ser->arr_len;
39061 ser_ref.data = ser->elems;
39062 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
39063 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
39065 return tag_ptr(ret_conv, true);
39068 void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) {
39069 LDKNodeAlias this_obj_conv;
39070 this_obj_conv.inner = untag_ptr(this_obj);
39071 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39073 NodeAlias_free(this_obj_conv);
39076 int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) {
39077 LDKNodeAlias this_ptr_conv;
39078 this_ptr_conv.inner = untag_ptr(this_ptr);
39079 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39080 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39081 this_ptr_conv.is_owned = false;
39082 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
39083 memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32);
39087 void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) {
39088 LDKNodeAlias this_ptr_conv;
39089 this_ptr_conv.inner = untag_ptr(this_ptr);
39090 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39092 this_ptr_conv.is_owned = false;
39093 LDKThirtyTwoBytes val_ref;
39094 CHECK(val->arr_len == 32);
39095 memcpy(val_ref.data, val->elems, 32); FREE(val);
39096 NodeAlias_set_a(&this_ptr_conv, val_ref);
39099 uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) {
39100 LDKThirtyTwoBytes a_arg_ref;
39101 CHECK(a_arg->arr_len == 32);
39102 memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg);
39103 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
39104 uint64_t ret_ref = 0;
39105 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39106 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39110 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
39111 LDKNodeAlias ret_var = NodeAlias_clone(arg);
39112 uint64_t ret_ref = 0;
39113 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39114 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39117 int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) {
39118 LDKNodeAlias arg_conv;
39119 arg_conv.inner = untag_ptr(arg);
39120 arg_conv.is_owned = ptr_is_owned(arg);
39121 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39122 arg_conv.is_owned = false;
39123 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
39127 uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) {
39128 LDKNodeAlias orig_conv;
39129 orig_conv.inner = untag_ptr(orig);
39130 orig_conv.is_owned = ptr_is_owned(orig);
39131 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39132 orig_conv.is_owned = false;
39133 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
39134 uint64_t ret_ref = 0;
39135 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39136 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39140 int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
39141 LDKNodeAlias obj_conv;
39142 obj_conv.inner = untag_ptr(obj);
39143 obj_conv.is_owned = ptr_is_owned(obj);
39144 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39145 obj_conv.is_owned = false;
39146 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
39147 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39148 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39149 CVec_u8Z_free(ret_var);
39153 uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) {
39154 LDKu8slice ser_ref;
39155 ser_ref.datalen = ser->arr_len;
39156 ser_ref.data = ser->elems;
39157 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
39158 *ret_conv = NodeAlias_read(ser_ref);
39160 return tag_ptr(ret_conv, true);
39163 void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) {
39164 LDKNodeInfo this_obj_conv;
39165 this_obj_conv.inner = untag_ptr(this_obj);
39166 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39168 NodeInfo_free(this_obj_conv);
39171 int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) {
39172 LDKNodeInfo this_ptr_conv;
39173 this_ptr_conv.inner = untag_ptr(this_ptr);
39174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39176 this_ptr_conv.is_owned = false;
39177 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
39178 int64_tArray ret_arr = NULL;
39179 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
39180 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
39181 for (size_t i = 0; i < ret_var.datalen; i++) {
39182 int64_t ret_conv_8_conv = ret_var.data[i];
39183 ret_arr_ptr[i] = ret_conv_8_conv;
39186 FREE(ret_var.data);
39190 void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) {
39191 LDKNodeInfo this_ptr_conv;
39192 this_ptr_conv.inner = untag_ptr(this_ptr);
39193 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39195 this_ptr_conv.is_owned = false;
39196 LDKCVec_u64Z val_constr;
39197 val_constr.datalen = val->arr_len;
39198 if (val_constr.datalen > 0)
39199 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39201 val_constr.data = NULL;
39202 int64_t* val_vals = val->elems;
39203 for (size_t i = 0; i < val_constr.datalen; i++) {
39204 int64_t val_conv_8 = val_vals[i];
39205 val_constr.data[i] = val_conv_8;
39208 NodeInfo_set_channels(&this_ptr_conv, val_constr);
39211 uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
39212 LDKNodeInfo this_ptr_conv;
39213 this_ptr_conv.inner = untag_ptr(this_ptr);
39214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39216 this_ptr_conv.is_owned = false;
39217 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
39218 uint64_t ret_ref = 0;
39219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39224 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) {
39225 LDKNodeInfo this_ptr_conv;
39226 this_ptr_conv.inner = untag_ptr(this_ptr);
39227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39229 this_ptr_conv.is_owned = false;
39230 LDKRoutingFees val_conv;
39231 val_conv.inner = untag_ptr(val);
39232 val_conv.is_owned = ptr_is_owned(val);
39233 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39234 val_conv = RoutingFees_clone(&val_conv);
39235 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
39238 uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
39239 LDKNodeInfo this_ptr_conv;
39240 this_ptr_conv.inner = untag_ptr(this_ptr);
39241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39243 this_ptr_conv.is_owned = false;
39244 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
39245 uint64_t ret_ref = 0;
39246 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39247 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39251 void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(uint64_t this_ptr, uint64_t val) {
39252 LDKNodeInfo this_ptr_conv;
39253 this_ptr_conv.inner = untag_ptr(this_ptr);
39254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39256 this_ptr_conv.is_owned = false;
39257 LDKNodeAnnouncementInfo val_conv;
39258 val_conv.inner = untag_ptr(val);
39259 val_conv.is_owned = ptr_is_owned(val);
39260 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39261 val_conv = NodeAnnouncementInfo_clone(&val_conv);
39262 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
39265 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) {
39266 LDKCVec_u64Z channels_arg_constr;
39267 channels_arg_constr.datalen = channels_arg->arr_len;
39268 if (channels_arg_constr.datalen > 0)
39269 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39271 channels_arg_constr.data = NULL;
39272 int64_t* channels_arg_vals = channels_arg->elems;
39273 for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
39274 int64_t channels_arg_conv_8 = channels_arg_vals[i];
39275 channels_arg_constr.data[i] = channels_arg_conv_8;
39277 FREE(channels_arg);
39278 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
39279 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
39280 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
39281 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
39282 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
39283 LDKNodeAnnouncementInfo announcement_info_arg_conv;
39284 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
39285 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
39286 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
39287 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
39288 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
39289 uint64_t ret_ref = 0;
39290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39295 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
39296 LDKNodeInfo ret_var = NodeInfo_clone(arg);
39297 uint64_t ret_ref = 0;
39298 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39299 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39302 int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) {
39303 LDKNodeInfo arg_conv;
39304 arg_conv.inner = untag_ptr(arg);
39305 arg_conv.is_owned = ptr_is_owned(arg);
39306 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39307 arg_conv.is_owned = false;
39308 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
39312 uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) {
39313 LDKNodeInfo orig_conv;
39314 orig_conv.inner = untag_ptr(orig);
39315 orig_conv.is_owned = ptr_is_owned(orig);
39316 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39317 orig_conv.is_owned = false;
39318 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
39319 uint64_t ret_ref = 0;
39320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39325 int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
39326 LDKNodeInfo obj_conv;
39327 obj_conv.inner = untag_ptr(obj);
39328 obj_conv.is_owned = ptr_is_owned(obj);
39329 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39330 obj_conv.is_owned = false;
39331 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
39332 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39333 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39334 CVec_u8Z_free(ret_var);
39338 uint64_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
39339 LDKu8slice ser_ref;
39340 ser_ref.datalen = ser->arr_len;
39341 ser_ref.data = ser->elems;
39342 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
39343 *ret_conv = NodeInfo_read(ser_ref);
39345 return tag_ptr(ret_conv, true);
39348 int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) {
39349 LDKNetworkGraph obj_conv;
39350 obj_conv.inner = untag_ptr(obj);
39351 obj_conv.is_owned = ptr_is_owned(obj);
39352 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39353 obj_conv.is_owned = false;
39354 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
39355 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39356 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39357 CVec_u8Z_free(ret_var);
39361 uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) {
39362 LDKu8slice ser_ref;
39363 ser_ref.datalen = ser->arr_len;
39364 ser_ref.data = ser->elems;
39365 void* arg_ptr = untag_ptr(arg);
39366 CHECK_ACCESS(arg_ptr);
39367 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
39368 if (arg_conv.free == LDKLogger_JCalls_free) {
39369 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39370 LDKLogger_JCalls_cloned(&arg_conv);
39372 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
39373 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
39375 return tag_ptr(ret_conv, true);
39378 uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
39379 LDKThirtyTwoBytes genesis_hash_ref;
39380 CHECK(genesis_hash->arr_len == 32);
39381 memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
39382 void* logger_ptr = untag_ptr(logger);
39383 CHECK_ACCESS(logger_ptr);
39384 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
39385 if (logger_conv.free == LDKLogger_JCalls_free) {
39386 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39387 LDKLogger_JCalls_cloned(&logger_conv);
39389 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
39390 uint64_t ret_ref = 0;
39391 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39392 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39396 uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) {
39397 LDKNetworkGraph this_arg_conv;
39398 this_arg_conv.inner = untag_ptr(this_arg);
39399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39401 this_arg_conv.is_owned = false;
39402 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
39403 uint64_t ret_ref = 0;
39404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39409 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) {
39410 LDKNetworkGraph this_arg_conv;
39411 this_arg_conv.inner = untag_ptr(this_arg);
39412 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39414 this_arg_conv.is_owned = false;
39415 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
39416 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
39417 uint64_t ret_ref = tag_ptr(ret_copy, true);
39421 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) {
39422 LDKNetworkGraph this_arg_conv;
39423 this_arg_conv.inner = untag_ptr(this_arg);
39424 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39426 this_arg_conv.is_owned = false;
39427 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
39430 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) {
39431 LDKNetworkGraph this_arg_conv;
39432 this_arg_conv.inner = untag_ptr(this_arg);
39433 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39435 this_arg_conv.is_owned = false;
39436 LDKNodeAnnouncement msg_conv;
39437 msg_conv.inner = untag_ptr(msg);
39438 msg_conv.is_owned = ptr_is_owned(msg);
39439 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39440 msg_conv.is_owned = false;
39441 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39442 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
39443 return tag_ptr(ret_conv, true);
39446 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) {
39447 LDKNetworkGraph this_arg_conv;
39448 this_arg_conv.inner = untag_ptr(this_arg);
39449 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39450 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39451 this_arg_conv.is_owned = false;
39452 LDKUnsignedNodeAnnouncement msg_conv;
39453 msg_conv.inner = untag_ptr(msg);
39454 msg_conv.is_owned = ptr_is_owned(msg);
39455 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39456 msg_conv.is_owned = false;
39457 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39458 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
39459 return tag_ptr(ret_conv, true);
39462 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) {
39463 LDKNetworkGraph this_arg_conv;
39464 this_arg_conv.inner = untag_ptr(this_arg);
39465 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39467 this_arg_conv.is_owned = false;
39468 LDKChannelAnnouncement msg_conv;
39469 msg_conv.inner = untag_ptr(msg);
39470 msg_conv.is_owned = ptr_is_owned(msg);
39471 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39472 msg_conv.is_owned = false;
39473 void* chain_access_ptr = untag_ptr(chain_access);
39474 CHECK_ACCESS(chain_access_ptr);
39475 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39476 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39477 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39478 // Manually implement clone for Java trait instances
39479 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39480 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39481 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39484 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39485 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39486 return tag_ptr(ret_conv, true);
39489 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) {
39490 LDKNetworkGraph this_arg_conv;
39491 this_arg_conv.inner = untag_ptr(this_arg);
39492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39494 this_arg_conv.is_owned = false;
39495 LDKUnsignedChannelAnnouncement msg_conv;
39496 msg_conv.inner = untag_ptr(msg);
39497 msg_conv.is_owned = ptr_is_owned(msg);
39498 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39499 msg_conv.is_owned = false;
39500 void* chain_access_ptr = untag_ptr(chain_access);
39501 CHECK_ACCESS(chain_access_ptr);
39502 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39503 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39504 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39505 // Manually implement clone for Java trait instances
39506 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39507 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39508 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39511 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39512 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39513 return tag_ptr(ret_conv, true);
39516 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) {
39517 LDKNetworkGraph this_arg_conv;
39518 this_arg_conv.inner = untag_ptr(this_arg);
39519 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39521 this_arg_conv.is_owned = false;
39522 LDKChannelFeatures features_conv;
39523 features_conv.inner = untag_ptr(features);
39524 features_conv.is_owned = ptr_is_owned(features);
39525 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
39526 features_conv = ChannelFeatures_clone(&features_conv);
39527 LDKPublicKey node_id_1_ref;
39528 CHECK(node_id_1->arr_len == 33);
39529 memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1);
39530 LDKPublicKey node_id_2_ref;
39531 CHECK(node_id_2->arr_len == 33);
39532 memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2);
39533 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39534 *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);
39535 return tag_ptr(ret_conv, true);
39538 void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
39539 LDKNetworkGraph this_arg_conv;
39540 this_arg_conv.inner = untag_ptr(this_arg);
39541 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39543 this_arg_conv.is_owned = false;
39544 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
39547 void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
39548 LDKNetworkGraph this_arg_conv;
39549 this_arg_conv.inner = untag_ptr(this_arg);
39550 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39552 this_arg_conv.is_owned = false;
39553 LDKPublicKey _node_id_ref;
39554 CHECK(_node_id->arr_len == 33);
39555 memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id);
39556 NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
39559 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) {
39560 LDKNetworkGraph this_arg_conv;
39561 this_arg_conv.inner = untag_ptr(this_arg);
39562 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39564 this_arg_conv.is_owned = false;
39565 NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
39568 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
39569 LDKNetworkGraph this_arg_conv;
39570 this_arg_conv.inner = untag_ptr(this_arg);
39571 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39573 this_arg_conv.is_owned = false;
39574 LDKChannelUpdate msg_conv;
39575 msg_conv.inner = untag_ptr(msg);
39576 msg_conv.is_owned = ptr_is_owned(msg);
39577 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39578 msg_conv.is_owned = false;
39579 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39580 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
39581 return tag_ptr(ret_conv, true);
39584 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) {
39585 LDKNetworkGraph this_arg_conv;
39586 this_arg_conv.inner = untag_ptr(this_arg);
39587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39589 this_arg_conv.is_owned = false;
39590 LDKUnsignedChannelUpdate msg_conv;
39591 msg_conv.inner = untag_ptr(msg);
39592 msg_conv.is_owned = ptr_is_owned(msg);
39593 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39594 msg_conv.is_owned = false;
39595 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39596 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
39597 return tag_ptr(ret_conv, true);
39600 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) {
39601 LDKReadOnlyNetworkGraph this_arg_conv;
39602 this_arg_conv.inner = untag_ptr(this_arg);
39603 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39605 this_arg_conv.is_owned = false;
39606 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
39607 uint64_t ret_ref = 0;
39608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39613 int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) {
39614 LDKReadOnlyNetworkGraph this_arg_conv;
39615 this_arg_conv.inner = untag_ptr(this_arg);
39616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39618 this_arg_conv.is_owned = false;
39619 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
39620 int64_tArray ret_arr = NULL;
39621 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
39622 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
39623 for (size_t i = 0; i < ret_var.datalen; i++) {
39624 int64_t ret_conv_8_conv = ret_var.data[i];
39625 ret_arr_ptr[i] = ret_conv_8_conv;
39628 FREE(ret_var.data);
39632 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) {
39633 LDKReadOnlyNetworkGraph this_arg_conv;
39634 this_arg_conv.inner = untag_ptr(this_arg);
39635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39637 this_arg_conv.is_owned = false;
39638 LDKNodeId node_id_conv;
39639 node_id_conv.inner = untag_ptr(node_id);
39640 node_id_conv.is_owned = ptr_is_owned(node_id);
39641 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
39642 node_id_conv.is_owned = false;
39643 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
39644 uint64_t ret_ref = 0;
39645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39650 uint64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) {
39651 LDKReadOnlyNetworkGraph this_arg_conv;
39652 this_arg_conv.inner = untag_ptr(this_arg);
39653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39655 this_arg_conv.is_owned = false;
39656 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
39657 uint64_tArray ret_arr = NULL;
39658 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
39659 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
39660 for (size_t i = 0; i < ret_var.datalen; i++) {
39661 LDKNodeId ret_conv_8_var = ret_var.data[i];
39662 uint64_t ret_conv_8_ref = 0;
39663 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
39664 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
39665 ret_arr_ptr[i] = ret_conv_8_ref;
39668 FREE(ret_var.data);
39672 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) {
39673 LDKReadOnlyNetworkGraph this_arg_conv;
39674 this_arg_conv.inner = untag_ptr(this_arg);
39675 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39676 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39677 this_arg_conv.is_owned = false;
39678 LDKPublicKey pubkey_ref;
39679 CHECK(pubkey->arr_len == 33);
39680 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
39681 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
39682 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
39683 uint64_t ret_ref = tag_ptr(ret_copy, true);
39687 void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
39688 LDKRouteHop this_obj_conv;
39689 this_obj_conv.inner = untag_ptr(this_obj);
39690 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39692 RouteHop_free(this_obj_conv);
39695 int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) {
39696 LDKRouteHop this_ptr_conv;
39697 this_ptr_conv.inner = untag_ptr(this_ptr);
39698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39700 this_ptr_conv.is_owned = false;
39701 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
39702 memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
39706 void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) {
39707 LDKRouteHop this_ptr_conv;
39708 this_ptr_conv.inner = untag_ptr(this_ptr);
39709 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39711 this_ptr_conv.is_owned = false;
39712 LDKPublicKey val_ref;
39713 CHECK(val->arr_len == 33);
39714 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
39715 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
39718 uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) {
39719 LDKRouteHop this_ptr_conv;
39720 this_ptr_conv.inner = untag_ptr(this_ptr);
39721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39723 this_ptr_conv.is_owned = false;
39724 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
39725 uint64_t ret_ref = 0;
39726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39731 void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) {
39732 LDKRouteHop this_ptr_conv;
39733 this_ptr_conv.inner = untag_ptr(this_ptr);
39734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39736 this_ptr_conv.is_owned = false;
39737 LDKNodeFeatures val_conv;
39738 val_conv.inner = untag_ptr(val);
39739 val_conv.is_owned = ptr_is_owned(val);
39740 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39741 val_conv = NodeFeatures_clone(&val_conv);
39742 RouteHop_set_node_features(&this_ptr_conv, val_conv);
39745 int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) {
39746 LDKRouteHop this_ptr_conv;
39747 this_ptr_conv.inner = untag_ptr(this_ptr);
39748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39750 this_ptr_conv.is_owned = false;
39751 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
39755 void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
39756 LDKRouteHop this_ptr_conv;
39757 this_ptr_conv.inner = untag_ptr(this_ptr);
39758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39760 this_ptr_conv.is_owned = false;
39761 RouteHop_set_short_channel_id(&this_ptr_conv, val);
39764 uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) {
39765 LDKRouteHop this_ptr_conv;
39766 this_ptr_conv.inner = untag_ptr(this_ptr);
39767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39769 this_ptr_conv.is_owned = false;
39770 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
39771 uint64_t ret_ref = 0;
39772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39777 void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) {
39778 LDKRouteHop this_ptr_conv;
39779 this_ptr_conv.inner = untag_ptr(this_ptr);
39780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39782 this_ptr_conv.is_owned = false;
39783 LDKChannelFeatures val_conv;
39784 val_conv.inner = untag_ptr(val);
39785 val_conv.is_owned = ptr_is_owned(val);
39786 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39787 val_conv = ChannelFeatures_clone(&val_conv);
39788 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
39791 int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) {
39792 LDKRouteHop this_ptr_conv;
39793 this_ptr_conv.inner = untag_ptr(this_ptr);
39794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39796 this_ptr_conv.is_owned = false;
39797 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
39801 void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) {
39802 LDKRouteHop this_ptr_conv;
39803 this_ptr_conv.inner = untag_ptr(this_ptr);
39804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39806 this_ptr_conv.is_owned = false;
39807 RouteHop_set_fee_msat(&this_ptr_conv, val);
39810 int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) {
39811 LDKRouteHop this_ptr_conv;
39812 this_ptr_conv.inner = untag_ptr(this_ptr);
39813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39815 this_ptr_conv.is_owned = false;
39816 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
39820 void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
39821 LDKRouteHop this_ptr_conv;
39822 this_ptr_conv.inner = untag_ptr(this_ptr);
39823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39825 this_ptr_conv.is_owned = false;
39826 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
39829 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) {
39830 LDKPublicKey pubkey_arg_ref;
39831 CHECK(pubkey_arg->arr_len == 33);
39832 memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg);
39833 LDKNodeFeatures node_features_arg_conv;
39834 node_features_arg_conv.inner = untag_ptr(node_features_arg);
39835 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
39836 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
39837 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
39838 LDKChannelFeatures channel_features_arg_conv;
39839 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
39840 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
39841 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
39842 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
39843 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);
39844 uint64_t ret_ref = 0;
39845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39850 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
39851 LDKRouteHop ret_var = RouteHop_clone(arg);
39852 uint64_t ret_ref = 0;
39853 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39854 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39857 int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) {
39858 LDKRouteHop arg_conv;
39859 arg_conv.inner = untag_ptr(arg);
39860 arg_conv.is_owned = ptr_is_owned(arg);
39861 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39862 arg_conv.is_owned = false;
39863 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
39867 uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) {
39868 LDKRouteHop orig_conv;
39869 orig_conv.inner = untag_ptr(orig);
39870 orig_conv.is_owned = ptr_is_owned(orig);
39871 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39872 orig_conv.is_owned = false;
39873 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
39874 uint64_t ret_ref = 0;
39875 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39876 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39880 int64_t __attribute__((export_name("TS_RouteHop_hash"))) TS_RouteHop_hash(uint64_t o) {
39881 LDKRouteHop o_conv;
39882 o_conv.inner = untag_ptr(o);
39883 o_conv.is_owned = ptr_is_owned(o);
39884 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
39885 o_conv.is_owned = false;
39886 int64_t ret_conv = RouteHop_hash(&o_conv);
39890 jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) {
39891 LDKRouteHop a_conv;
39892 a_conv.inner = untag_ptr(a);
39893 a_conv.is_owned = ptr_is_owned(a);
39894 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39895 a_conv.is_owned = false;
39896 LDKRouteHop b_conv;
39897 b_conv.inner = untag_ptr(b);
39898 b_conv.is_owned = ptr_is_owned(b);
39899 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39900 b_conv.is_owned = false;
39901 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
39905 int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) {
39906 LDKRouteHop obj_conv;
39907 obj_conv.inner = untag_ptr(obj);
39908 obj_conv.is_owned = ptr_is_owned(obj);
39909 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39910 obj_conv.is_owned = false;
39911 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
39912 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39913 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39914 CVec_u8Z_free(ret_var);
39918 uint64_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
39919 LDKu8slice ser_ref;
39920 ser_ref.datalen = ser->arr_len;
39921 ser_ref.data = ser->elems;
39922 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
39923 *ret_conv = RouteHop_read(ser_ref);
39925 return tag_ptr(ret_conv, true);
39928 void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) {
39929 LDKRoute this_obj_conv;
39930 this_obj_conv.inner = untag_ptr(this_obj);
39931 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39933 Route_free(this_obj_conv);
39936 ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) {
39937 LDKRoute this_ptr_conv;
39938 this_ptr_conv.inner = untag_ptr(this_ptr);
39939 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39941 this_ptr_conv.is_owned = false;
39942 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
39943 ptrArray ret_arr = NULL;
39944 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
39945 uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8);
39946 for (size_t m = 0; m < ret_var.datalen; m++) {
39947 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
39948 uint64_tArray ret_conv_12_arr = NULL;
39949 ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__);
39950 uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8);
39951 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
39952 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
39953 uint64_t ret_conv_12_conv_10_ref = 0;
39954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
39955 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
39956 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
39959 FREE(ret_conv_12_var.data);
39960 ret_arr_ptr[m] = ret_conv_12_arr;
39963 FREE(ret_var.data);
39967 void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) {
39968 LDKRoute this_ptr_conv;
39969 this_ptr_conv.inner = untag_ptr(this_ptr);
39970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39972 this_ptr_conv.is_owned = false;
39973 LDKCVec_CVec_RouteHopZZ val_constr;
39974 val_constr.datalen = val->arr_len;
39975 if (val_constr.datalen > 0)
39976 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
39978 val_constr.data = NULL;
39979 uint64_tArray* val_vals = (void*) val->elems;
39980 for (size_t m = 0; m < val_constr.datalen; m++) {
39981 uint64_tArray val_conv_12 = val_vals[m];
39982 LDKCVec_RouteHopZ val_conv_12_constr;
39983 val_conv_12_constr.datalen = val_conv_12->arr_len;
39984 if (val_conv_12_constr.datalen > 0)
39985 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
39987 val_conv_12_constr.data = NULL;
39988 uint64_t* val_conv_12_vals = val_conv_12->elems;
39989 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
39990 uint64_t val_conv_12_conv_10 = val_conv_12_vals[k];
39991 LDKRouteHop val_conv_12_conv_10_conv;
39992 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
39993 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
39994 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
39995 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
39996 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
39999 val_constr.data[m] = val_conv_12_constr;
40002 Route_set_paths(&this_ptr_conv, val_constr);
40005 uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) {
40006 LDKRoute this_ptr_conv;
40007 this_ptr_conv.inner = untag_ptr(this_ptr);
40008 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40010 this_ptr_conv.is_owned = false;
40011 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
40012 uint64_t ret_ref = 0;
40013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40018 void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) {
40019 LDKRoute this_ptr_conv;
40020 this_ptr_conv.inner = untag_ptr(this_ptr);
40021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40023 this_ptr_conv.is_owned = false;
40024 LDKPaymentParameters val_conv;
40025 val_conv.inner = untag_ptr(val);
40026 val_conv.is_owned = ptr_is_owned(val);
40027 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40028 val_conv = PaymentParameters_clone(&val_conv);
40029 Route_set_payment_params(&this_ptr_conv, val_conv);
40032 uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) {
40033 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
40034 paths_arg_constr.datalen = paths_arg->arr_len;
40035 if (paths_arg_constr.datalen > 0)
40036 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
40038 paths_arg_constr.data = NULL;
40039 uint64_tArray* paths_arg_vals = (void*) paths_arg->elems;
40040 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
40041 uint64_tArray paths_arg_conv_12 = paths_arg_vals[m];
40042 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
40043 paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len;
40044 if (paths_arg_conv_12_constr.datalen > 0)
40045 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
40047 paths_arg_conv_12_constr.data = NULL;
40048 uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
40049 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
40050 uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
40051 LDKRouteHop paths_arg_conv_12_conv_10_conv;
40052 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
40053 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
40054 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
40055 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
40056 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
40058 FREE(paths_arg_conv_12);
40059 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
40062 LDKPaymentParameters payment_params_arg_conv;
40063 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
40064 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
40065 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
40066 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
40067 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
40068 uint64_t ret_ref = 0;
40069 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40070 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40074 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
40075 LDKRoute ret_var = Route_clone(arg);
40076 uint64_t ret_ref = 0;
40077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40078 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40081 int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) {
40083 arg_conv.inner = untag_ptr(arg);
40084 arg_conv.is_owned = ptr_is_owned(arg);
40085 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40086 arg_conv.is_owned = false;
40087 int64_t ret_conv = Route_clone_ptr(&arg_conv);
40091 uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) {
40092 LDKRoute orig_conv;
40093 orig_conv.inner = untag_ptr(orig);
40094 orig_conv.is_owned = ptr_is_owned(orig);
40095 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40096 orig_conv.is_owned = false;
40097 LDKRoute ret_var = Route_clone(&orig_conv);
40098 uint64_t ret_ref = 0;
40099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40104 int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(uint64_t o) {
40106 o_conv.inner = untag_ptr(o);
40107 o_conv.is_owned = ptr_is_owned(o);
40108 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40109 o_conv.is_owned = false;
40110 int64_t ret_conv = Route_hash(&o_conv);
40114 jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) {
40116 a_conv.inner = untag_ptr(a);
40117 a_conv.is_owned = ptr_is_owned(a);
40118 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40119 a_conv.is_owned = false;
40121 b_conv.inner = untag_ptr(b);
40122 b_conv.is_owned = ptr_is_owned(b);
40123 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40124 b_conv.is_owned = false;
40125 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
40129 int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) {
40130 LDKRoute this_arg_conv;
40131 this_arg_conv.inner = untag_ptr(this_arg);
40132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40134 this_arg_conv.is_owned = false;
40135 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
40139 int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) {
40140 LDKRoute this_arg_conv;
40141 this_arg_conv.inner = untag_ptr(this_arg);
40142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40144 this_arg_conv.is_owned = false;
40145 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
40149 int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) {
40151 obj_conv.inner = untag_ptr(obj);
40152 obj_conv.is_owned = ptr_is_owned(obj);
40153 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40154 obj_conv.is_owned = false;
40155 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
40156 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40157 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40158 CVec_u8Z_free(ret_var);
40162 uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
40163 LDKu8slice ser_ref;
40164 ser_ref.datalen = ser->arr_len;
40165 ser_ref.data = ser->elems;
40166 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
40167 *ret_conv = Route_read(ser_ref);
40169 return tag_ptr(ret_conv, true);
40172 void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) {
40173 LDKRouteParameters this_obj_conv;
40174 this_obj_conv.inner = untag_ptr(this_obj);
40175 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40177 RouteParameters_free(this_obj_conv);
40180 uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(uint64_t this_ptr) {
40181 LDKRouteParameters this_ptr_conv;
40182 this_ptr_conv.inner = untag_ptr(this_ptr);
40183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40185 this_ptr_conv.is_owned = false;
40186 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
40187 uint64_t ret_ref = 0;
40188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40193 void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_t val) {
40194 LDKRouteParameters this_ptr_conv;
40195 this_ptr_conv.inner = untag_ptr(this_ptr);
40196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40198 this_ptr_conv.is_owned = false;
40199 LDKPaymentParameters val_conv;
40200 val_conv.inner = untag_ptr(val);
40201 val_conv.is_owned = ptr_is_owned(val);
40202 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40203 val_conv = PaymentParameters_clone(&val_conv);
40204 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
40207 int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(uint64_t this_ptr) {
40208 LDKRouteParameters this_ptr_conv;
40209 this_ptr_conv.inner = untag_ptr(this_ptr);
40210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40212 this_ptr_conv.is_owned = false;
40213 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
40217 void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_t val) {
40218 LDKRouteParameters this_ptr_conv;
40219 this_ptr_conv.inner = untag_ptr(this_ptr);
40220 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40222 this_ptr_conv.is_owned = false;
40223 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
40226 int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
40227 LDKRouteParameters this_ptr_conv;
40228 this_ptr_conv.inner = untag_ptr(this_ptr);
40229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40231 this_ptr_conv.is_owned = false;
40232 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
40236 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) {
40237 LDKRouteParameters this_ptr_conv;
40238 this_ptr_conv.inner = untag_ptr(this_ptr);
40239 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40241 this_ptr_conv.is_owned = false;
40242 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
40245 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) {
40246 LDKPaymentParameters payment_params_arg_conv;
40247 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
40248 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
40249 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
40250 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
40251 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
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 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
40259 LDKRouteParameters ret_var = RouteParameters_clone(arg);
40260 uint64_t ret_ref = 0;
40261 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40262 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40265 int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) {
40266 LDKRouteParameters arg_conv;
40267 arg_conv.inner = untag_ptr(arg);
40268 arg_conv.is_owned = ptr_is_owned(arg);
40269 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40270 arg_conv.is_owned = false;
40271 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
40275 uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) {
40276 LDKRouteParameters orig_conv;
40277 orig_conv.inner = untag_ptr(orig);
40278 orig_conv.is_owned = ptr_is_owned(orig);
40279 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40280 orig_conv.is_owned = false;
40281 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
40282 uint64_t ret_ref = 0;
40283 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40284 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40288 int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
40289 LDKRouteParameters obj_conv;
40290 obj_conv.inner = untag_ptr(obj);
40291 obj_conv.is_owned = ptr_is_owned(obj);
40292 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40293 obj_conv.is_owned = false;
40294 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
40295 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40296 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40297 CVec_u8Z_free(ret_var);
40301 uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
40302 LDKu8slice ser_ref;
40303 ser_ref.datalen = ser->arr_len;
40304 ser_ref.data = ser->elems;
40305 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
40306 *ret_conv = RouteParameters_read(ser_ref);
40308 return tag_ptr(ret_conv, true);
40311 void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) {
40312 LDKPaymentParameters this_obj_conv;
40313 this_obj_conv.inner = untag_ptr(this_obj);
40314 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40316 PaymentParameters_free(this_obj_conv);
40319 int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(uint64_t this_ptr) {
40320 LDKPaymentParameters this_ptr_conv;
40321 this_ptr_conv.inner = untag_ptr(this_ptr);
40322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40324 this_ptr_conv.is_owned = false;
40325 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40326 memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33);
40330 void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray val) {
40331 LDKPaymentParameters this_ptr_conv;
40332 this_ptr_conv.inner = untag_ptr(this_ptr);
40333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40335 this_ptr_conv.is_owned = false;
40336 LDKPublicKey val_ref;
40337 CHECK(val->arr_len == 33);
40338 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40339 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
40342 uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(uint64_t this_ptr) {
40343 LDKPaymentParameters this_ptr_conv;
40344 this_ptr_conv.inner = untag_ptr(this_ptr);
40345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40347 this_ptr_conv.is_owned = false;
40348 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
40349 uint64_t ret_ref = 0;
40350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40355 void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_t val) {
40356 LDKPaymentParameters this_ptr_conv;
40357 this_ptr_conv.inner = untag_ptr(this_ptr);
40358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40360 this_ptr_conv.is_owned = false;
40361 LDKInvoiceFeatures val_conv;
40362 val_conv.inner = untag_ptr(val);
40363 val_conv.is_owned = ptr_is_owned(val);
40364 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40365 val_conv = InvoiceFeatures_clone(&val_conv);
40366 PaymentParameters_set_features(&this_ptr_conv, val_conv);
40369 uint64_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(uint64_t this_ptr) {
40370 LDKPaymentParameters this_ptr_conv;
40371 this_ptr_conv.inner = untag_ptr(this_ptr);
40372 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40374 this_ptr_conv.is_owned = false;
40375 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
40376 uint64_tArray ret_arr = NULL;
40377 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40378 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40379 for (size_t l = 0; l < ret_var.datalen; l++) {
40380 LDKRouteHint ret_conv_11_var = ret_var.data[l];
40381 uint64_t ret_conv_11_ref = 0;
40382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
40383 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
40384 ret_arr_ptr[l] = ret_conv_11_ref;
40387 FREE(ret_var.data);
40391 void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray val) {
40392 LDKPaymentParameters this_ptr_conv;
40393 this_ptr_conv.inner = untag_ptr(this_ptr);
40394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40396 this_ptr_conv.is_owned = false;
40397 LDKCVec_RouteHintZ val_constr;
40398 val_constr.datalen = val->arr_len;
40399 if (val_constr.datalen > 0)
40400 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40402 val_constr.data = NULL;
40403 uint64_t* val_vals = val->elems;
40404 for (size_t l = 0; l < val_constr.datalen; l++) {
40405 uint64_t val_conv_11 = val_vals[l];
40406 LDKRouteHint val_conv_11_conv;
40407 val_conv_11_conv.inner = untag_ptr(val_conv_11);
40408 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
40409 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
40410 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
40411 val_constr.data[l] = val_conv_11_conv;
40414 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
40417 uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(uint64_t this_ptr) {
40418 LDKPaymentParameters this_ptr_conv;
40419 this_ptr_conv.inner = untag_ptr(this_ptr);
40420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40422 this_ptr_conv.is_owned = false;
40423 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40424 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
40425 uint64_t ret_ref = tag_ptr(ret_copy, true);
40429 void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_t val) {
40430 LDKPaymentParameters this_ptr_conv;
40431 this_ptr_conv.inner = untag_ptr(this_ptr);
40432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40434 this_ptr_conv.is_owned = false;
40435 void* val_ptr = untag_ptr(val);
40436 CHECK_ACCESS(val_ptr);
40437 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40438 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40439 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
40442 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) {
40443 LDKPaymentParameters this_ptr_conv;
40444 this_ptr_conv.inner = untag_ptr(this_ptr);
40445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40447 this_ptr_conv.is_owned = false;
40448 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
40452 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) {
40453 LDKPaymentParameters this_ptr_conv;
40454 this_ptr_conv.inner = untag_ptr(this_ptr);
40455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40457 this_ptr_conv.is_owned = false;
40458 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
40461 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(uint64_t this_ptr) {
40462 LDKPaymentParameters this_ptr_conv;
40463 this_ptr_conv.inner = untag_ptr(this_ptr);
40464 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40466 this_ptr_conv.is_owned = false;
40467 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
40471 void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_t val) {
40472 LDKPaymentParameters this_ptr_conv;
40473 this_ptr_conv.inner = untag_ptr(this_ptr);
40474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40476 this_ptr_conv.is_owned = false;
40477 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
40480 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) {
40481 LDKPaymentParameters this_ptr_conv;
40482 this_ptr_conv.inner = untag_ptr(this_ptr);
40483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40485 this_ptr_conv.is_owned = false;
40486 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
40490 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) {
40491 LDKPaymentParameters this_ptr_conv;
40492 this_ptr_conv.inner = untag_ptr(this_ptr);
40493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40495 this_ptr_conv.is_owned = false;
40496 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
40499 int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(uint64_t this_ptr) {
40500 LDKPaymentParameters this_ptr_conv;
40501 this_ptr_conv.inner = untag_ptr(this_ptr);
40502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40504 this_ptr_conv.is_owned = false;
40505 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
40506 int64_tArray ret_arr = NULL;
40507 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
40508 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
40509 for (size_t i = 0; i < ret_var.datalen; i++) {
40510 int64_t ret_conv_8_conv = ret_var.data[i];
40511 ret_arr_ptr[i] = ret_conv_8_conv;
40514 FREE(ret_var.data);
40518 void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray val) {
40519 LDKPaymentParameters this_ptr_conv;
40520 this_ptr_conv.inner = untag_ptr(this_ptr);
40521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40523 this_ptr_conv.is_owned = false;
40524 LDKCVec_u64Z val_constr;
40525 val_constr.datalen = val->arr_len;
40526 if (val_constr.datalen > 0)
40527 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40529 val_constr.data = NULL;
40530 int64_t* val_vals = val->elems;
40531 for (size_t i = 0; i < val_constr.datalen; i++) {
40532 int64_t val_conv_8 = val_vals[i];
40533 val_constr.data[i] = val_conv_8;
40536 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
40539 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) {
40540 LDKPublicKey payee_pubkey_arg_ref;
40541 CHECK(payee_pubkey_arg->arr_len == 33);
40542 memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
40543 LDKInvoiceFeatures features_arg_conv;
40544 features_arg_conv.inner = untag_ptr(features_arg);
40545 features_arg_conv.is_owned = ptr_is_owned(features_arg);
40546 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
40547 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
40548 LDKCVec_RouteHintZ route_hints_arg_constr;
40549 route_hints_arg_constr.datalen = route_hints_arg->arr_len;
40550 if (route_hints_arg_constr.datalen > 0)
40551 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40553 route_hints_arg_constr.data = NULL;
40554 uint64_t* route_hints_arg_vals = route_hints_arg->elems;
40555 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
40556 uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
40557 LDKRouteHint route_hints_arg_conv_11_conv;
40558 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
40559 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
40560 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
40561 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
40562 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
40564 FREE(route_hints_arg);
40565 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
40566 CHECK_ACCESS(expiry_time_arg_ptr);
40567 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
40568 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
40569 LDKCVec_u64Z previously_failed_channels_arg_constr;
40570 previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len;
40571 if (previously_failed_channels_arg_constr.datalen > 0)
40572 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40574 previously_failed_channels_arg_constr.data = NULL;
40575 int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems;
40576 for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) {
40577 int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i];
40578 previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
40580 FREE(previously_failed_channels_arg);
40581 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);
40582 uint64_t ret_ref = 0;
40583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40588 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
40589 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
40590 uint64_t ret_ref = 0;
40591 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40592 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40595 int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) {
40596 LDKPaymentParameters arg_conv;
40597 arg_conv.inner = untag_ptr(arg);
40598 arg_conv.is_owned = ptr_is_owned(arg);
40599 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40600 arg_conv.is_owned = false;
40601 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
40605 uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) {
40606 LDKPaymentParameters orig_conv;
40607 orig_conv.inner = untag_ptr(orig);
40608 orig_conv.is_owned = ptr_is_owned(orig);
40609 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40610 orig_conv.is_owned = false;
40611 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
40612 uint64_t ret_ref = 0;
40613 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40614 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40618 int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) {
40619 LDKPaymentParameters o_conv;
40620 o_conv.inner = untag_ptr(o);
40621 o_conv.is_owned = ptr_is_owned(o);
40622 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40623 o_conv.is_owned = false;
40624 int64_t ret_conv = PaymentParameters_hash(&o_conv);
40628 jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) {
40629 LDKPaymentParameters a_conv;
40630 a_conv.inner = untag_ptr(a);
40631 a_conv.is_owned = ptr_is_owned(a);
40632 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40633 a_conv.is_owned = false;
40634 LDKPaymentParameters b_conv;
40635 b_conv.inner = untag_ptr(b);
40636 b_conv.is_owned = ptr_is_owned(b);
40637 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40638 b_conv.is_owned = false;
40639 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
40643 int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) {
40644 LDKPaymentParameters obj_conv;
40645 obj_conv.inner = untag_ptr(obj);
40646 obj_conv.is_owned = ptr_is_owned(obj);
40647 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40648 obj_conv.is_owned = false;
40649 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
40650 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40651 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40652 CVec_u8Z_free(ret_var);
40656 uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
40657 LDKu8slice ser_ref;
40658 ser_ref.datalen = ser->arr_len;
40659 ser_ref.data = ser->elems;
40660 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
40661 *ret_conv = PaymentParameters_read(ser_ref);
40663 return tag_ptr(ret_conv, true);
40666 uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
40667 LDKPublicKey payee_pubkey_ref;
40668 CHECK(payee_pubkey->arr_len == 33);
40669 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40670 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
40671 uint64_t ret_ref = 0;
40672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40677 uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
40678 LDKPublicKey payee_pubkey_ref;
40679 CHECK(payee_pubkey->arr_len == 33);
40680 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40681 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
40682 uint64_t ret_ref = 0;
40683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40688 void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) {
40689 LDKRouteHint this_obj_conv;
40690 this_obj_conv.inner = untag_ptr(this_obj);
40691 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40693 RouteHint_free(this_obj_conv);
40696 uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) {
40697 LDKRouteHint this_ptr_conv;
40698 this_ptr_conv.inner = untag_ptr(this_ptr);
40699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40701 this_ptr_conv.is_owned = false;
40702 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
40703 uint64_tArray ret_arr = NULL;
40704 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40705 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40706 for (size_t o = 0; o < ret_var.datalen; o++) {
40707 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
40708 uint64_t ret_conv_14_ref = 0;
40709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
40710 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
40711 ret_arr_ptr[o] = ret_conv_14_ref;
40714 FREE(ret_var.data);
40718 void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) {
40719 LDKRouteHint this_ptr_conv;
40720 this_ptr_conv.inner = untag_ptr(this_ptr);
40721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40723 this_ptr_conv.is_owned = false;
40724 LDKCVec_RouteHintHopZ val_constr;
40725 val_constr.datalen = val->arr_len;
40726 if (val_constr.datalen > 0)
40727 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40729 val_constr.data = NULL;
40730 uint64_t* val_vals = val->elems;
40731 for (size_t o = 0; o < val_constr.datalen; o++) {
40732 uint64_t val_conv_14 = val_vals[o];
40733 LDKRouteHintHop val_conv_14_conv;
40734 val_conv_14_conv.inner = untag_ptr(val_conv_14);
40735 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
40736 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
40737 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
40738 val_constr.data[o] = val_conv_14_conv;
40741 RouteHint_set_a(&this_ptr_conv, val_constr);
40744 uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) {
40745 LDKCVec_RouteHintHopZ a_arg_constr;
40746 a_arg_constr.datalen = a_arg->arr_len;
40747 if (a_arg_constr.datalen > 0)
40748 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40750 a_arg_constr.data = NULL;
40751 uint64_t* a_arg_vals = a_arg->elems;
40752 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
40753 uint64_t a_arg_conv_14 = a_arg_vals[o];
40754 LDKRouteHintHop a_arg_conv_14_conv;
40755 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
40756 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
40757 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
40758 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
40759 a_arg_constr.data[o] = a_arg_conv_14_conv;
40762 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
40763 uint64_t ret_ref = 0;
40764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40769 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
40770 LDKRouteHint ret_var = RouteHint_clone(arg);
40771 uint64_t ret_ref = 0;
40772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40776 int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) {
40777 LDKRouteHint arg_conv;
40778 arg_conv.inner = untag_ptr(arg);
40779 arg_conv.is_owned = ptr_is_owned(arg);
40780 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40781 arg_conv.is_owned = false;
40782 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
40786 uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) {
40787 LDKRouteHint orig_conv;
40788 orig_conv.inner = untag_ptr(orig);
40789 orig_conv.is_owned = ptr_is_owned(orig);
40790 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40791 orig_conv.is_owned = false;
40792 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
40793 uint64_t ret_ref = 0;
40794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40799 int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) {
40800 LDKRouteHint o_conv;
40801 o_conv.inner = untag_ptr(o);
40802 o_conv.is_owned = ptr_is_owned(o);
40803 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40804 o_conv.is_owned = false;
40805 int64_t ret_conv = RouteHint_hash(&o_conv);
40809 jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) {
40810 LDKRouteHint a_conv;
40811 a_conv.inner = untag_ptr(a);
40812 a_conv.is_owned = ptr_is_owned(a);
40813 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40814 a_conv.is_owned = false;
40815 LDKRouteHint b_conv;
40816 b_conv.inner = untag_ptr(b);
40817 b_conv.is_owned = ptr_is_owned(b);
40818 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40819 b_conv.is_owned = false;
40820 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
40824 int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) {
40825 LDKRouteHint obj_conv;
40826 obj_conv.inner = untag_ptr(obj);
40827 obj_conv.is_owned = ptr_is_owned(obj);
40828 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40829 obj_conv.is_owned = false;
40830 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
40831 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40832 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40833 CVec_u8Z_free(ret_var);
40837 uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
40838 LDKu8slice ser_ref;
40839 ser_ref.datalen = ser->arr_len;
40840 ser_ref.data = ser->elems;
40841 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
40842 *ret_conv = RouteHint_read(ser_ref);
40844 return tag_ptr(ret_conv, true);
40847 void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) {
40848 LDKRouteHintHop this_obj_conv;
40849 this_obj_conv.inner = untag_ptr(this_obj);
40850 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40852 RouteHintHop_free(this_obj_conv);
40855 int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) {
40856 LDKRouteHintHop this_ptr_conv;
40857 this_ptr_conv.inner = untag_ptr(this_ptr);
40858 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40860 this_ptr_conv.is_owned = false;
40861 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40862 memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33);
40866 void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) {
40867 LDKRouteHintHop this_ptr_conv;
40868 this_ptr_conv.inner = untag_ptr(this_ptr);
40869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40871 this_ptr_conv.is_owned = false;
40872 LDKPublicKey val_ref;
40873 CHECK(val->arr_len == 33);
40874 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40875 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
40878 int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) {
40879 LDKRouteHintHop this_ptr_conv;
40880 this_ptr_conv.inner = untag_ptr(this_ptr);
40881 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40883 this_ptr_conv.is_owned = false;
40884 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
40888 void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
40889 LDKRouteHintHop this_ptr_conv;
40890 this_ptr_conv.inner = untag_ptr(this_ptr);
40891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40893 this_ptr_conv.is_owned = false;
40894 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
40897 uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) {
40898 LDKRouteHintHop this_ptr_conv;
40899 this_ptr_conv.inner = untag_ptr(this_ptr);
40900 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40902 this_ptr_conv.is_owned = false;
40903 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
40904 uint64_t ret_ref = 0;
40905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40910 void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) {
40911 LDKRouteHintHop this_ptr_conv;
40912 this_ptr_conv.inner = untag_ptr(this_ptr);
40913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40915 this_ptr_conv.is_owned = false;
40916 LDKRoutingFees val_conv;
40917 val_conv.inner = untag_ptr(val);
40918 val_conv.is_owned = ptr_is_owned(val);
40919 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40920 val_conv = RoutingFees_clone(&val_conv);
40921 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
40924 int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) {
40925 LDKRouteHintHop this_ptr_conv;
40926 this_ptr_conv.inner = untag_ptr(this_ptr);
40927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40929 this_ptr_conv.is_owned = false;
40930 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
40934 void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
40935 LDKRouteHintHop this_ptr_conv;
40936 this_ptr_conv.inner = untag_ptr(this_ptr);
40937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40939 this_ptr_conv.is_owned = false;
40940 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
40943 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) {
40944 LDKRouteHintHop this_ptr_conv;
40945 this_ptr_conv.inner = untag_ptr(this_ptr);
40946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40948 this_ptr_conv.is_owned = false;
40949 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40950 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
40951 uint64_t ret_ref = tag_ptr(ret_copy, true);
40955 void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
40956 LDKRouteHintHop this_ptr_conv;
40957 this_ptr_conv.inner = untag_ptr(this_ptr);
40958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40960 this_ptr_conv.is_owned = false;
40961 void* val_ptr = untag_ptr(val);
40962 CHECK_ACCESS(val_ptr);
40963 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40964 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40965 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
40968 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) {
40969 LDKRouteHintHop this_ptr_conv;
40970 this_ptr_conv.inner = untag_ptr(this_ptr);
40971 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40973 this_ptr_conv.is_owned = false;
40974 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40975 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
40976 uint64_t ret_ref = tag_ptr(ret_copy, true);
40980 void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
40981 LDKRouteHintHop this_ptr_conv;
40982 this_ptr_conv.inner = untag_ptr(this_ptr);
40983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40985 this_ptr_conv.is_owned = false;
40986 void* val_ptr = untag_ptr(val);
40987 CHECK_ACCESS(val_ptr);
40988 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40989 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40990 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
40993 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) {
40994 LDKPublicKey src_node_id_arg_ref;
40995 CHECK(src_node_id_arg->arr_len == 33);
40996 memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg);
40997 LDKRoutingFees fees_arg_conv;
40998 fees_arg_conv.inner = untag_ptr(fees_arg);
40999 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
41000 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
41001 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
41002 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
41003 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
41004 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
41005 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
41006 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
41007 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
41008 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
41009 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
41010 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);
41011 uint64_t ret_ref = 0;
41012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41017 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
41018 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
41019 uint64_t ret_ref = 0;
41020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41024 int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) {
41025 LDKRouteHintHop arg_conv;
41026 arg_conv.inner = untag_ptr(arg);
41027 arg_conv.is_owned = ptr_is_owned(arg);
41028 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41029 arg_conv.is_owned = false;
41030 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
41034 uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) {
41035 LDKRouteHintHop orig_conv;
41036 orig_conv.inner = untag_ptr(orig);
41037 orig_conv.is_owned = ptr_is_owned(orig);
41038 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41039 orig_conv.is_owned = false;
41040 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
41041 uint64_t ret_ref = 0;
41042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41043 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41047 int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) {
41048 LDKRouteHintHop o_conv;
41049 o_conv.inner = untag_ptr(o);
41050 o_conv.is_owned = ptr_is_owned(o);
41051 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41052 o_conv.is_owned = false;
41053 int64_t ret_conv = RouteHintHop_hash(&o_conv);
41057 jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) {
41058 LDKRouteHintHop a_conv;
41059 a_conv.inner = untag_ptr(a);
41060 a_conv.is_owned = ptr_is_owned(a);
41061 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41062 a_conv.is_owned = false;
41063 LDKRouteHintHop b_conv;
41064 b_conv.inner = untag_ptr(b);
41065 b_conv.is_owned = ptr_is_owned(b);
41066 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41067 b_conv.is_owned = false;
41068 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
41072 int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) {
41073 LDKRouteHintHop obj_conv;
41074 obj_conv.inner = untag_ptr(obj);
41075 obj_conv.is_owned = ptr_is_owned(obj);
41076 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41077 obj_conv.is_owned = false;
41078 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
41079 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41080 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41081 CVec_u8Z_free(ret_var);
41085 uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
41086 LDKu8slice ser_ref;
41087 ser_ref.datalen = ser->arr_len;
41088 ser_ref.data = ser->elems;
41089 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
41090 *ret_conv = RouteHintHop_read(ser_ref);
41092 return tag_ptr(ret_conv, true);
41095 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) {
41096 LDKPublicKey our_node_pubkey_ref;
41097 CHECK(our_node_pubkey->arr_len == 33);
41098 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
41099 LDKRouteParameters route_params_conv;
41100 route_params_conv.inner = untag_ptr(route_params);
41101 route_params_conv.is_owned = ptr_is_owned(route_params);
41102 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
41103 route_params_conv.is_owned = false;
41104 LDKNetworkGraph network_graph_conv;
41105 network_graph_conv.inner = untag_ptr(network_graph);
41106 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41107 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41108 network_graph_conv.is_owned = false;
41109 LDKCVec_ChannelDetailsZ first_hops_constr;
41110 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
41111 if (first_hops != 0) {
41112 first_hops_constr.datalen = first_hops->arr_len;
41113 if (first_hops_constr.datalen > 0)
41114 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
41116 first_hops_constr.data = NULL;
41117 uint64_t* first_hops_vals = first_hops->elems;
41118 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
41119 uint64_t first_hops_conv_16 = first_hops_vals[q];
41120 LDKChannelDetails first_hops_conv_16_conv;
41121 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
41122 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
41123 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
41124 first_hops_conv_16_conv.is_owned = false;
41125 first_hops_constr.data[q] = first_hops_conv_16_conv;
41128 first_hops_ptr = &first_hops_constr;
41130 void* logger_ptr = untag_ptr(logger);
41131 CHECK_ACCESS(logger_ptr);
41132 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41133 if (logger_conv.free == LDKLogger_JCalls_free) {
41134 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41135 LDKLogger_JCalls_cloned(&logger_conv);
41137 void* scorer_ptr = untag_ptr(scorer);
41138 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
41139 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
41140 unsigned char random_seed_bytes_arr[32];
41141 CHECK(random_seed_bytes->arr_len == 32);
41142 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
41143 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
41144 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
41145 *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);
41146 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
41147 return tag_ptr(ret_conv, true);
41150 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) {
41151 LDKPublicKey our_node_pubkey_ref;
41152 CHECK(our_node_pubkey->arr_len == 33);
41153 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
41154 LDKCVec_PublicKeyZ hops_constr;
41155 hops_constr.datalen = hops->arr_len;
41156 if (hops_constr.datalen > 0)
41157 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
41159 hops_constr.data = NULL;
41160 int8_tArray* hops_vals = (void*) hops->elems;
41161 for (size_t m = 0; m < hops_constr.datalen; m++) {
41162 int8_tArray hops_conv_12 = hops_vals[m];
41163 LDKPublicKey hops_conv_12_ref;
41164 CHECK(hops_conv_12->arr_len == 33);
41165 memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
41166 hops_constr.data[m] = hops_conv_12_ref;
41169 LDKRouteParameters route_params_conv;
41170 route_params_conv.inner = untag_ptr(route_params);
41171 route_params_conv.is_owned = ptr_is_owned(route_params);
41172 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
41173 route_params_conv.is_owned = false;
41174 LDKNetworkGraph network_graph_conv;
41175 network_graph_conv.inner = untag_ptr(network_graph);
41176 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41177 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41178 network_graph_conv.is_owned = false;
41179 void* logger_ptr = untag_ptr(logger);
41180 CHECK_ACCESS(logger_ptr);
41181 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41182 if (logger_conv.free == LDKLogger_JCalls_free) {
41183 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41184 LDKLogger_JCalls_cloned(&logger_conv);
41186 unsigned char random_seed_bytes_arr[32];
41187 CHECK(random_seed_bytes->arr_len == 32);
41188 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
41189 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
41190 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
41191 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
41192 return tag_ptr(ret_conv, true);
41195 void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint64_t this_ptr) {
41196 if (!ptr_is_owned(this_ptr)) return;
41197 void* this_ptr_ptr = untag_ptr(this_ptr);
41198 CHECK_ACCESS(this_ptr_ptr);
41199 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
41200 FREE(untag_ptr(this_ptr));
41201 Score_free(this_ptr_conv);
41204 void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint64_t this_ptr) {
41205 if (!ptr_is_owned(this_ptr)) return;
41206 void* this_ptr_ptr = untag_ptr(this_ptr);
41207 CHECK_ACCESS(this_ptr_ptr);
41208 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
41209 FREE(untag_ptr(this_ptr));
41210 LockableScore_free(this_ptr_conv);
41213 void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
41214 LDKMultiThreadedLockableScore this_obj_conv;
41215 this_obj_conv.inner = untag_ptr(this_obj);
41216 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41218 MultiThreadedLockableScore_free(this_obj_conv);
41221 int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
41222 LDKMultiThreadedLockableScore obj_conv;
41223 obj_conv.inner = untag_ptr(obj);
41224 obj_conv.is_owned = ptr_is_owned(obj);
41225 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41226 obj_conv.is_owned = false;
41227 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
41228 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41229 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41230 CVec_u8Z_free(ret_var);
41234 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
41235 void* score_ptr = untag_ptr(score);
41236 CHECK_ACCESS(score_ptr);
41237 LDKScore score_conv = *(LDKScore*)(score_ptr);
41238 if (score_conv.free == LDKScore_JCalls_free) {
41239 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41240 LDKScore_JCalls_cloned(&score_conv);
41242 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
41243 uint64_t ret_ref = 0;
41244 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41245 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41249 void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) {
41250 LDKChannelUsage this_obj_conv;
41251 this_obj_conv.inner = untag_ptr(this_obj);
41252 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41254 ChannelUsage_free(this_obj_conv);
41257 int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) {
41258 LDKChannelUsage this_ptr_conv;
41259 this_ptr_conv.inner = untag_ptr(this_ptr);
41260 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41262 this_ptr_conv.is_owned = false;
41263 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
41267 void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) {
41268 LDKChannelUsage this_ptr_conv;
41269 this_ptr_conv.inner = untag_ptr(this_ptr);
41270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41272 this_ptr_conv.is_owned = false;
41273 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
41276 int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) {
41277 LDKChannelUsage this_ptr_conv;
41278 this_ptr_conv.inner = untag_ptr(this_ptr);
41279 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41281 this_ptr_conv.is_owned = false;
41282 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
41286 void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) {
41287 LDKChannelUsage this_ptr_conv;
41288 this_ptr_conv.inner = untag_ptr(this_ptr);
41289 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41291 this_ptr_conv.is_owned = false;
41292 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
41295 uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) {
41296 LDKChannelUsage this_ptr_conv;
41297 this_ptr_conv.inner = untag_ptr(this_ptr);
41298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41300 this_ptr_conv.is_owned = false;
41301 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41302 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
41303 uint64_t ret_ref = tag_ptr(ret_copy, true);
41307 void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) {
41308 LDKChannelUsage this_ptr_conv;
41309 this_ptr_conv.inner = untag_ptr(this_ptr);
41310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41312 this_ptr_conv.is_owned = false;
41313 void* val_ptr = untag_ptr(val);
41314 CHECK_ACCESS(val_ptr);
41315 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
41316 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
41317 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
41320 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) {
41321 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
41322 CHECK_ACCESS(effective_capacity_arg_ptr);
41323 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
41324 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
41325 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
41326 uint64_t ret_ref = 0;
41327 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41328 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41332 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
41333 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
41334 uint64_t ret_ref = 0;
41335 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41336 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41339 int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) {
41340 LDKChannelUsage arg_conv;
41341 arg_conv.inner = untag_ptr(arg);
41342 arg_conv.is_owned = ptr_is_owned(arg);
41343 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41344 arg_conv.is_owned = false;
41345 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
41349 uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) {
41350 LDKChannelUsage orig_conv;
41351 orig_conv.inner = untag_ptr(orig);
41352 orig_conv.is_owned = ptr_is_owned(orig);
41353 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41354 orig_conv.is_owned = false;
41355 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
41356 uint64_t ret_ref = 0;
41357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41362 void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) {
41363 LDKFixedPenaltyScorer this_obj_conv;
41364 this_obj_conv.inner = untag_ptr(this_obj);
41365 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41367 FixedPenaltyScorer_free(this_obj_conv);
41370 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
41371 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
41372 uint64_t ret_ref = 0;
41373 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41374 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41377 int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) {
41378 LDKFixedPenaltyScorer arg_conv;
41379 arg_conv.inner = untag_ptr(arg);
41380 arg_conv.is_owned = ptr_is_owned(arg);
41381 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41382 arg_conv.is_owned = false;
41383 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
41387 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) {
41388 LDKFixedPenaltyScorer orig_conv;
41389 orig_conv.inner = untag_ptr(orig);
41390 orig_conv.is_owned = ptr_is_owned(orig);
41391 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41392 orig_conv.is_owned = false;
41393 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
41394 uint64_t ret_ref = 0;
41395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41400 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) {
41401 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
41402 uint64_t ret_ref = 0;
41403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41408 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) {
41409 LDKFixedPenaltyScorer this_arg_conv;
41410 this_arg_conv.inner = untag_ptr(this_arg);
41411 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41413 this_arg_conv.is_owned = false;
41414 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41415 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
41416 return tag_ptr(ret_ret, true);
41419 int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) {
41420 LDKFixedPenaltyScorer obj_conv;
41421 obj_conv.inner = untag_ptr(obj);
41422 obj_conv.is_owned = ptr_is_owned(obj);
41423 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41424 obj_conv.is_owned = false;
41425 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
41426 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41427 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41428 CVec_u8Z_free(ret_var);
41432 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
41433 LDKu8slice ser_ref;
41434 ser_ref.datalen = ser->arr_len;
41435 ser_ref.data = ser->elems;
41436 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
41437 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
41439 return tag_ptr(ret_conv, true);
41442 void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) {
41443 LDKProbabilisticScorer this_obj_conv;
41444 this_obj_conv.inner = untag_ptr(this_obj);
41445 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41447 ProbabilisticScorer_free(this_obj_conv);
41450 void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) {
41451 LDKProbabilisticScoringParameters this_obj_conv;
41452 this_obj_conv.inner = untag_ptr(this_obj);
41453 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41455 ProbabilisticScoringParameters_free(this_obj_conv);
41458 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_msat(uint64_t this_ptr) {
41459 LDKProbabilisticScoringParameters 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 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
41468 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_msat(uint64_t this_ptr, int64_t val) {
41469 LDKProbabilisticScoringParameters this_ptr_conv;
41470 this_ptr_conv.inner = untag_ptr(this_ptr);
41471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41473 this_ptr_conv.is_owned = false;
41474 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
41477 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) {
41478 LDKProbabilisticScoringParameters this_ptr_conv;
41479 this_ptr_conv.inner = untag_ptr(this_ptr);
41480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41482 this_ptr_conv.is_owned = false;
41483 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
41487 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) {
41488 LDKProbabilisticScoringParameters this_ptr_conv;
41489 this_ptr_conv.inner = untag_ptr(this_ptr);
41490 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41492 this_ptr_conv.is_owned = false;
41493 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41496 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
41497 LDKProbabilisticScoringParameters this_ptr_conv;
41498 this_ptr_conv.inner = untag_ptr(this_ptr);
41499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41501 this_ptr_conv.is_owned = false;
41502 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
41506 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) {
41507 LDKProbabilisticScoringParameters this_ptr_conv;
41508 this_ptr_conv.inner = untag_ptr(this_ptr);
41509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41511 this_ptr_conv.is_owned = false;
41512 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
41515 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life(uint64_t this_ptr) {
41516 LDKProbabilisticScoringParameters this_ptr_conv;
41517 this_ptr_conv.inner = untag_ptr(this_ptr);
41518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41520 this_ptr_conv.is_owned = false;
41521 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
41525 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) {
41526 LDKProbabilisticScoringParameters this_ptr_conv;
41527 this_ptr_conv.inner = untag_ptr(this_ptr);
41528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41530 this_ptr_conv.is_owned = false;
41531 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
41534 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) {
41535 LDKProbabilisticScoringParameters this_ptr_conv;
41536 this_ptr_conv.inner = untag_ptr(this_ptr);
41537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41539 this_ptr_conv.is_owned = false;
41540 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
41544 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) {
41545 LDKProbabilisticScoringParameters this_ptr_conv;
41546 this_ptr_conv.inner = untag_ptr(this_ptr);
41547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41549 this_ptr_conv.is_owned = false;
41550 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41553 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
41554 LDKProbabilisticScoringParameters this_ptr_conv;
41555 this_ptr_conv.inner = untag_ptr(this_ptr);
41556 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41558 this_ptr_conv.is_owned = false;
41559 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
41563 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) {
41564 LDKProbabilisticScoringParameters this_ptr_conv;
41565 this_ptr_conv.inner = untag_ptr(this_ptr);
41566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41568 this_ptr_conv.is_owned = false;
41569 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
41572 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(uint64_t this_ptr) {
41573 LDKProbabilisticScoringParameters this_ptr_conv;
41574 this_ptr_conv.inner = untag_ptr(this_ptr);
41575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41577 this_ptr_conv.is_owned = false;
41578 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
41582 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) {
41583 LDKProbabilisticScoringParameters this_ptr_conv;
41584 this_ptr_conv.inner = untag_ptr(this_ptr);
41585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41587 this_ptr_conv.is_owned = false;
41588 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
41591 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
41592 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
41593 uint64_t ret_ref = 0;
41594 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41595 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41598 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) {
41599 LDKProbabilisticScoringParameters arg_conv;
41600 arg_conv.inner = untag_ptr(arg);
41601 arg_conv.is_owned = ptr_is_owned(arg);
41602 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41603 arg_conv.is_owned = false;
41604 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
41608 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) {
41609 LDKProbabilisticScoringParameters orig_conv;
41610 orig_conv.inner = untag_ptr(orig);
41611 orig_conv.is_owned = ptr_is_owned(orig);
41612 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41613 orig_conv.is_owned = false;
41614 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
41615 uint64_t ret_ref = 0;
41616 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41617 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41621 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) {
41622 LDKProbabilisticScoringParameters params_conv;
41623 params_conv.inner = untag_ptr(params);
41624 params_conv.is_owned = ptr_is_owned(params);
41625 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
41626 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
41627 LDKNetworkGraph network_graph_conv;
41628 network_graph_conv.inner = untag_ptr(network_graph);
41629 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41630 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41631 network_graph_conv.is_owned = false;
41632 void* logger_ptr = untag_ptr(logger);
41633 CHECK_ACCESS(logger_ptr);
41634 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41635 if (logger_conv.free == LDKLogger_JCalls_free) {
41636 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41637 LDKLogger_JCalls_cloned(&logger_conv);
41639 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
41640 uint64_t ret_ref = 0;
41641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41646 void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) {
41647 LDKProbabilisticScorer this_arg_conv;
41648 this_arg_conv.inner = untag_ptr(this_arg);
41649 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41651 this_arg_conv.is_owned = false;
41652 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
41655 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) {
41656 LDKProbabilisticScorer this_arg_conv;
41657 this_arg_conv.inner = untag_ptr(this_arg);
41658 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41660 this_arg_conv.is_owned = false;
41661 LDKNodeId target_conv;
41662 target_conv.inner = untag_ptr(target);
41663 target_conv.is_owned = ptr_is_owned(target);
41664 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
41665 target_conv.is_owned = false;
41666 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
41667 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
41668 uint64_t ret_ref = tag_ptr(ret_copy, true);
41672 void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
41673 LDKProbabilisticScorer this_arg_conv;
41674 this_arg_conv.inner = untag_ptr(this_arg);
41675 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41676 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41677 this_arg_conv.is_owned = false;
41678 LDKNodeId node_id_conv;
41679 node_id_conv.inner = untag_ptr(node_id);
41680 node_id_conv.is_owned = ptr_is_owned(node_id);
41681 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41682 node_id_conv.is_owned = false;
41683 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
41686 void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) {
41687 LDKProbabilisticScorer this_arg_conv;
41688 this_arg_conv.inner = untag_ptr(this_arg);
41689 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41691 this_arg_conv.is_owned = false;
41692 LDKNodeId node_id_conv;
41693 node_id_conv.inner = untag_ptr(node_id);
41694 node_id_conv.is_owned = ptr_is_owned(node_id);
41695 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41696 node_id_conv.is_owned = false;
41697 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
41700 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) {
41701 LDKProbabilisticScorer this_arg_conv;
41702 this_arg_conv.inner = untag_ptr(this_arg);
41703 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41705 this_arg_conv.is_owned = false;
41706 LDKNodeId node_id_conv;
41707 node_id_conv.inner = untag_ptr(node_id);
41708 node_id_conv.is_owned = ptr_is_owned(node_id);
41709 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41710 node_id_conv.is_owned = false;
41711 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
41714 void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) {
41715 LDKProbabilisticScorer this_arg_conv;
41716 this_arg_conv.inner = untag_ptr(this_arg);
41717 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41719 this_arg_conv.is_owned = false;
41720 LDKNodeId node_id_conv;
41721 node_id_conv.inner = untag_ptr(node_id);
41722 node_id_conv.is_owned = ptr_is_owned(node_id);
41723 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41724 node_id_conv.is_owned = false;
41725 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
41728 void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) {
41729 LDKProbabilisticScorer this_arg_conv;
41730 this_arg_conv.inner = untag_ptr(this_arg);
41731 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41733 this_arg_conv.is_owned = false;
41734 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
41737 void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) {
41738 LDKProbabilisticScoringParameters this_arg_conv;
41739 this_arg_conv.inner = untag_ptr(this_arg);
41740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41742 this_arg_conv.is_owned = false;
41743 LDKCVec_NodeIdZ node_ids_constr;
41744 node_ids_constr.datalen = node_ids->arr_len;
41745 if (node_ids_constr.datalen > 0)
41746 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
41748 node_ids_constr.data = NULL;
41749 uint64_t* node_ids_vals = node_ids->elems;
41750 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
41751 uint64_t node_ids_conv_8 = node_ids_vals[i];
41752 LDKNodeId node_ids_conv_8_conv;
41753 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
41754 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
41755 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
41756 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
41757 node_ids_constr.data[i] = node_ids_conv_8_conv;
41760 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
41763 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() {
41764 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
41765 uint64_t ret_ref = 0;
41766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41771 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) {
41772 LDKProbabilisticScorer this_arg_conv;
41773 this_arg_conv.inner = untag_ptr(this_arg);
41774 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41776 this_arg_conv.is_owned = false;
41777 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41778 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
41779 return tag_ptr(ret_ret, true);
41782 int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) {
41783 LDKProbabilisticScorer obj_conv;
41784 obj_conv.inner = untag_ptr(obj);
41785 obj_conv.is_owned = ptr_is_owned(obj);
41786 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41787 obj_conv.is_owned = false;
41788 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
41789 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41790 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41791 CVec_u8Z_free(ret_var);
41795 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) {
41796 LDKu8slice ser_ref;
41797 ser_ref.datalen = ser->arr_len;
41798 ser_ref.data = ser->elems;
41799 LDKProbabilisticScoringParameters arg_a_conv;
41800 arg_a_conv.inner = untag_ptr(arg_a);
41801 arg_a_conv.is_owned = ptr_is_owned(arg_a);
41802 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
41803 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
41804 LDKNetworkGraph arg_b_conv;
41805 arg_b_conv.inner = untag_ptr(arg_b);
41806 arg_b_conv.is_owned = ptr_is_owned(arg_b);
41807 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
41808 arg_b_conv.is_owned = false;
41809 void* arg_c_ptr = untag_ptr(arg_c);
41810 CHECK_ACCESS(arg_c_ptr);
41811 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
41812 if (arg_c_conv.free == LDKLogger_JCalls_free) {
41813 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41814 LDKLogger_JCalls_cloned(&arg_c_conv);
41816 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
41817 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
41819 return tag_ptr(ret_conv, true);
41822 void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
41823 if (!ptr_is_owned(this_ptr)) return;
41824 void* this_ptr_ptr = untag_ptr(this_ptr);
41825 CHECK_ACCESS(this_ptr_ptr);
41826 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
41827 FREE(untag_ptr(this_ptr));
41828 ParseError_free(this_ptr_conv);
41831 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
41832 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41833 *ret_copy = ParseError_clone(arg);
41834 uint64_t ret_ref = tag_ptr(ret_copy, true);
41837 int64_t __attribute__((export_name("TS_ParseError_clone_ptr"))) TS_ParseError_clone_ptr(uint64_t arg) {
41838 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
41839 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
41843 uint64_t __attribute__((export_name("TS_ParseError_clone"))) TS_ParseError_clone(uint64_t orig) {
41844 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
41845 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41846 *ret_copy = ParseError_clone(orig_conv);
41847 uint64_t ret_ref = tag_ptr(ret_copy, true);
41851 uint64_t __attribute__((export_name("TS_ParseError_bech32_error"))) TS_ParseError_bech32_error(uint64_t a) {
41852 void* a_ptr = untag_ptr(a);
41853 CHECK_ACCESS(a_ptr);
41854 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
41855 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
41856 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41857 *ret_copy = ParseError_bech32_error(a_conv);
41858 uint64_t ret_ref = tag_ptr(ret_copy, true);
41862 uint64_t __attribute__((export_name("TS_ParseError_parse_amount_error"))) TS_ParseError_parse_amount_error(int32_t a) {
41864 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41865 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
41866 uint64_t ret_ref = tag_ptr(ret_copy, true);
41870 uint64_t __attribute__((export_name("TS_ParseError_malformed_signature"))) TS_ParseError_malformed_signature(uint32_t a) {
41871 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
41872 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41873 *ret_copy = ParseError_malformed_signature(a_conv);
41874 uint64_t ret_ref = tag_ptr(ret_copy, true);
41878 uint64_t __attribute__((export_name("TS_ParseError_bad_prefix"))) TS_ParseError_bad_prefix() {
41879 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41880 *ret_copy = ParseError_bad_prefix();
41881 uint64_t ret_ref = tag_ptr(ret_copy, true);
41885 uint64_t __attribute__((export_name("TS_ParseError_unknown_currency"))) TS_ParseError_unknown_currency() {
41886 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41887 *ret_copy = ParseError_unknown_currency();
41888 uint64_t ret_ref = tag_ptr(ret_copy, true);
41892 uint64_t __attribute__((export_name("TS_ParseError_unknown_si_prefix"))) TS_ParseError_unknown_si_prefix() {
41893 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41894 *ret_copy = ParseError_unknown_si_prefix();
41895 uint64_t ret_ref = tag_ptr(ret_copy, true);
41899 uint64_t __attribute__((export_name("TS_ParseError_malformed_hrp"))) TS_ParseError_malformed_hrp() {
41900 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41901 *ret_copy = ParseError_malformed_hrp();
41902 uint64_t ret_ref = tag_ptr(ret_copy, true);
41906 uint64_t __attribute__((export_name("TS_ParseError_too_short_data_part"))) TS_ParseError_too_short_data_part() {
41907 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41908 *ret_copy = ParseError_too_short_data_part();
41909 uint64_t ret_ref = tag_ptr(ret_copy, true);
41913 uint64_t __attribute__((export_name("TS_ParseError_unexpected_end_of_tagged_fields"))) TS_ParseError_unexpected_end_of_tagged_fields() {
41914 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41915 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
41916 uint64_t ret_ref = tag_ptr(ret_copy, true);
41920 uint64_t __attribute__((export_name("TS_ParseError_description_decode_error"))) TS_ParseError_description_decode_error(int32_t a) {
41922 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41923 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
41924 uint64_t ret_ref = tag_ptr(ret_copy, true);
41928 uint64_t __attribute__((export_name("TS_ParseError_padding_error"))) TS_ParseError_padding_error() {
41929 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41930 *ret_copy = ParseError_padding_error();
41931 uint64_t ret_ref = tag_ptr(ret_copy, true);
41935 uint64_t __attribute__((export_name("TS_ParseError_integer_overflow_error"))) TS_ParseError_integer_overflow_error() {
41936 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41937 *ret_copy = ParseError_integer_overflow_error();
41938 uint64_t ret_ref = tag_ptr(ret_copy, true);
41942 uint64_t __attribute__((export_name("TS_ParseError_invalid_seg_wit_program_length"))) TS_ParseError_invalid_seg_wit_program_length() {
41943 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41944 *ret_copy = ParseError_invalid_seg_wit_program_length();
41945 uint64_t ret_ref = tag_ptr(ret_copy, true);
41949 uint64_t __attribute__((export_name("TS_ParseError_invalid_pub_key_hash_length"))) TS_ParseError_invalid_pub_key_hash_length() {
41950 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41951 *ret_copy = ParseError_invalid_pub_key_hash_length();
41952 uint64_t ret_ref = tag_ptr(ret_copy, true);
41956 uint64_t __attribute__((export_name("TS_ParseError_invalid_script_hash_length"))) TS_ParseError_invalid_script_hash_length() {
41957 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41958 *ret_copy = ParseError_invalid_script_hash_length();
41959 uint64_t ret_ref = tag_ptr(ret_copy, true);
41963 uint64_t __attribute__((export_name("TS_ParseError_invalid_recovery_id"))) TS_ParseError_invalid_recovery_id() {
41964 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41965 *ret_copy = ParseError_invalid_recovery_id();
41966 uint64_t ret_ref = tag_ptr(ret_copy, true);
41970 uint64_t __attribute__((export_name("TS_ParseError_invalid_slice_length"))) TS_ParseError_invalid_slice_length(jstring a) {
41971 LDKStr a_conv = str_ref_to_owned_c(a);
41972 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41973 *ret_copy = ParseError_invalid_slice_length(a_conv);
41974 uint64_t ret_ref = tag_ptr(ret_copy, true);
41978 uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip() {
41979 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41980 *ret_copy = ParseError_skip();
41981 uint64_t ret_ref = tag_ptr(ret_copy, true);
41985 void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
41986 if (!ptr_is_owned(this_ptr)) return;
41987 void* this_ptr_ptr = untag_ptr(this_ptr);
41988 CHECK_ACCESS(this_ptr_ptr);
41989 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
41990 FREE(untag_ptr(this_ptr));
41991 ParseOrSemanticError_free(this_ptr_conv);
41994 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
41995 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41996 *ret_copy = ParseOrSemanticError_clone(arg);
41997 uint64_t ret_ref = tag_ptr(ret_copy, true);
42000 int64_t __attribute__((export_name("TS_ParseOrSemanticError_clone_ptr"))) TS_ParseOrSemanticError_clone_ptr(uint64_t arg) {
42001 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
42002 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
42006 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_clone"))) TS_ParseOrSemanticError_clone(uint64_t orig) {
42007 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
42008 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42009 *ret_copy = ParseOrSemanticError_clone(orig_conv);
42010 uint64_t ret_ref = tag_ptr(ret_copy, true);
42014 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_parse_error"))) TS_ParseOrSemanticError_parse_error(uint64_t a) {
42015 void* a_ptr = untag_ptr(a);
42016 CHECK_ACCESS(a_ptr);
42017 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
42018 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
42019 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42020 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
42021 uint64_t ret_ref = tag_ptr(ret_copy, true);
42025 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) TS_ParseOrSemanticError_semantic_error(uint32_t a) {
42026 LDKSemanticError a_conv = LDKSemanticError_from_js(a);
42027 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42028 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
42029 uint64_t ret_ref = tag_ptr(ret_copy, true);
42033 void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
42034 LDKInvoice this_obj_conv;
42035 this_obj_conv.inner = untag_ptr(this_obj);
42036 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42038 Invoice_free(this_obj_conv);
42041 jboolean __attribute__((export_name("TS_Invoice_eq"))) TS_Invoice_eq(uint64_t a, uint64_t b) {
42043 a_conv.inner = untag_ptr(a);
42044 a_conv.is_owned = ptr_is_owned(a);
42045 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42046 a_conv.is_owned = false;
42048 b_conv.inner = untag_ptr(b);
42049 b_conv.is_owned = ptr_is_owned(b);
42050 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42051 b_conv.is_owned = false;
42052 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
42056 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
42057 LDKInvoice ret_var = Invoice_clone(arg);
42058 uint64_t ret_ref = 0;
42059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42063 int64_t __attribute__((export_name("TS_Invoice_clone_ptr"))) TS_Invoice_clone_ptr(uint64_t arg) {
42064 LDKInvoice arg_conv;
42065 arg_conv.inner = untag_ptr(arg);
42066 arg_conv.is_owned = ptr_is_owned(arg);
42067 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42068 arg_conv.is_owned = false;
42069 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
42073 uint64_t __attribute__((export_name("TS_Invoice_clone"))) TS_Invoice_clone(uint64_t orig) {
42074 LDKInvoice orig_conv;
42075 orig_conv.inner = untag_ptr(orig);
42076 orig_conv.is_owned = ptr_is_owned(orig);
42077 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42078 orig_conv.is_owned = false;
42079 LDKInvoice ret_var = Invoice_clone(&orig_conv);
42080 uint64_t ret_ref = 0;
42081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42086 void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
42087 LDKSignedRawInvoice this_obj_conv;
42088 this_obj_conv.inner = untag_ptr(this_obj);
42089 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42091 SignedRawInvoice_free(this_obj_conv);
42094 jboolean __attribute__((export_name("TS_SignedRawInvoice_eq"))) TS_SignedRawInvoice_eq(uint64_t a, uint64_t b) {
42095 LDKSignedRawInvoice a_conv;
42096 a_conv.inner = untag_ptr(a);
42097 a_conv.is_owned = ptr_is_owned(a);
42098 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42099 a_conv.is_owned = false;
42100 LDKSignedRawInvoice b_conv;
42101 b_conv.inner = untag_ptr(b);
42102 b_conv.is_owned = ptr_is_owned(b);
42103 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42104 b_conv.is_owned = false;
42105 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
42109 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
42110 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
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);
42116 int64_t __attribute__((export_name("TS_SignedRawInvoice_clone_ptr"))) TS_SignedRawInvoice_clone_ptr(uint64_t arg) {
42117 LDKSignedRawInvoice arg_conv;
42118 arg_conv.inner = untag_ptr(arg);
42119 arg_conv.is_owned = ptr_is_owned(arg);
42120 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42121 arg_conv.is_owned = false;
42122 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
42126 uint64_t __attribute__((export_name("TS_SignedRawInvoice_clone"))) TS_SignedRawInvoice_clone(uint64_t orig) {
42127 LDKSignedRawInvoice orig_conv;
42128 orig_conv.inner = untag_ptr(orig);
42129 orig_conv.is_owned = ptr_is_owned(orig);
42130 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42131 orig_conv.is_owned = false;
42132 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
42133 uint64_t ret_ref = 0;
42134 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42135 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42139 void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
42140 LDKRawInvoice this_obj_conv;
42141 this_obj_conv.inner = untag_ptr(this_obj);
42142 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42144 RawInvoice_free(this_obj_conv);
42147 uint64_t __attribute__((export_name("TS_RawInvoice_get_data"))) TS_RawInvoice_get_data(uint64_t this_ptr) {
42148 LDKRawInvoice this_ptr_conv;
42149 this_ptr_conv.inner = untag_ptr(this_ptr);
42150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42152 this_ptr_conv.is_owned = false;
42153 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
42154 uint64_t ret_ref = 0;
42155 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42156 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42160 void __attribute__((export_name("TS_RawInvoice_set_data"))) TS_RawInvoice_set_data(uint64_t this_ptr, uint64_t val) {
42161 LDKRawInvoice this_ptr_conv;
42162 this_ptr_conv.inner = untag_ptr(this_ptr);
42163 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42165 this_ptr_conv.is_owned = false;
42166 LDKRawDataPart val_conv;
42167 val_conv.inner = untag_ptr(val);
42168 val_conv.is_owned = ptr_is_owned(val);
42169 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42170 val_conv = RawDataPart_clone(&val_conv);
42171 RawInvoice_set_data(&this_ptr_conv, val_conv);
42174 jboolean __attribute__((export_name("TS_RawInvoice_eq"))) TS_RawInvoice_eq(uint64_t a, uint64_t b) {
42175 LDKRawInvoice a_conv;
42176 a_conv.inner = untag_ptr(a);
42177 a_conv.is_owned = ptr_is_owned(a);
42178 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42179 a_conv.is_owned = false;
42180 LDKRawInvoice b_conv;
42181 b_conv.inner = untag_ptr(b);
42182 b_conv.is_owned = ptr_is_owned(b);
42183 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42184 b_conv.is_owned = false;
42185 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
42189 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
42190 LDKRawInvoice ret_var = RawInvoice_clone(arg);
42191 uint64_t ret_ref = 0;
42192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42196 int64_t __attribute__((export_name("TS_RawInvoice_clone_ptr"))) TS_RawInvoice_clone_ptr(uint64_t arg) {
42197 LDKRawInvoice arg_conv;
42198 arg_conv.inner = untag_ptr(arg);
42199 arg_conv.is_owned = ptr_is_owned(arg);
42200 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42201 arg_conv.is_owned = false;
42202 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
42206 uint64_t __attribute__((export_name("TS_RawInvoice_clone"))) TS_RawInvoice_clone(uint64_t orig) {
42207 LDKRawInvoice orig_conv;
42208 orig_conv.inner = untag_ptr(orig);
42209 orig_conv.is_owned = ptr_is_owned(orig);
42210 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42211 orig_conv.is_owned = false;
42212 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
42213 uint64_t ret_ref = 0;
42214 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42215 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42219 void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
42220 LDKRawDataPart this_obj_conv;
42221 this_obj_conv.inner = untag_ptr(this_obj);
42222 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42224 RawDataPart_free(this_obj_conv);
42227 uint64_t __attribute__((export_name("TS_RawDataPart_get_timestamp"))) TS_RawDataPart_get_timestamp(uint64_t this_ptr) {
42228 LDKRawDataPart this_ptr_conv;
42229 this_ptr_conv.inner = untag_ptr(this_ptr);
42230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42232 this_ptr_conv.is_owned = false;
42233 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
42234 uint64_t ret_ref = 0;
42235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42240 void __attribute__((export_name("TS_RawDataPart_set_timestamp"))) TS_RawDataPart_set_timestamp(uint64_t this_ptr, uint64_t val) {
42241 LDKRawDataPart this_ptr_conv;
42242 this_ptr_conv.inner = untag_ptr(this_ptr);
42243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42245 this_ptr_conv.is_owned = false;
42246 LDKPositiveTimestamp val_conv;
42247 val_conv.inner = untag_ptr(val);
42248 val_conv.is_owned = ptr_is_owned(val);
42249 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42250 val_conv = PositiveTimestamp_clone(&val_conv);
42251 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
42254 jboolean __attribute__((export_name("TS_RawDataPart_eq"))) TS_RawDataPart_eq(uint64_t a, uint64_t b) {
42255 LDKRawDataPart a_conv;
42256 a_conv.inner = untag_ptr(a);
42257 a_conv.is_owned = ptr_is_owned(a);
42258 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42259 a_conv.is_owned = false;
42260 LDKRawDataPart b_conv;
42261 b_conv.inner = untag_ptr(b);
42262 b_conv.is_owned = ptr_is_owned(b);
42263 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42264 b_conv.is_owned = false;
42265 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
42269 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
42270 LDKRawDataPart ret_var = RawDataPart_clone(arg);
42271 uint64_t ret_ref = 0;
42272 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42273 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42276 int64_t __attribute__((export_name("TS_RawDataPart_clone_ptr"))) TS_RawDataPart_clone_ptr(uint64_t arg) {
42277 LDKRawDataPart arg_conv;
42278 arg_conv.inner = untag_ptr(arg);
42279 arg_conv.is_owned = ptr_is_owned(arg);
42280 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42281 arg_conv.is_owned = false;
42282 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
42286 uint64_t __attribute__((export_name("TS_RawDataPart_clone"))) TS_RawDataPart_clone(uint64_t orig) {
42287 LDKRawDataPart orig_conv;
42288 orig_conv.inner = untag_ptr(orig);
42289 orig_conv.is_owned = ptr_is_owned(orig);
42290 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42291 orig_conv.is_owned = false;
42292 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
42293 uint64_t ret_ref = 0;
42294 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42295 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42299 void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
42300 LDKPositiveTimestamp this_obj_conv;
42301 this_obj_conv.inner = untag_ptr(this_obj);
42302 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42304 PositiveTimestamp_free(this_obj_conv);
42307 jboolean __attribute__((export_name("TS_PositiveTimestamp_eq"))) TS_PositiveTimestamp_eq(uint64_t a, uint64_t b) {
42308 LDKPositiveTimestamp a_conv;
42309 a_conv.inner = untag_ptr(a);
42310 a_conv.is_owned = ptr_is_owned(a);
42311 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42312 a_conv.is_owned = false;
42313 LDKPositiveTimestamp b_conv;
42314 b_conv.inner = untag_ptr(b);
42315 b_conv.is_owned = ptr_is_owned(b);
42316 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42317 b_conv.is_owned = false;
42318 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
42322 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
42323 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
42324 uint64_t ret_ref = 0;
42325 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42326 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42329 int64_t __attribute__((export_name("TS_PositiveTimestamp_clone_ptr"))) TS_PositiveTimestamp_clone_ptr(uint64_t arg) {
42330 LDKPositiveTimestamp arg_conv;
42331 arg_conv.inner = untag_ptr(arg);
42332 arg_conv.is_owned = ptr_is_owned(arg);
42333 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42334 arg_conv.is_owned = false;
42335 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
42339 uint64_t __attribute__((export_name("TS_PositiveTimestamp_clone"))) TS_PositiveTimestamp_clone(uint64_t orig) {
42340 LDKPositiveTimestamp orig_conv;
42341 orig_conv.inner = untag_ptr(orig);
42342 orig_conv.is_owned = ptr_is_owned(orig);
42343 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42344 orig_conv.is_owned = false;
42345 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
42346 uint64_t ret_ref = 0;
42347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42352 uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
42353 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
42354 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
42358 uint32_t __attribute__((export_name("TS_SiPrefix_milli"))) TS_SiPrefix_milli() {
42359 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
42363 uint32_t __attribute__((export_name("TS_SiPrefix_micro"))) TS_SiPrefix_micro() {
42364 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
42368 uint32_t __attribute__((export_name("TS_SiPrefix_nano"))) TS_SiPrefix_nano() {
42369 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
42373 uint32_t __attribute__((export_name("TS_SiPrefix_pico"))) TS_SiPrefix_pico() {
42374 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
42378 jboolean __attribute__((export_name("TS_SiPrefix_eq"))) TS_SiPrefix_eq(uint64_t a, uint64_t b) {
42379 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
42380 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
42381 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
42385 int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
42386 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
42387 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
42391 uint32_t __attribute__((export_name("TS_Currency_clone"))) TS_Currency_clone(uint64_t orig) {
42392 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
42393 uint32_t ret_conv = LDKCurrency_to_js(Currency_clone(orig_conv));
42397 uint32_t __attribute__((export_name("TS_Currency_bitcoin"))) TS_Currency_bitcoin() {
42398 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
42402 uint32_t __attribute__((export_name("TS_Currency_bitcoin_testnet"))) TS_Currency_bitcoin_testnet() {
42403 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
42407 uint32_t __attribute__((export_name("TS_Currency_regtest"))) TS_Currency_regtest() {
42408 uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
42412 uint32_t __attribute__((export_name("TS_Currency_simnet"))) TS_Currency_simnet() {
42413 uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
42417 uint32_t __attribute__((export_name("TS_Currency_signet"))) TS_Currency_signet() {
42418 uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
42422 int64_t __attribute__((export_name("TS_Currency_hash"))) TS_Currency_hash(uint64_t o) {
42423 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
42424 int64_t ret_conv = Currency_hash(o_conv);
42428 jboolean __attribute__((export_name("TS_Currency_eq"))) TS_Currency_eq(uint64_t a, uint64_t b) {
42429 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
42430 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
42431 jboolean ret_conv = Currency_eq(a_conv, b_conv);
42435 void __attribute__((export_name("TS_Sha256_free"))) TS_Sha256_free(uint64_t this_obj) {
42436 LDKSha256 this_obj_conv;
42437 this_obj_conv.inner = untag_ptr(this_obj);
42438 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42440 Sha256_free(this_obj_conv);
42443 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
42444 LDKSha256 ret_var = Sha256_clone(arg);
42445 uint64_t ret_ref = 0;
42446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42450 int64_t __attribute__((export_name("TS_Sha256_clone_ptr"))) TS_Sha256_clone_ptr(uint64_t arg) {
42451 LDKSha256 arg_conv;
42452 arg_conv.inner = untag_ptr(arg);
42453 arg_conv.is_owned = ptr_is_owned(arg);
42454 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42455 arg_conv.is_owned = false;
42456 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
42460 uint64_t __attribute__((export_name("TS_Sha256_clone"))) TS_Sha256_clone(uint64_t orig) {
42461 LDKSha256 orig_conv;
42462 orig_conv.inner = untag_ptr(orig);
42463 orig_conv.is_owned = ptr_is_owned(orig);
42464 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42465 orig_conv.is_owned = false;
42466 LDKSha256 ret_var = Sha256_clone(&orig_conv);
42467 uint64_t ret_ref = 0;
42468 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42469 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42473 int64_t __attribute__((export_name("TS_Sha256_hash"))) TS_Sha256_hash(uint64_t o) {
42475 o_conv.inner = untag_ptr(o);
42476 o_conv.is_owned = ptr_is_owned(o);
42477 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42478 o_conv.is_owned = false;
42479 int64_t ret_conv = Sha256_hash(&o_conv);
42483 jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, uint64_t b) {
42485 a_conv.inner = untag_ptr(a);
42486 a_conv.is_owned = ptr_is_owned(a);
42487 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42488 a_conv.is_owned = false;
42490 b_conv.inner = untag_ptr(b);
42491 b_conv.is_owned = ptr_is_owned(b);
42492 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42493 b_conv.is_owned = false;
42494 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
42498 void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) {
42499 LDKDescription this_obj_conv;
42500 this_obj_conv.inner = untag_ptr(this_obj);
42501 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42503 Description_free(this_obj_conv);
42506 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
42507 LDKDescription ret_var = Description_clone(arg);
42508 uint64_t ret_ref = 0;
42509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42513 int64_t __attribute__((export_name("TS_Description_clone_ptr"))) TS_Description_clone_ptr(uint64_t arg) {
42514 LDKDescription arg_conv;
42515 arg_conv.inner = untag_ptr(arg);
42516 arg_conv.is_owned = ptr_is_owned(arg);
42517 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42518 arg_conv.is_owned = false;
42519 int64_t ret_conv = Description_clone_ptr(&arg_conv);
42523 uint64_t __attribute__((export_name("TS_Description_clone"))) TS_Description_clone(uint64_t orig) {
42524 LDKDescription orig_conv;
42525 orig_conv.inner = untag_ptr(orig);
42526 orig_conv.is_owned = ptr_is_owned(orig);
42527 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42528 orig_conv.is_owned = false;
42529 LDKDescription ret_var = Description_clone(&orig_conv);
42530 uint64_t ret_ref = 0;
42531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42532 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42536 int64_t __attribute__((export_name("TS_Description_hash"))) TS_Description_hash(uint64_t o) {
42537 LDKDescription o_conv;
42538 o_conv.inner = untag_ptr(o);
42539 o_conv.is_owned = ptr_is_owned(o);
42540 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42541 o_conv.is_owned = false;
42542 int64_t ret_conv = Description_hash(&o_conv);
42546 jboolean __attribute__((export_name("TS_Description_eq"))) TS_Description_eq(uint64_t a, uint64_t b) {
42547 LDKDescription a_conv;
42548 a_conv.inner = untag_ptr(a);
42549 a_conv.is_owned = ptr_is_owned(a);
42550 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42551 a_conv.is_owned = false;
42552 LDKDescription b_conv;
42553 b_conv.inner = untag_ptr(b);
42554 b_conv.is_owned = ptr_is_owned(b);
42555 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42556 b_conv.is_owned = false;
42557 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
42561 void __attribute__((export_name("TS_PayeePubKey_free"))) TS_PayeePubKey_free(uint64_t this_obj) {
42562 LDKPayeePubKey this_obj_conv;
42563 this_obj_conv.inner = untag_ptr(this_obj);
42564 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42566 PayeePubKey_free(this_obj_conv);
42569 int8_tArray __attribute__((export_name("TS_PayeePubKey_get_a"))) TS_PayeePubKey_get_a(uint64_t this_ptr) {
42570 LDKPayeePubKey this_ptr_conv;
42571 this_ptr_conv.inner = untag_ptr(this_ptr);
42572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42574 this_ptr_conv.is_owned = false;
42575 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42576 memcpy(ret_arr->elems, PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
42580 void __attribute__((export_name("TS_PayeePubKey_set_a"))) TS_PayeePubKey_set_a(uint64_t this_ptr, int8_tArray val) {
42581 LDKPayeePubKey this_ptr_conv;
42582 this_ptr_conv.inner = untag_ptr(this_ptr);
42583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42585 this_ptr_conv.is_owned = false;
42586 LDKPublicKey val_ref;
42587 CHECK(val->arr_len == 33);
42588 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42589 PayeePubKey_set_a(&this_ptr_conv, val_ref);
42592 uint64_t __attribute__((export_name("TS_PayeePubKey_new"))) TS_PayeePubKey_new(int8_tArray a_arg) {
42593 LDKPublicKey a_arg_ref;
42594 CHECK(a_arg->arr_len == 33);
42595 memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg);
42596 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
42597 uint64_t ret_ref = 0;
42598 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42599 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42603 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
42604 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
42605 uint64_t ret_ref = 0;
42606 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42607 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42610 int64_t __attribute__((export_name("TS_PayeePubKey_clone_ptr"))) TS_PayeePubKey_clone_ptr(uint64_t arg) {
42611 LDKPayeePubKey arg_conv;
42612 arg_conv.inner = untag_ptr(arg);
42613 arg_conv.is_owned = ptr_is_owned(arg);
42614 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42615 arg_conv.is_owned = false;
42616 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
42620 uint64_t __attribute__((export_name("TS_PayeePubKey_clone"))) TS_PayeePubKey_clone(uint64_t orig) {
42621 LDKPayeePubKey orig_conv;
42622 orig_conv.inner = untag_ptr(orig);
42623 orig_conv.is_owned = ptr_is_owned(orig);
42624 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42625 orig_conv.is_owned = false;
42626 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
42627 uint64_t ret_ref = 0;
42628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42633 int64_t __attribute__((export_name("TS_PayeePubKey_hash"))) TS_PayeePubKey_hash(uint64_t o) {
42634 LDKPayeePubKey o_conv;
42635 o_conv.inner = untag_ptr(o);
42636 o_conv.is_owned = ptr_is_owned(o);
42637 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42638 o_conv.is_owned = false;
42639 int64_t ret_conv = PayeePubKey_hash(&o_conv);
42643 jboolean __attribute__((export_name("TS_PayeePubKey_eq"))) TS_PayeePubKey_eq(uint64_t a, uint64_t b) {
42644 LDKPayeePubKey a_conv;
42645 a_conv.inner = untag_ptr(a);
42646 a_conv.is_owned = ptr_is_owned(a);
42647 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42648 a_conv.is_owned = false;
42649 LDKPayeePubKey b_conv;
42650 b_conv.inner = untag_ptr(b);
42651 b_conv.is_owned = ptr_is_owned(b);
42652 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42653 b_conv.is_owned = false;
42654 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
42658 void __attribute__((export_name("TS_ExpiryTime_free"))) TS_ExpiryTime_free(uint64_t this_obj) {
42659 LDKExpiryTime this_obj_conv;
42660 this_obj_conv.inner = untag_ptr(this_obj);
42661 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42663 ExpiryTime_free(this_obj_conv);
42666 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
42667 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
42668 uint64_t ret_ref = 0;
42669 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42670 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42673 int64_t __attribute__((export_name("TS_ExpiryTime_clone_ptr"))) TS_ExpiryTime_clone_ptr(uint64_t arg) {
42674 LDKExpiryTime arg_conv;
42675 arg_conv.inner = untag_ptr(arg);
42676 arg_conv.is_owned = ptr_is_owned(arg);
42677 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42678 arg_conv.is_owned = false;
42679 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
42683 uint64_t __attribute__((export_name("TS_ExpiryTime_clone"))) TS_ExpiryTime_clone(uint64_t orig) {
42684 LDKExpiryTime orig_conv;
42685 orig_conv.inner = untag_ptr(orig);
42686 orig_conv.is_owned = ptr_is_owned(orig);
42687 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42688 orig_conv.is_owned = false;
42689 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
42690 uint64_t ret_ref = 0;
42691 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42692 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42696 int64_t __attribute__((export_name("TS_ExpiryTime_hash"))) TS_ExpiryTime_hash(uint64_t o) {
42697 LDKExpiryTime o_conv;
42698 o_conv.inner = untag_ptr(o);
42699 o_conv.is_owned = ptr_is_owned(o);
42700 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42701 o_conv.is_owned = false;
42702 int64_t ret_conv = ExpiryTime_hash(&o_conv);
42706 jboolean __attribute__((export_name("TS_ExpiryTime_eq"))) TS_ExpiryTime_eq(uint64_t a, uint64_t b) {
42707 LDKExpiryTime a_conv;
42708 a_conv.inner = untag_ptr(a);
42709 a_conv.is_owned = ptr_is_owned(a);
42710 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42711 a_conv.is_owned = false;
42712 LDKExpiryTime b_conv;
42713 b_conv.inner = untag_ptr(b);
42714 b_conv.is_owned = ptr_is_owned(b);
42715 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42716 b_conv.is_owned = false;
42717 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
42721 void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
42722 LDKMinFinalCltvExpiry this_obj_conv;
42723 this_obj_conv.inner = untag_ptr(this_obj);
42724 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42726 MinFinalCltvExpiry_free(this_obj_conv);
42729 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
42730 LDKMinFinalCltvExpiry this_ptr_conv;
42731 this_ptr_conv.inner = untag_ptr(this_ptr);
42732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42734 this_ptr_conv.is_owned = false;
42735 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
42739 void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
42740 LDKMinFinalCltvExpiry this_ptr_conv;
42741 this_ptr_conv.inner = untag_ptr(this_ptr);
42742 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42744 this_ptr_conv.is_owned = false;
42745 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
42748 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
42749 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
42750 uint64_t ret_ref = 0;
42751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42756 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
42757 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
42758 uint64_t ret_ref = 0;
42759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42763 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
42764 LDKMinFinalCltvExpiry arg_conv;
42765 arg_conv.inner = untag_ptr(arg);
42766 arg_conv.is_owned = ptr_is_owned(arg);
42767 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42768 arg_conv.is_owned = false;
42769 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
42773 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
42774 LDKMinFinalCltvExpiry orig_conv;
42775 orig_conv.inner = untag_ptr(orig);
42776 orig_conv.is_owned = ptr_is_owned(orig);
42777 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42778 orig_conv.is_owned = false;
42779 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
42780 uint64_t ret_ref = 0;
42781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42786 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
42787 LDKMinFinalCltvExpiry o_conv;
42788 o_conv.inner = untag_ptr(o);
42789 o_conv.is_owned = ptr_is_owned(o);
42790 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42791 o_conv.is_owned = false;
42792 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
42796 jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
42797 LDKMinFinalCltvExpiry a_conv;
42798 a_conv.inner = untag_ptr(a);
42799 a_conv.is_owned = ptr_is_owned(a);
42800 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42801 a_conv.is_owned = false;
42802 LDKMinFinalCltvExpiry b_conv;
42803 b_conv.inner = untag_ptr(b);
42804 b_conv.is_owned = ptr_is_owned(b);
42805 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42806 b_conv.is_owned = false;
42807 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
42811 void __attribute__((export_name("TS_Fallback_free"))) TS_Fallback_free(uint64_t this_ptr) {
42812 if (!ptr_is_owned(this_ptr)) return;
42813 void* this_ptr_ptr = untag_ptr(this_ptr);
42814 CHECK_ACCESS(this_ptr_ptr);
42815 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
42816 FREE(untag_ptr(this_ptr));
42817 Fallback_free(this_ptr_conv);
42820 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
42821 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42822 *ret_copy = Fallback_clone(arg);
42823 uint64_t ret_ref = tag_ptr(ret_copy, true);
42826 int64_t __attribute__((export_name("TS_Fallback_clone_ptr"))) TS_Fallback_clone_ptr(uint64_t arg) {
42827 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
42828 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
42832 uint64_t __attribute__((export_name("TS_Fallback_clone"))) TS_Fallback_clone(uint64_t orig) {
42833 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
42834 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42835 *ret_copy = Fallback_clone(orig_conv);
42836 uint64_t ret_ref = tag_ptr(ret_copy, true);
42840 uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
42842 LDKCVec_u8Z program_ref;
42843 program_ref.datalen = program->arr_len;
42844 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
42845 memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
42846 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42847 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
42848 uint64_t ret_ref = tag_ptr(ret_copy, true);
42852 uint64_t __attribute__((export_name("TS_Fallback_pub_key_hash"))) TS_Fallback_pub_key_hash(int8_tArray a) {
42853 LDKTwentyBytes a_ref;
42854 CHECK(a->arr_len == 20);
42855 memcpy(a_ref.data, a->elems, 20); FREE(a);
42856 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42857 *ret_copy = Fallback_pub_key_hash(a_ref);
42858 uint64_t ret_ref = tag_ptr(ret_copy, true);
42862 uint64_t __attribute__((export_name("TS_Fallback_script_hash"))) TS_Fallback_script_hash(int8_tArray a) {
42863 LDKTwentyBytes a_ref;
42864 CHECK(a->arr_len == 20);
42865 memcpy(a_ref.data, a->elems, 20); FREE(a);
42866 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42867 *ret_copy = Fallback_script_hash(a_ref);
42868 uint64_t ret_ref = tag_ptr(ret_copy, true);
42872 int64_t __attribute__((export_name("TS_Fallback_hash"))) TS_Fallback_hash(uint64_t o) {
42873 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
42874 int64_t ret_conv = Fallback_hash(o_conv);
42878 jboolean __attribute__((export_name("TS_Fallback_eq"))) TS_Fallback_eq(uint64_t a, uint64_t b) {
42879 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
42880 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
42881 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
42885 void __attribute__((export_name("TS_InvoiceSignature_free"))) TS_InvoiceSignature_free(uint64_t this_obj) {
42886 LDKInvoiceSignature this_obj_conv;
42887 this_obj_conv.inner = untag_ptr(this_obj);
42888 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42890 InvoiceSignature_free(this_obj_conv);
42893 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
42894 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
42895 uint64_t ret_ref = 0;
42896 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42897 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42900 int64_t __attribute__((export_name("TS_InvoiceSignature_clone_ptr"))) TS_InvoiceSignature_clone_ptr(uint64_t arg) {
42901 LDKInvoiceSignature arg_conv;
42902 arg_conv.inner = untag_ptr(arg);
42903 arg_conv.is_owned = ptr_is_owned(arg);
42904 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42905 arg_conv.is_owned = false;
42906 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
42910 uint64_t __attribute__((export_name("TS_InvoiceSignature_clone"))) TS_InvoiceSignature_clone(uint64_t orig) {
42911 LDKInvoiceSignature orig_conv;
42912 orig_conv.inner = untag_ptr(orig);
42913 orig_conv.is_owned = ptr_is_owned(orig);
42914 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42915 orig_conv.is_owned = false;
42916 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
42917 uint64_t ret_ref = 0;
42918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42923 jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
42924 LDKInvoiceSignature a_conv;
42925 a_conv.inner = untag_ptr(a);
42926 a_conv.is_owned = ptr_is_owned(a);
42927 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42928 a_conv.is_owned = false;
42929 LDKInvoiceSignature b_conv;
42930 b_conv.inner = untag_ptr(b);
42931 b_conv.is_owned = ptr_is_owned(b);
42932 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42933 b_conv.is_owned = false;
42934 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
42938 void __attribute__((export_name("TS_PrivateRoute_free"))) TS_PrivateRoute_free(uint64_t this_obj) {
42939 LDKPrivateRoute this_obj_conv;
42940 this_obj_conv.inner = untag_ptr(this_obj);
42941 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42943 PrivateRoute_free(this_obj_conv);
42946 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
42947 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
42948 uint64_t ret_ref = 0;
42949 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42950 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42953 int64_t __attribute__((export_name("TS_PrivateRoute_clone_ptr"))) TS_PrivateRoute_clone_ptr(uint64_t arg) {
42954 LDKPrivateRoute arg_conv;
42955 arg_conv.inner = untag_ptr(arg);
42956 arg_conv.is_owned = ptr_is_owned(arg);
42957 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42958 arg_conv.is_owned = false;
42959 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
42963 uint64_t __attribute__((export_name("TS_PrivateRoute_clone"))) TS_PrivateRoute_clone(uint64_t orig) {
42964 LDKPrivateRoute orig_conv;
42965 orig_conv.inner = untag_ptr(orig);
42966 orig_conv.is_owned = ptr_is_owned(orig);
42967 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42968 orig_conv.is_owned = false;
42969 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
42970 uint64_t ret_ref = 0;
42971 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42972 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42976 int64_t __attribute__((export_name("TS_PrivateRoute_hash"))) TS_PrivateRoute_hash(uint64_t o) {
42977 LDKPrivateRoute o_conv;
42978 o_conv.inner = untag_ptr(o);
42979 o_conv.is_owned = ptr_is_owned(o);
42980 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42981 o_conv.is_owned = false;
42982 int64_t ret_conv = PrivateRoute_hash(&o_conv);
42986 jboolean __attribute__((export_name("TS_PrivateRoute_eq"))) TS_PrivateRoute_eq(uint64_t a, uint64_t b) {
42987 LDKPrivateRoute a_conv;
42988 a_conv.inner = untag_ptr(a);
42989 a_conv.is_owned = ptr_is_owned(a);
42990 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42991 a_conv.is_owned = false;
42992 LDKPrivateRoute b_conv;
42993 b_conv.inner = untag_ptr(b);
42994 b_conv.is_owned = ptr_is_owned(b);
42995 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42996 b_conv.is_owned = false;
42997 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
43001 uint64_t __attribute__((export_name("TS_SignedRawInvoice_into_parts"))) TS_SignedRawInvoice_into_parts(uint64_t this_arg) {
43002 LDKSignedRawInvoice this_arg_conv;
43003 this_arg_conv.inner = untag_ptr(this_arg);
43004 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43006 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
43007 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
43008 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
43009 return tag_ptr(ret_conv, true);
43012 uint64_t __attribute__((export_name("TS_SignedRawInvoice_raw_invoice"))) TS_SignedRawInvoice_raw_invoice(uint64_t this_arg) {
43013 LDKSignedRawInvoice this_arg_conv;
43014 this_arg_conv.inner = untag_ptr(this_arg);
43015 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43017 this_arg_conv.is_owned = false;
43018 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
43019 uint64_t ret_ref = 0;
43020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43025 int8_tArray __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t this_arg) {
43026 LDKSignedRawInvoice this_arg_conv;
43027 this_arg_conv.inner = untag_ptr(this_arg);
43028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43030 this_arg_conv.is_owned = false;
43031 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43032 memcpy(ret_arr->elems, *SignedRawInvoice_hash(&this_arg_conv), 32);
43036 uint64_t __attribute__((export_name("TS_SignedRawInvoice_signature"))) TS_SignedRawInvoice_signature(uint64_t this_arg) {
43037 LDKSignedRawInvoice this_arg_conv;
43038 this_arg_conv.inner = untag_ptr(this_arg);
43039 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43041 this_arg_conv.is_owned = false;
43042 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
43043 uint64_t ret_ref = 0;
43044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43049 uint64_t __attribute__((export_name("TS_SignedRawInvoice_recover_payee_pub_key"))) TS_SignedRawInvoice_recover_payee_pub_key(uint64_t this_arg) {
43050 LDKSignedRawInvoice this_arg_conv;
43051 this_arg_conv.inner = untag_ptr(this_arg);
43052 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43054 this_arg_conv.is_owned = false;
43055 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
43056 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
43057 return tag_ptr(ret_conv, true);
43060 jboolean __attribute__((export_name("TS_SignedRawInvoice_check_signature"))) TS_SignedRawInvoice_check_signature(uint64_t this_arg) {
43061 LDKSignedRawInvoice this_arg_conv;
43062 this_arg_conv.inner = untag_ptr(this_arg);
43063 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43065 this_arg_conv.is_owned = false;
43066 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
43070 int8_tArray __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t this_arg) {
43071 LDKRawInvoice this_arg_conv;
43072 this_arg_conv.inner = untag_ptr(this_arg);
43073 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43075 this_arg_conv.is_owned = false;
43076 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43077 memcpy(ret_arr->elems, RawInvoice_hash(&this_arg_conv).data, 32);
43081 uint64_t __attribute__((export_name("TS_RawInvoice_payment_hash"))) TS_RawInvoice_payment_hash(uint64_t this_arg) {
43082 LDKRawInvoice this_arg_conv;
43083 this_arg_conv.inner = untag_ptr(this_arg);
43084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43086 this_arg_conv.is_owned = false;
43087 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
43088 uint64_t ret_ref = 0;
43089 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43090 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43094 uint64_t __attribute__((export_name("TS_RawInvoice_description"))) TS_RawInvoice_description(uint64_t this_arg) {
43095 LDKRawInvoice this_arg_conv;
43096 this_arg_conv.inner = untag_ptr(this_arg);
43097 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43099 this_arg_conv.is_owned = false;
43100 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
43101 uint64_t ret_ref = 0;
43102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43107 uint64_t __attribute__((export_name("TS_RawInvoice_payee_pub_key"))) TS_RawInvoice_payee_pub_key(uint64_t this_arg) {
43108 LDKRawInvoice this_arg_conv;
43109 this_arg_conv.inner = untag_ptr(this_arg);
43110 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43112 this_arg_conv.is_owned = false;
43113 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
43114 uint64_t ret_ref = 0;
43115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43120 uint64_t __attribute__((export_name("TS_RawInvoice_description_hash"))) TS_RawInvoice_description_hash(uint64_t this_arg) {
43121 LDKRawInvoice this_arg_conv;
43122 this_arg_conv.inner = untag_ptr(this_arg);
43123 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43125 this_arg_conv.is_owned = false;
43126 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
43127 uint64_t ret_ref = 0;
43128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43133 uint64_t __attribute__((export_name("TS_RawInvoice_expiry_time"))) TS_RawInvoice_expiry_time(uint64_t this_arg) {
43134 LDKRawInvoice this_arg_conv;
43135 this_arg_conv.inner = untag_ptr(this_arg);
43136 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43138 this_arg_conv.is_owned = false;
43139 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
43140 uint64_t ret_ref = 0;
43141 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43142 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43146 uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
43147 LDKRawInvoice this_arg_conv;
43148 this_arg_conv.inner = untag_ptr(this_arg);
43149 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43151 this_arg_conv.is_owned = false;
43152 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
43153 uint64_t ret_ref = 0;
43154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43159 int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_RawInvoice_payment_secret(uint64_t this_arg) {
43160 LDKRawInvoice this_arg_conv;
43161 this_arg_conv.inner = untag_ptr(this_arg);
43162 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43164 this_arg_conv.is_owned = false;
43165 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43166 memcpy(ret_arr->elems, RawInvoice_payment_secret(&this_arg_conv).data, 32);
43170 uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) {
43171 LDKRawInvoice this_arg_conv;
43172 this_arg_conv.inner = untag_ptr(this_arg);
43173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43175 this_arg_conv.is_owned = false;
43176 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
43177 uint64_t ret_ref = 0;
43178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43183 uint64_tArray __attribute__((export_name("TS_RawInvoice_private_routes"))) TS_RawInvoice_private_routes(uint64_t this_arg) {
43184 LDKRawInvoice this_arg_conv;
43185 this_arg_conv.inner = untag_ptr(this_arg);
43186 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43188 this_arg_conv.is_owned = false;
43189 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
43190 uint64_tArray ret_arr = NULL;
43191 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43192 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43193 for (size_t o = 0; o < ret_var.datalen; o++) {
43194 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
43195 uint64_t ret_conv_14_ref = 0;
43196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43197 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43198 ret_arr_ptr[o] = ret_conv_14_ref;
43201 FREE(ret_var.data);
43205 uint64_t __attribute__((export_name("TS_RawInvoice_amount_pico_btc"))) TS_RawInvoice_amount_pico_btc(uint64_t this_arg) {
43206 LDKRawInvoice this_arg_conv;
43207 this_arg_conv.inner = untag_ptr(this_arg);
43208 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43210 this_arg_conv.is_owned = false;
43211 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43212 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
43213 uint64_t ret_ref = tag_ptr(ret_copy, true);
43217 uint32_t __attribute__((export_name("TS_RawInvoice_currency"))) TS_RawInvoice_currency(uint64_t this_arg) {
43218 LDKRawInvoice 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 uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv));
43227 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_unix_timestamp"))) TS_PositiveTimestamp_from_unix_timestamp(int64_t unix_seconds) {
43228 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43229 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
43230 return tag_ptr(ret_conv, true);
43233 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_duration_since_epoch"))) TS_PositiveTimestamp_from_duration_since_epoch(int64_t duration) {
43234 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43235 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
43236 return tag_ptr(ret_conv, true);
43239 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_unix_timestamp"))) TS_PositiveTimestamp_as_unix_timestamp(uint64_t this_arg) {
43240 LDKPositiveTimestamp this_arg_conv;
43241 this_arg_conv.inner = untag_ptr(this_arg);
43242 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43244 this_arg_conv.is_owned = false;
43245 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
43249 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoch"))) TS_PositiveTimestamp_as_duration_since_epoch(uint64_t this_arg) {
43250 LDKPositiveTimestamp this_arg_conv;
43251 this_arg_conv.inner = untag_ptr(this_arg);
43252 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43254 this_arg_conv.is_owned = false;
43255 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
43259 uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) {
43260 LDKInvoice this_arg_conv;
43261 this_arg_conv.inner = untag_ptr(this_arg);
43262 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43264 this_arg_conv = Invoice_clone(&this_arg_conv);
43265 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
43266 uint64_t ret_ref = 0;
43267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43272 uint64_t __attribute__((export_name("TS_Invoice_check_signature"))) TS_Invoice_check_signature(uint64_t this_arg) {
43273 LDKInvoice this_arg_conv;
43274 this_arg_conv.inner = untag_ptr(this_arg);
43275 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43277 this_arg_conv.is_owned = false;
43278 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
43279 *ret_conv = Invoice_check_signature(&this_arg_conv);
43280 return tag_ptr(ret_conv, true);
43283 uint64_t __attribute__((export_name("TS_Invoice_from_signed"))) TS_Invoice_from_signed(uint64_t signed_invoice) {
43284 LDKSignedRawInvoice signed_invoice_conv;
43285 signed_invoice_conv.inner = untag_ptr(signed_invoice);
43286 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
43287 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
43288 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
43289 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
43290 *ret_conv = Invoice_from_signed(signed_invoice_conv);
43291 return tag_ptr(ret_conv, true);
43294 int64_t __attribute__((export_name("TS_Invoice_duration_since_epoch"))) TS_Invoice_duration_since_epoch(uint64_t this_arg) {
43295 LDKInvoice this_arg_conv;
43296 this_arg_conv.inner = untag_ptr(this_arg);
43297 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43299 this_arg_conv.is_owned = false;
43300 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
43304 int8_tArray __attribute__((export_name("TS_Invoice_payment_hash"))) TS_Invoice_payment_hash(uint64_t this_arg) {
43305 LDKInvoice this_arg_conv;
43306 this_arg_conv.inner = untag_ptr(this_arg);
43307 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43309 this_arg_conv.is_owned = false;
43310 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43311 memcpy(ret_arr->elems, *Invoice_payment_hash(&this_arg_conv), 32);
43315 int8_tArray __attribute__((export_name("TS_Invoice_payee_pub_key"))) TS_Invoice_payee_pub_key(uint64_t this_arg) {
43316 LDKInvoice this_arg_conv;
43317 this_arg_conv.inner = untag_ptr(this_arg);
43318 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43320 this_arg_conv.is_owned = false;
43321 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43322 memcpy(ret_arr->elems, Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33);
43326 int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoice_payment_secret(uint64_t this_arg) {
43327 LDKInvoice this_arg_conv;
43328 this_arg_conv.inner = untag_ptr(this_arg);
43329 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43331 this_arg_conv.is_owned = false;
43332 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43333 memcpy(ret_arr->elems, *Invoice_payment_secret(&this_arg_conv), 32);
43337 uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) {
43338 LDKInvoice this_arg_conv;
43339 this_arg_conv.inner = untag_ptr(this_arg);
43340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43342 this_arg_conv.is_owned = false;
43343 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
43344 uint64_t ret_ref = 0;
43345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43350 int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS_Invoice_recover_payee_pub_key(uint64_t this_arg) {
43351 LDKInvoice this_arg_conv;
43352 this_arg_conv.inner = untag_ptr(this_arg);
43353 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43355 this_arg_conv.is_owned = false;
43356 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43357 memcpy(ret_arr->elems, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33);
43361 int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) {
43362 LDKInvoice this_arg_conv;
43363 this_arg_conv.inner = untag_ptr(this_arg);
43364 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43366 this_arg_conv.is_owned = false;
43367 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
43371 jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) {
43372 LDKInvoice this_arg_conv;
43373 this_arg_conv.inner = untag_ptr(this_arg);
43374 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43376 this_arg_conv.is_owned = false;
43377 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
43381 int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
43382 LDKInvoice this_arg_conv;
43383 this_arg_conv.inner = untag_ptr(this_arg);
43384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43386 this_arg_conv.is_owned = false;
43387 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
43391 uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) {
43392 LDKInvoice this_arg_conv;
43393 this_arg_conv.inner = untag_ptr(this_arg);
43394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43396 this_arg_conv.is_owned = false;
43397 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
43398 uint64_tArray ret_arr = NULL;
43399 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43400 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43401 for (size_t o = 0; o < ret_var.datalen; o++) {
43402 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
43403 uint64_t ret_conv_14_ref = 0;
43404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43405 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43406 ret_arr_ptr[o] = ret_conv_14_ref;
43409 FREE(ret_var.data);
43413 uint64_tArray __attribute__((export_name("TS_Invoice_route_hints"))) TS_Invoice_route_hints(uint64_t this_arg) {
43414 LDKInvoice this_arg_conv;
43415 this_arg_conv.inner = untag_ptr(this_arg);
43416 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43418 this_arg_conv.is_owned = false;
43419 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
43420 uint64_tArray ret_arr = NULL;
43421 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43422 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43423 for (size_t l = 0; l < ret_var.datalen; l++) {
43424 LDKRouteHint ret_conv_11_var = ret_var.data[l];
43425 uint64_t ret_conv_11_ref = 0;
43426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
43427 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
43428 ret_arr_ptr[l] = ret_conv_11_ref;
43431 FREE(ret_var.data);
43435 uint32_t __attribute__((export_name("TS_Invoice_currency"))) TS_Invoice_currency(uint64_t this_arg) {
43436 LDKInvoice this_arg_conv;
43437 this_arg_conv.inner = untag_ptr(this_arg);
43438 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43440 this_arg_conv.is_owned = false;
43441 uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv));
43445 uint64_t __attribute__((export_name("TS_Invoice_amount_milli_satoshis"))) TS_Invoice_amount_milli_satoshis(uint64_t this_arg) {
43446 LDKInvoice this_arg_conv;
43447 this_arg_conv.inner = untag_ptr(this_arg);
43448 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43450 this_arg_conv.is_owned = false;
43451 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43452 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
43453 uint64_t ret_ref = tag_ptr(ret_copy, true);
43457 uint64_t __attribute__((export_name("TS_Description_new"))) TS_Description_new(jstring description) {
43458 LDKStr description_conv = str_ref_to_owned_c(description);
43459 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
43460 *ret_conv = Description_new(description_conv);
43461 return tag_ptr(ret_conv, true);
43464 jstring __attribute__((export_name("TS_Description_into_inner"))) TS_Description_into_inner(uint64_t this_arg) {
43465 LDKDescription this_arg_conv;
43466 this_arg_conv.inner = untag_ptr(this_arg);
43467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43469 this_arg_conv = Description_clone(&this_arg_conv);
43470 LDKStr ret_str = Description_into_inner(this_arg_conv);
43471 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43476 uint64_t __attribute__((export_name("TS_ExpiryTime_from_seconds"))) TS_ExpiryTime_from_seconds(int64_t seconds) {
43477 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
43478 uint64_t ret_ref = 0;
43479 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43480 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43484 uint64_t __attribute__((export_name("TS_ExpiryTime_from_duration"))) TS_ExpiryTime_from_duration(int64_t duration) {
43485 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
43486 uint64_t ret_ref = 0;
43487 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43488 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43492 int64_t __attribute__((export_name("TS_ExpiryTime_as_seconds"))) TS_ExpiryTime_as_seconds(uint64_t this_arg) {
43493 LDKExpiryTime this_arg_conv;
43494 this_arg_conv.inner = untag_ptr(this_arg);
43495 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43497 this_arg_conv.is_owned = false;
43498 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
43502 int64_t __attribute__((export_name("TS_ExpiryTime_as_duration"))) TS_ExpiryTime_as_duration(uint64_t this_arg) {
43503 LDKExpiryTime this_arg_conv;
43504 this_arg_conv.inner = untag_ptr(this_arg);
43505 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43507 this_arg_conv.is_owned = false;
43508 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
43512 uint64_t __attribute__((export_name("TS_PrivateRoute_new"))) TS_PrivateRoute_new(uint64_t hops) {
43513 LDKRouteHint hops_conv;
43514 hops_conv.inner = untag_ptr(hops);
43515 hops_conv.is_owned = ptr_is_owned(hops);
43516 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
43517 hops_conv = RouteHint_clone(&hops_conv);
43518 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
43519 *ret_conv = PrivateRoute_new(hops_conv);
43520 return tag_ptr(ret_conv, true);
43523 uint64_t __attribute__((export_name("TS_PrivateRoute_into_inner"))) TS_PrivateRoute_into_inner(uint64_t this_arg) {
43524 LDKPrivateRoute this_arg_conv;
43525 this_arg_conv.inner = untag_ptr(this_arg);
43526 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43528 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
43529 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
43530 uint64_t ret_ref = 0;
43531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43532 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43536 uint32_t __attribute__((export_name("TS_CreationError_clone"))) TS_CreationError_clone(uint64_t orig) {
43537 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
43538 uint32_t ret_conv = LDKCreationError_to_js(CreationError_clone(orig_conv));
43542 uint32_t __attribute__((export_name("TS_CreationError_description_too_long"))) TS_CreationError_description_too_long() {
43543 uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
43547 uint32_t __attribute__((export_name("TS_CreationError_route_too_long"))) TS_CreationError_route_too_long() {
43548 uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
43552 uint32_t __attribute__((export_name("TS_CreationError_timestamp_out_of_bounds"))) TS_CreationError_timestamp_out_of_bounds() {
43553 uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
43557 uint32_t __attribute__((export_name("TS_CreationError_invalid_amount"))) TS_CreationError_invalid_amount() {
43558 uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
43562 uint32_t __attribute__((export_name("TS_CreationError_missing_route_hints"))) TS_CreationError_missing_route_hints() {
43563 uint32_t ret_conv = LDKCreationError_to_js(CreationError_missing_route_hints());
43567 jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
43568 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
43569 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
43570 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
43574 jstring __attribute__((export_name("TS_CreationError_to_str"))) TS_CreationError_to_str(uint64_t o) {
43575 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
43576 LDKStr ret_str = CreationError_to_str(o_conv);
43577 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43582 uint32_t __attribute__((export_name("TS_SemanticError_clone"))) TS_SemanticError_clone(uint64_t orig) {
43583 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
43584 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_clone(orig_conv));
43588 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_hash"))) TS_SemanticError_no_payment_hash() {
43589 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
43593 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_hashes"))) TS_SemanticError_multiple_payment_hashes() {
43594 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
43598 uint32_t __attribute__((export_name("TS_SemanticError_no_description"))) TS_SemanticError_no_description() {
43599 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
43603 uint32_t __attribute__((export_name("TS_SemanticError_multiple_descriptions"))) TS_SemanticError_multiple_descriptions() {
43604 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
43608 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_secret"))) TS_SemanticError_no_payment_secret() {
43609 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_secret());
43613 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_secrets"))) TS_SemanticError_multiple_payment_secrets() {
43614 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
43618 uint32_t __attribute__((export_name("TS_SemanticError_invalid_features"))) TS_SemanticError_invalid_features() {
43619 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
43623 uint32_t __attribute__((export_name("TS_SemanticError_invalid_recovery_id"))) TS_SemanticError_invalid_recovery_id() {
43624 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
43628 uint32_t __attribute__((export_name("TS_SemanticError_invalid_signature"))) TS_SemanticError_invalid_signature() {
43629 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
43633 uint32_t __attribute__((export_name("TS_SemanticError_imprecise_amount"))) TS_SemanticError_imprecise_amount() {
43634 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_imprecise_amount());
43638 jboolean __attribute__((export_name("TS_SemanticError_eq"))) TS_SemanticError_eq(uint64_t a, uint64_t b) {
43639 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
43640 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
43641 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
43645 jstring __attribute__((export_name("TS_SemanticError_to_str"))) TS_SemanticError_to_str(uint64_t o) {
43646 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
43647 LDKStr ret_str = SemanticError_to_str(o_conv);
43648 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43653 void __attribute__((export_name("TS_SignOrCreationError_free"))) TS_SignOrCreationError_free(uint64_t this_ptr) {
43654 if (!ptr_is_owned(this_ptr)) return;
43655 void* this_ptr_ptr = untag_ptr(this_ptr);
43656 CHECK_ACCESS(this_ptr_ptr);
43657 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
43658 FREE(untag_ptr(this_ptr));
43659 SignOrCreationError_free(this_ptr_conv);
43662 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
43663 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43664 *ret_copy = SignOrCreationError_clone(arg);
43665 uint64_t ret_ref = tag_ptr(ret_copy, true);
43668 int64_t __attribute__((export_name("TS_SignOrCreationError_clone_ptr"))) TS_SignOrCreationError_clone_ptr(uint64_t arg) {
43669 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
43670 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
43674 uint64_t __attribute__((export_name("TS_SignOrCreationError_clone"))) TS_SignOrCreationError_clone(uint64_t orig) {
43675 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
43676 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43677 *ret_copy = SignOrCreationError_clone(orig_conv);
43678 uint64_t ret_ref = tag_ptr(ret_copy, true);
43682 uint64_t __attribute__((export_name("TS_SignOrCreationError_sign_error"))) TS_SignOrCreationError_sign_error() {
43683 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43684 *ret_copy = SignOrCreationError_sign_error();
43685 uint64_t ret_ref = tag_ptr(ret_copy, true);
43689 uint64_t __attribute__((export_name("TS_SignOrCreationError_creation_error"))) TS_SignOrCreationError_creation_error(uint32_t a) {
43690 LDKCreationError a_conv = LDKCreationError_from_js(a);
43691 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43692 *ret_copy = SignOrCreationError_creation_error(a_conv);
43693 uint64_t ret_ref = tag_ptr(ret_copy, true);
43697 jboolean __attribute__((export_name("TS_SignOrCreationError_eq"))) TS_SignOrCreationError_eq(uint64_t a, uint64_t b) {
43698 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
43699 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
43700 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
43704 jstring __attribute__((export_name("TS_SignOrCreationError_to_str"))) TS_SignOrCreationError_to_str(uint64_t o) {
43705 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
43706 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
43707 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43712 void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
43713 LDKInvoicePayer this_obj_conv;
43714 this_obj_conv.inner = untag_ptr(this_obj);
43715 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43717 InvoicePayer_free(this_obj_conv);
43720 void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
43721 if (!ptr_is_owned(this_ptr)) return;
43722 void* this_ptr_ptr = untag_ptr(this_ptr);
43723 CHECK_ACCESS(this_ptr_ptr);
43724 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
43725 FREE(untag_ptr(this_ptr));
43726 Payer_free(this_ptr_conv);
43729 void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
43730 if (!ptr_is_owned(this_ptr)) return;
43731 void* this_ptr_ptr = untag_ptr(this_ptr);
43732 CHECK_ACCESS(this_ptr_ptr);
43733 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
43734 FREE(untag_ptr(this_ptr));
43735 Router_free(this_ptr_conv);
43738 void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
43739 if (!ptr_is_owned(this_ptr)) return;
43740 void* this_ptr_ptr = untag_ptr(this_ptr);
43741 CHECK_ACCESS(this_ptr_ptr);
43742 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
43743 FREE(untag_ptr(this_ptr));
43744 Retry_free(this_ptr_conv);
43747 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
43748 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43749 *ret_copy = Retry_clone(arg);
43750 uint64_t ret_ref = tag_ptr(ret_copy, true);
43753 int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
43754 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
43755 int64_t ret_conv = Retry_clone_ptr(arg_conv);
43759 uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
43760 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
43761 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43762 *ret_copy = Retry_clone(orig_conv);
43763 uint64_t ret_ref = tag_ptr(ret_copy, true);
43767 uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
43768 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43769 *ret_copy = Retry_attempts(a);
43770 uint64_t ret_ref = tag_ptr(ret_copy, true);
43774 jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
43775 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
43776 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
43777 jboolean ret_conv = Retry_eq(a_conv, b_conv);
43781 int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
43782 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
43783 int64_t ret_conv = Retry_hash(o_conv);
43787 void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
43788 if (!ptr_is_owned(this_ptr)) return;
43789 void* this_ptr_ptr = untag_ptr(this_ptr);
43790 CHECK_ACCESS(this_ptr_ptr);
43791 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
43792 FREE(untag_ptr(this_ptr));
43793 PaymentError_free(this_ptr_conv);
43796 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
43797 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43798 *ret_copy = PaymentError_clone(arg);
43799 uint64_t ret_ref = tag_ptr(ret_copy, true);
43802 int64_t __attribute__((export_name("TS_PaymentError_clone_ptr"))) TS_PaymentError_clone_ptr(uint64_t arg) {
43803 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
43804 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
43808 uint64_t __attribute__((export_name("TS_PaymentError_clone"))) TS_PaymentError_clone(uint64_t orig) {
43809 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
43810 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43811 *ret_copy = PaymentError_clone(orig_conv);
43812 uint64_t ret_ref = tag_ptr(ret_copy, true);
43816 uint64_t __attribute__((export_name("TS_PaymentError_invoice"))) TS_PaymentError_invoice(jstring a) {
43817 LDKStr a_conv = str_ref_to_owned_c(a);
43818 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43819 *ret_copy = PaymentError_invoice(a_conv);
43820 uint64_t ret_ref = tag_ptr(ret_copy, true);
43824 uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
43825 LDKLightningError a_conv;
43826 a_conv.inner = untag_ptr(a);
43827 a_conv.is_owned = ptr_is_owned(a);
43828 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43829 a_conv = LightningError_clone(&a_conv);
43830 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43831 *ret_copy = PaymentError_routing(a_conv);
43832 uint64_t ret_ref = tag_ptr(ret_copy, true);
43836 uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
43837 void* a_ptr = untag_ptr(a);
43838 CHECK_ACCESS(a_ptr);
43839 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
43840 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
43841 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43842 *ret_copy = PaymentError_sending(a_conv);
43843 uint64_t ret_ref = tag_ptr(ret_copy, true);
43847 uint64_t __attribute__((export_name("TS_InvoicePayer_new"))) TS_InvoicePayer_new(uint64_t payer, uint64_t router, uint64_t scorer, uint64_t logger, uint64_t event_handler, uint64_t retry) {
43848 void* payer_ptr = untag_ptr(payer);
43849 CHECK_ACCESS(payer_ptr);
43850 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
43851 if (payer_conv.free == LDKPayer_JCalls_free) {
43852 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43853 LDKPayer_JCalls_cloned(&payer_conv);
43855 void* router_ptr = untag_ptr(router);
43856 CHECK_ACCESS(router_ptr);
43857 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
43858 if (router_conv.free == LDKRouter_JCalls_free) {
43859 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43860 LDKRouter_JCalls_cloned(&router_conv);
43862 LDKMultiThreadedLockableScore scorer_conv;
43863 scorer_conv.inner = untag_ptr(scorer);
43864 scorer_conv.is_owned = ptr_is_owned(scorer);
43865 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
43866 scorer_conv.is_owned = false;
43867 void* logger_ptr = untag_ptr(logger);
43868 CHECK_ACCESS(logger_ptr);
43869 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43870 if (logger_conv.free == LDKLogger_JCalls_free) {
43871 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43872 LDKLogger_JCalls_cloned(&logger_conv);
43874 void* event_handler_ptr = untag_ptr(event_handler);
43875 CHECK_ACCESS(event_handler_ptr);
43876 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
43877 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
43878 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43879 LDKEventHandler_JCalls_cloned(&event_handler_conv);
43881 void* retry_ptr = untag_ptr(retry);
43882 CHECK_ACCESS(retry_ptr);
43883 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
43884 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
43885 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv);
43886 uint64_t ret_ref = 0;
43887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43892 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
43893 LDKInvoicePayer this_arg_conv;
43894 this_arg_conv.inner = untag_ptr(this_arg);
43895 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43897 this_arg_conv.is_owned = false;
43898 LDKInvoice invoice_conv;
43899 invoice_conv.inner = untag_ptr(invoice);
43900 invoice_conv.is_owned = ptr_is_owned(invoice);
43901 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43902 invoice_conv.is_owned = false;
43903 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43904 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
43905 return tag_ptr(ret_conv, true);
43908 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) {
43909 LDKInvoicePayer this_arg_conv;
43910 this_arg_conv.inner = untag_ptr(this_arg);
43911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43913 this_arg_conv.is_owned = false;
43914 LDKInvoice invoice_conv;
43915 invoice_conv.inner = untag_ptr(invoice);
43916 invoice_conv.is_owned = ptr_is_owned(invoice);
43917 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43918 invoice_conv.is_owned = false;
43919 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43920 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
43921 return tag_ptr(ret_conv, true);
43924 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) {
43925 LDKInvoicePayer this_arg_conv;
43926 this_arg_conv.inner = untag_ptr(this_arg);
43927 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43929 this_arg_conv.is_owned = false;
43930 LDKPublicKey pubkey_ref;
43931 CHECK(pubkey->arr_len == 33);
43932 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
43933 LDKThirtyTwoBytes payment_preimage_ref;
43934 CHECK(payment_preimage->arr_len == 32);
43935 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
43936 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43937 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
43938 return tag_ptr(ret_conv, true);
43941 void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
43942 LDKInvoicePayer this_arg_conv;
43943 this_arg_conv.inner = untag_ptr(this_arg);
43944 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43946 this_arg_conv.is_owned = false;
43947 unsigned char payment_hash_arr[32];
43948 CHECK(payment_hash->arr_len == 32);
43949 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
43950 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
43951 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
43954 uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
43955 LDKInvoicePayer this_arg_conv;
43956 this_arg_conv.inner = untag_ptr(this_arg);
43957 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43959 this_arg_conv.is_owned = false;
43960 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
43961 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
43962 return tag_ptr(ret_ret, true);
43965 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) {
43966 LDKChannelManager channelmanager_conv;
43967 channelmanager_conv.inner = untag_ptr(channelmanager);
43968 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43969 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
43970 channelmanager_conv.is_owned = false;
43971 void* keys_manager_ptr = untag_ptr(keys_manager);
43972 CHECK_ACCESS(keys_manager_ptr);
43973 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
43974 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
43975 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43976 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
43978 LDKCurrency network_conv = LDKCurrency_from_js(network);
43979 void* amt_msat_ptr = untag_ptr(amt_msat);
43980 CHECK_ACCESS(amt_msat_ptr);
43981 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
43982 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
43983 LDKSha256 description_hash_conv;
43984 description_hash_conv.inner = untag_ptr(description_hash);
43985 description_hash_conv.is_owned = ptr_is_owned(description_hash);
43986 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
43987 description_hash_conv = Sha256_clone(&description_hash_conv);
43988 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
43989 *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);
43990 return tag_ptr(ret_conv, true);
43993 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) {
43994 LDKChannelManager channelmanager_conv;
43995 channelmanager_conv.inner = untag_ptr(channelmanager);
43996 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43997 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
43998 channelmanager_conv.is_owned = false;
43999 void* keys_manager_ptr = untag_ptr(keys_manager);
44000 CHECK_ACCESS(keys_manager_ptr);
44001 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
44002 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
44003 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44004 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
44006 LDKCurrency network_conv = LDKCurrency_from_js(network);
44007 void* amt_msat_ptr = untag_ptr(amt_msat);
44008 CHECK_ACCESS(amt_msat_ptr);
44009 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
44010 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
44011 LDKStr description_conv = str_ref_to_owned_c(description);
44012 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
44013 *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);
44014 return tag_ptr(ret_conv, true);
44017 void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
44018 LDKDefaultRouter this_obj_conv;
44019 this_obj_conv.inner = untag_ptr(this_obj);
44020 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44022 DefaultRouter_free(this_obj_conv);
44025 uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) {
44026 LDKNetworkGraph network_graph_conv;
44027 network_graph_conv.inner = untag_ptr(network_graph);
44028 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44029 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44030 network_graph_conv.is_owned = false;
44031 void* logger_ptr = untag_ptr(logger);
44032 CHECK_ACCESS(logger_ptr);
44033 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44034 if (logger_conv.free == LDKLogger_JCalls_free) {
44035 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44036 LDKLogger_JCalls_cloned(&logger_conv);
44038 LDKThirtyTwoBytes random_seed_bytes_ref;
44039 CHECK(random_seed_bytes->arr_len == 32);
44040 memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
44041 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref);
44042 uint64_t ret_ref = 0;
44043 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44044 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44048 uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
44049 LDKDefaultRouter this_arg_conv;
44050 this_arg_conv.inner = untag_ptr(this_arg);
44051 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44053 this_arg_conv.is_owned = false;
44054 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
44055 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
44056 return tag_ptr(ret_ret, true);
44059 uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
44060 LDKChannelManager this_arg_conv;
44061 this_arg_conv.inner = untag_ptr(this_arg);
44062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44064 this_arg_conv.is_owned = false;
44065 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
44066 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
44067 return tag_ptr(ret_ret, true);
44070 uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {
44071 LDKStr s_conv = str_ref_to_owned_c(s);
44072 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
44073 *ret_conv = SiPrefix_from_str(s_conv);
44074 return tag_ptr(ret_conv, true);
44077 uint64_t __attribute__((export_name("TS_Invoice_from_str"))) TS_Invoice_from_str(jstring s) {
44078 LDKStr s_conv = str_ref_to_owned_c(s);
44079 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
44080 *ret_conv = Invoice_from_str(s_conv);
44081 return tag_ptr(ret_conv, true);
44084 uint64_t __attribute__((export_name("TS_SignedRawInvoice_from_str"))) TS_SignedRawInvoice_from_str(jstring s) {
44085 LDKStr s_conv = str_ref_to_owned_c(s);
44086 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
44087 *ret_conv = SignedRawInvoice_from_str(s_conv);
44088 return tag_ptr(ret_conv, true);
44091 jstring __attribute__((export_name("TS_ParseError_to_str"))) TS_ParseError_to_str(uint64_t o) {
44092 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
44093 LDKStr ret_str = ParseError_to_str(o_conv);
44094 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44099 jstring __attribute__((export_name("TS_ParseOrSemanticError_to_str"))) TS_ParseOrSemanticError_to_str(uint64_t o) {
44100 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
44101 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
44102 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44107 jstring __attribute__((export_name("TS_Invoice_to_str"))) TS_Invoice_to_str(uint64_t o) {
44109 o_conv.inner = untag_ptr(o);
44110 o_conv.is_owned = ptr_is_owned(o);
44111 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44112 o_conv.is_owned = false;
44113 LDKStr ret_str = Invoice_to_str(&o_conv);
44114 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44119 jstring __attribute__((export_name("TS_SignedRawInvoice_to_str"))) TS_SignedRawInvoice_to_str(uint64_t o) {
44120 LDKSignedRawInvoice o_conv;
44121 o_conv.inner = untag_ptr(o);
44122 o_conv.is_owned = ptr_is_owned(o);
44123 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44124 o_conv.is_owned = false;
44125 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
44126 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44131 jstring __attribute__((export_name("TS_Currency_to_str"))) TS_Currency_to_str(uint64_t o) {
44132 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
44133 LDKStr ret_str = Currency_to_str(o_conv);
44134 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44139 jstring __attribute__((export_name("TS_SiPrefix_to_str"))) TS_SiPrefix_to_str(uint64_t o) {
44140 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
44141 LDKStr ret_str = SiPrefix_to_str(o_conv);
44142 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);